Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(desktop-app): tauri setup #1160

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open

feat(desktop-app): tauri setup #1160

wants to merge 58 commits into from

Conversation

dr-leevsey
Copy link
Member

yarn tauri dev to start development mode
yarn tauri build produces APP bundle and DMG under src-tauri/target/release folder

Copy link

netlify bot commented May 13, 2024

Deploy Preview for cyb-xp ready!

Name Link
🔨 Latest commit 3c0eb6e
🔍 Latest deploy log https://app.netlify.com/sites/cyb-xp/deploys/67138561c7794d0008225d63
😎 Deploy Preview https://deploy-preview-1160--cyb-xp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 13, 2024

Deploy Preview for rebyc ready!

Name Link
🔨 Latest commit 3c0eb6e
🔍 Latest deploy log https://app.netlify.com/sites/rebyc/deploys/67138561d26e5400089858c7
😎 Deploy Preview https://deploy-preview-1160--rebyc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@happylolonly happylolonly added feature Atomic function which can be described epic Set of features which add significant value labels Jun 30, 2024
@happylolonly happylolonly marked this pull request as draft July 10, 2024 05:25
@@ -24,6 +24,13 @@ const links: Array<MenuItem[]> = [
icon: '🗝',
},
],
[
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I undestand this shoudn't be if no signer flag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it must be available if there's no keplr extension, it's not desktop only

@@ -0,0 +1,8 @@
import { CSSProperties } from 'react';

export const heading: CSSProperties = { marginBottom: '25px' };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scss


export default function Sign() {
const { signingClient } = useSigningClient();
const [params] = useSearchParams();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems types can be added

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what kind of types?

<div>
<h2 style={styles.heading}>Confirm transaction</h2>
{messages && messages.length > 0 && (
<div style={{ paddingTop: '23px', paddingBottom: '46px' }}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scss

@@ -1,30 +1,31 @@
import React, { Component } from 'react';
/* eslint-disable */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this not good, for what?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was already there, I just moved it to top of file I guess
I can remove it

@@ -300,7 +301,11 @@ class ActionBarContainer extends Component<Props> {
const isOwner = defaultAccount && defaultAccount.bech32 === addressSend;

if (stage === STAGE_INIT) {
const followBtn = <Button onClick={this.onClickSend}>Follow</Button>;
const followBtn = (
<Button key={'action-bar-button-follow'} onClick={this.onClickSend}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

@@ -20,29 +29,46 @@ function useSetupIbcClient(denom, network) {

let client = null;
if (network && network !== CHAIN_ID) {
const { rpc, prefix, sourceChainId, chainId } = networks[network];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimakorzhovnik please review

@@ -0,0 +1,76 @@
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be removed?

@@ -0,0 +1,70 @@
import { StdFee } from '@cosmjs/launchpad';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I see this file almost not being used, it is needed? lets discuss

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmation is still in use

DB_STORE_NAME,
onIndexedDbWrite
);
if (!process.env.IS_TAURI) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this flag better rename to IS_DESKTOP?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

@@ -1,3 +1,4 @@
/* eslint-disable import/prefer-default-export */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use this with next line not global

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my counter-offer is to disable this rule completely, it's more headache then benefit

memo?: string | undefined;
}

export class SignerModalHandler {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it can be context better? to use OOP less with react

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it would be context it would be also redux (what's the difference to be honest?!)
it's done that way to make it possible to use it outside the react scope (literally in CybSignerClient)

declare global {
interface Window {
store: Store;
clipboardData?: DataTransfer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clipboardData needed to specify?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check it's usage, it will be clear

export type Option<T> = T | undefined;
export type Nullable<T> = T | null | undefined;
export type ArrayElement<ArrayType extends readonly unknown[]> =
ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
declare global {
interface Window {
store: Store;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import { requestWithRetry } from './request-with-retry';

/* eslint-disable import/prefer-default-export */
export const getTxsWithRetry = async (txs: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not being used

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, right now it's not
but it look much better alternative to this pattern
image

/* eslint-disable import/prefer-default-export */
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';

export const requestWithRetry = async (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this


let navigate: NavigateFunction;

export const setNavigate = (nav: NavigateFunction) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not using

@@ -442,3 +442,5 @@ export {
getNowUtcTime,
accountsKeplr,
};

export const getMnemonic = () => localStorage.getItem('cyb:mnemonic');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localStorageKeys

const CompressionWebpackPlugin = require('compression-webpack-plugin');
const commonConfig = require('./webpack.config.common');

module.exports = merge(commonConfig, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can production config be reused/merged?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's possible
matter of time as lots of other things

[style]
);

return isOpen ? (
Copy link
Member

@happylolonly happylolonly Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better (!isOpen) {
return null
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on early return

Copy link
Member

@happylolonly happylolonly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need some small fixes, but core is ok

@happylolonly happylolonly marked this pull request as ready for review October 18, 2024 09:54
@happylolonly happylolonly changed the title feat(desktop-app): initial tauri setup feat(desktop-app): tauri setup Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Set of features which add significant value feature Atomic function which can be described
Projects
Status: review
Development

Successfully merging this pull request may close these issues.

5 participants