Skip to content

Commit

Permalink
update current theme and deprecate old themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Patriciu Nista committed Apr 29, 2024
1 parent d3e434c commit 8741731
Show file tree
Hide file tree
Showing 64 changed files with 2,008 additions and 1,944 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Props = {|
+onExternalLinkClick: MouseEvent => void,
|};

const NEW_THEME = THEMES.YOROI_REVAMP;
const NEW_THEME = THEMES.YOROI_BASE;
const OLD_THEME = `${THEMES.YOROI_MODERN}-${THEMES.YOROI_CLASSIC}`;
@observer
export default class ThemeSettingsBlock extends Component<Props> {
Expand All @@ -90,7 +90,7 @@ export default class ThemeSettingsBlock extends Component<Props> {
render(): Node {
const { currentTheme, onSubmit, onExternalLinkClick } = this.props;
const { intl } = this.context;
const isRevampLayout = currentTheme === THEMES.YOROI_REVAMP;
const isRevampLayout = currentTheme === THEMES.YOROI_BASE;

const blogLink = (
<Typography
Expand Down Expand Up @@ -162,12 +162,12 @@ export default class ThemeSettingsBlock extends Component<Props> {
/>
</RadioGroup>
</Box>
{false && currentTheme === THEMES.YOROI_REVAMP && environment.isDev() && (
{false && currentTheme === THEMES.YOROI_BASE && environment.isDev() && (
<Box sx={{ mt: '20px' }}>
<ThemeToggler />
</Box>
)}
{currentTheme !== THEMES.YOROI_REVAMP && (
{currentTheme !== THEMES.YOROI_BASE && (
<Box>
<Box sx={{ marginTop: '20px' }}>
<Typography component="div"
Expand Down
5 changes: 3 additions & 2 deletions packages/yoroi-extension/app/components/widgets/CodeBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Component } from 'react';
import type { Node } from 'react';
import { observer } from 'mobx-react';
import styles from './CodeBlock.scss';
import { Box } from '@mui/material';

type Props = {|
+code: string | Node,
Expand All @@ -12,9 +13,9 @@ type Props = {|
export default class CodeBlock extends Component<Props> {
render(): Node {
return (
<div className={styles.component}>
<Box sx={{bgcolor: "grayscale.100"}} className={styles.component}>
<code>{this.props.code}</code>
</div>
</Box>
);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.component {
code {
background: #f4f4f4;
// background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #f36d33;
color: var(--yoroi-palette-gray-600);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class GeneralSettingsPage extends Component<StoresAndActionsProps
<ThemeSettingsBlock
currentTheme={currentTheme}
onSubmit={(theme: string) => {
if (theme === THEMES.YOROI_REVAMP) {
if (theme === THEMES.YOROI_BASE) {
const { wallets } = this.props.stores;
const publicDeriver = wallets.selected;
const publicDerivers = wallets.publicDerivers;
Expand Down
8 changes: 4 additions & 4 deletions packages/yoroi-extension/app/stores/base/BaseProfileStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ export default class BaseProfileStore
if (result != null) {
if (!this.didUserMigratedToRevampTheme) {
this.setUserRevampMigrationStatusRequest.execute(true);
this._updateTheme({ theme: THEMES.YOROI_REVAMP });
return THEMES.YOROI_REVAMP;
this._updateTheme({ theme: THEMES.YOROI_BASE });
return THEMES.YOROI_BASE;
}

// verify content is an actual theme
Expand All @@ -367,11 +367,11 @@ export default class BaseProfileStore
}
}

return THEMES.YOROI_REVAMP;
return THEMES.YOROI_BASE;
}

@computed get isRevampTheme(): boolean {
return this.currentTheme === THEMES.YOROI_REVAMP;
return this.currentTheme === THEMES.YOROI_BASE;
}

@computed get isModernTheme(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/styles/context/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const LayoutContext = React.createContext();

const LayoutProvider = (props: Object): Node => {
const { layout } = props;
const localLayout: Layouts = layout === THEMES.YOROI_REVAMP ? 'REVAMP' : 'CLASSIC';
const localLayout: Layouts = layout === THEMES.YOROI_BASE ? 'REVAMP' : 'CLASSIC';

return (
<LayoutContext.Provider
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/styles/context/mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function ColorModeProvider({ children, currentTheme }: any): Node {

// Update the theme only if the mode changes
const theme = React.useMemo(() => {
if (currentTheme === THEMES.YOROI_REVAMP) return getDesignTokens(mode);
if (currentTheme === THEMES.YOROI_BASE) return getDesignTokens(mode);
return MuiThemes[currentTheme];
}, [mode, currentTheme]);

Expand Down

0 comments on commit 8741731

Please sign in to comment.