Skip to content

Commit

Permalink
Merge branch 'develop' into ruslan/csl-mem
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Jan 31, 2023
2 parents c9a6df5 + 96a59bd commit 2d942b4
Show file tree
Hide file tree
Showing 47 changed files with 398 additions and 919 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: SonarQube Checks

on:
# Trigger analysis when pushing to your main branches, and when creating a pull request.
push:
branches:
- main
- master
- develop
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
12 changes: 10 additions & 2 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export const Routes = (
)
)}
/>

<Route
path={ROUTES.NFTS.ROOT}
component={(props) => (
Expand All @@ -237,7 +236,6 @@ export const Routes = (
)
)}
/>

<Route
exact
path={ROUTES.WALLETS.ADD}
Expand Down Expand Up @@ -300,6 +298,11 @@ export const Routes = (
path={ROUTES.SWITCH}
component={(props) => <WalletSwitch {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.REVAMP.CATALYST_VOTING}
component={(props) => <VotingPage {...props} stores={stores} actions={actions} />}
/>
<Redirect to={ROUTES.MY_WALLETS} />
</Switch>
</Suspense>
Expand Down Expand Up @@ -352,6 +355,11 @@ const WalletsSubpages = (stores, actions) => (
path={ROUTES.WALLETS.CATALYST_VOTING}
component={(props) => <VotingPage {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.REVAMP.TRANSFER}
component={(props) => <Transfer {...props} stores={stores} actions={actions} />}
/>
</Switch>
);

Expand Down
16 changes: 14 additions & 2 deletions packages/yoroi-extension/app/api/localStorage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const storageKeys = {
CATALYST_ROUND_INFO: networkForLocalStorage + '-CATALYST_ROUND_INFO',
// ========== CONNECTOR ========== //
ERGO_CONNECTOR_WHITELIST: 'connector_whitelist',
SELECTED_WALLET: 'SELECTED_WALLET',
};

export type SetCustomUserThemeRequest = {|
Expand All @@ -46,7 +47,6 @@ export type SetCustomUserThemeRequest = {|
export type WalletsNavigation = {|
ergo: number[],
cardano: number[],
quickAccess: number[],
|}

/**
Expand Down Expand Up @@ -119,6 +119,19 @@ export default class LocalStorageApi {

unsetUserTheme: void => Promise<void> = () => removeLocalItem(storageKeys.THEME);

// ========== Select Wallet ========== //

getSelectedWalletId: void => number | null = () => {
const id = localStorage.getItem(storageKeys.SELECTED_WALLET);
if (!id) return null
if (isNaN(Number(id))) throw new Error(`Invalid wallet Id: ${id}`);
return Number(id)
}

setSelectedWalletId: number => void = (id) => {
localStorage.setItem(storageKeys.SELECTED_WALLET, id.toString())
}

// ========== Custom User Theme ========== //

getCustomUserTheme: void => Promise<?string> = () => getLocalItem(storageKeys.CUSTOM_THEME);
Expand Down Expand Up @@ -286,7 +299,6 @@ export default class LocalStorageApi {
if(Array.isArray(result)) return {
cardano: [],
ergo: [],
quickAccess: [],
}

return result
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function TextField({
theme.name === 'classic' ? { shrink: true, ...InputLabelProps } : { ...InputLabelProps }
}
InputProps={{
disableUnderline: revamp,
...(theme.name === 'classic' ? { notched: false } : {}),
endAdornment:
type === 'password' ? (
Expand Down Expand Up @@ -112,7 +113,6 @@ function TextField({
{Boolean(error) === true ? <ErrorIcon /> : done === true ? <DoneIcon /> : null}
</InputAdornment>
),
disableUnderline: revamp,
placeholder: placeholder != null ? placeholder : '',
}}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ const messages = defineMessages({

type Props = {|
+currentTheme: Theme,
+selectTheme: ({| theme: string |}) => PossiblyAsync<void>,
+onSubmit: (theme: string) => PossiblyAsync<void>,
+onExternalLinkClick: MouseEvent => void,
+switchToFirstWallet: void => void,
|};

const NEW_THEME = THEMES.YOROI_REVAMP
Expand All @@ -89,7 +88,7 @@ export default class ThemeSettingsBlock extends Component<Props> {
render(): Node {
const {
currentTheme,
selectTheme,
onSubmit,
onExternalLinkClick,
} = this.props;
const { intl } = this.context;
Expand Down Expand Up @@ -121,7 +120,7 @@ export default class ThemeSettingsBlock extends Component<Props> {
value={currentTheme === NEW_THEME ? NEW_THEME : OLD_THEME}
onChange={(e) => {
const theme = e.target.value === NEW_THEME ? NEW_THEME : THEMES.YOROI_MODERN
selectTheme({ theme })
onSubmit(theme)
}}
sx={{
display: 'flex',
Expand Down Expand Up @@ -177,7 +176,7 @@ export default class ThemeSettingsBlock extends Component<Props> {
row
value={currentTheme}
onChange={(e) => {
selectTheme({ theme: e.target.value })
onSubmit(e.target.value)
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', marginRight: '24px' }}>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2d942b4

Please sign in to comment.