Skip to content

Commit

Permalink
Merge pull request #3688 from Emurgo/ruslan/YOEXT-1433/removing-legac…
Browse files Browse the repository at this point in the history
…y-theme-functions

removing theme legacy
  • Loading branch information
vsubhuman authored Dec 24, 2024
2 parents 6067904 + f73415e commit 5ce89c2
Show file tree
Hide file tree
Showing 251 changed files with 737 additions and 9,303 deletions.
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 @@ -138,12 +138,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 @@ -154,7 +148,6 @@ const ExchangeEndPagePromise = () => import('./containers/ExchangeEndPage');
const ExchangeEndPage = React.lazy(ExchangeEndPagePromise);

export const LazyLoadPromises: Array<() => any> = [
AddAnotherWalletPromise,
StakingPageContentPromise,
CreateWalletPagePromise,
RestoreWalletPagePromise,
Expand Down Expand Up @@ -188,8 +181,6 @@ export const LazyLoadPromises: Array<() => any> = [
NFTsPageRevampPromise,
NFTDetailPageRevampPromise,
ConnectedWebsitesPagePromise,
YoroiPalettePagePromise,
YoroiThemesPagePromise,
SwapPagePromise,
SwapOrdersPagePromise,
OptForAnalyticsPagePromise,
Expand Down Expand Up @@ -271,16 +262,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);
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

0 comments on commit 5ce89c2

Please sign in to comment.