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

removing theme legacy #3688

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions packages/yoroi-extension/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import { observable, autorun, runInAction } from 'mobx';
import { Routes } from './Routes';
import { locales, translations } from './i18n/translations';
import { Logger } from './utils/logging';
import { LayoutProvider } from './styles/context/layout';
import { ColorModeProvider } from './styles/context/mode';
import { CssBaseline } from '@mui/material';
import { globalStyles } from './styles/globalStyles';
import { changeToplevelTheme, MuiThemes, THEMES } from './styles/themes';
import { changeToplevelTheme, MuiThemes } from './styles/themes';
import ThemeManager from './ThemeManager';
import environment from './environment';
import MaintenancePage from './containers/MaintenancePage';
Expand Down Expand Up @@ -82,27 +81,22 @@ class App extends Component<Props, State> {
'--default-font': !environment.isProduction() ? 'wingdings' : 'Times New Roman',
};

const currentTheme = stores.profile.currentTheme || THEMES.YOROI_BASE;

const currentTheme = stores.profile.currentTheme;
changeToplevelTheme(currentTheme);

const muiTheme = MuiThemes[currentTheme];

Logger.debug(`[yoroi] themes changed`);

return (
<div style={{ height: '100%' }}>
<LayoutProvider layout={currentTheme}>
<ColorModeProvider currentTheme={currentTheme}>
<CssBaseline />
{globalStyles(muiTheme)}
<ThemeManager cssVariables={themeVars} />
{/* Automatically pass a theme prop to all components in this subtree. */}
<IntlProvider {...{ locale, key: locale, messages: mergedMessages }}>
{this.getContent()}
</IntlProvider>
</ColorModeProvider>
</LayoutProvider>
<ColorModeProvider>
<CssBaseline />
{globalStyles(muiTheme)}
<ThemeManager cssVariables={themeVars} />
{/* Automatically pass a theme prop to all components in this subtree. */}
<IntlProvider {...{ locale, key: locale, messages: mergedMessages }}>
{this.getContent()}
</IntlProvider>
</ColorModeProvider>
</div>
);
}
Expand Down
21 changes: 1 addition & 20 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ConfigType } from '../config/config-types';
import type { ActionsMap } from './actions/index';
import ConnectedWebsitesPage, { ConnectedWebsitesPagePromise } from './containers/dapp-connector/ConnectedWebsitesContainer';
import Transfer, { WalletTransferPagePromise } from './containers/transfer/Transfer';
import AddWalletPage, { AddAnotherWalletPromise } from './containers/wallet/AddWalletPage';
import AddWalletPage from './containers/wallet/AddWalletPage';
import StakingPage, { StakingPageContentPromise } from './containers/wallet/staking/StakingPage';
import VotingPage, { VotingPageContentPromise } from './containers/wallet/voting/VotingPage';
import { ROUTES } from './routes-config';
Expand Down Expand Up @@ -133,12 +133,6 @@ const NFTsPageRevamp = React.lazy(NFTsPageRevampPromise);
const NFTDetailPageRevampPromise = () => import('./containers/wallet/NFTDetailPageRevamp');
const NFTDetailPageRevamp = React.lazy(NFTDetailPageRevampPromise);

const YoroiPalettePagePromise = () => import('./containers/experimental/YoroiPalette');
const YoroiPalettePage = React.lazy(YoroiPalettePagePromise);

const YoroiThemesPagePromise = () => import('./containers/experimental/yoroiThemes');
const YoroiThemesPage = React.lazy(YoroiThemesPagePromise);

// SWAP
const SwapPagePromise = () => import('./containers/swap/asset-swap/SwapPage');
const SwapPage = React.lazy(SwapPagePromise);
Expand All @@ -149,7 +143,6 @@ const ExchangeEndPagePromise = () => import('./containers/ExchangeEndPage');
const ExchangeEndPage = React.lazy(ExchangeEndPagePromise);

export const LazyLoadPromises: Array<() => any> = [
AddAnotherWalletPromise,
StakingPageContentPromise,
CreateWalletPagePromise,
RestoreWalletPagePromise,
Expand Down Expand Up @@ -183,8 +176,6 @@ export const LazyLoadPromises: Array<() => any> = [
NFTsPageRevampPromise,
NFTDetailPageRevampPromise,
ConnectedWebsitesPagePromise,
YoroiPalettePagePromise,
YoroiThemesPagePromise,
SwapPagePromise,
SwapOrdersPagePromise,
OptForAnalyticsPagePromise,
Expand Down Expand Up @@ -267,16 +258,6 @@ export const Routes = (stores: StoresMap, actions: ActionsMap): Node => {
path={ROUTES.DAPP_CONNECTOR.CONNECTED_WEBSITES}
component={props => <ConnectedWebsitesPage {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.EXPERIMENTAL.YOROI_PALETTE}
component={props => <YoroiPalettePage {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.EXPERIMENTAL.THEMES}
component={props => <YoroiThemesPage {...props} stores={stores} actions={actions} />}
/>
<Route
path={ROUTES.WALLETS.ROOT}
component={props => wrapWallet({ ...props, stores, actions }, WalletsSubpages(stores, actions))}
Expand Down
5 changes: 1 addition & 4 deletions packages/yoroi-extension/app/UI/layout/GeneralPageLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import { intlShape } from 'react-intl';
import TopBarLayout from '../../components/layout/TopBarLayout';
import BannerContainer from '../../containers/banners/BannerContainer';
import SidebarContainer from '../../containers/SidebarContainer';
import { withLayout } from '../../styles/context/layout';
import { ModalProvider } from '../components/modals/ModalContext';
import { ModalManager } from '../components/modals/ModalManager';
import { IntlProvider } from '../context/IntlProvider';

@observer
class GeneralPageLayout extends React.Component {
export default class GeneralPageLayout extends React.Component {
static defaultProps = {
children: undefined,
};
Expand All @@ -36,5 +35,3 @@ class GeneralPageLayout extends React.Component {
);
}
}

export default withLayout(GeneralPageLayout);
Empty file.
35 changes: 0 additions & 35 deletions packages/yoroi-extension/app/api/verify.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/yoroi-extension/app/assets/images/add-label.inline.svg

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions packages/yoroi-extension/app/assets/images/cross-dark.inline.svg

This file was deleted.

This file was deleted.

Loading