-
Notifications
You must be signed in to change notification settings - Fork 40
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cyb-xp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for rebyc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…wnload and signing flow fixes
… feat/tauri-app
@@ -24,6 +24,13 @@ const links: Array<MenuItem[]> = [ | |||
icon: '🗝', | |||
}, | |||
], | |||
[ | |||
{ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' }; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' }}> |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clipboardData needed to specify?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* eslint-disable import/prefer-default-export */ | ||
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
|
||
export const requestWithRetry = async ( |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not using
src/utils/utils.ts
Outdated
@@ -442,3 +442,5 @@ export { | |||
getNowUtcTime, | |||
accountsKeplr, | |||
}; | |||
|
|||
export const getMnemonic = () => localStorage.getItem('cyb:mnemonic'); |
There was a problem hiding this comment.
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, { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
src/components/modal/Modal.tsx
Outdated
[style] | ||
); | ||
|
||
return isOpen ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better (!isOpen) {
return null
}
There was a problem hiding this comment.
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
There was a problem hiding this 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
yarn tauri dev
to start development modeyarn tauri build
produces APP bundle and DMG undersrc-tauri/target/release
folder