Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue-#1611
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed Jan 24, 2025
2 parents fbdeffb + 07f0b53 commit ff01219
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ The file `common.ts` with type [`AppConfig`](src/config/types.ts) contains impor
- `priceChart`: use `tradingView` chart or `native` chart for token pair price history. You need to provide a backend with price history endpoint to support `native` view.
- `useGradientBranding`: Flag to enable gradient styles for buttons.
- `tradeCount`: Display the amount of trades in the explorer page.
- `currencyMenu`: Display the currency menu to switch between currencies.

#### Gas token different than native token

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion e2e/utils/DebugDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const setupLocalStorage = async (page: Page, tenderlyRpc: string) => {
// each value is stringified to match lsservice
for (const [key, value] of Object.entries(storage)) {
localStorage.setItem(
`carbon-ethereum-v1.2-${key}`,
`carbon-ethereum-v1.3-${key}`,
JSON.stringify(value)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ReactComponent as IconYoutube } from 'assets/logos/youtube.svg';
import { ReactComponent as IconDiscord } from 'assets/logos/discord.svg';
import { ReactComponent as IconTelegram } from 'assets/logos/telegram.svg';
import { ReactComponent as IconV } from 'assets/icons/v.svg';
import config from 'config';

export type MenuItemType = {
subMenu?: MenuType;
Expand All @@ -27,10 +28,6 @@ export const useBurgerMenuItems = () => {
const menuMap = new Map<MenuType, Menu>();

const mainItems: MenuItemType[] = [
{
subMenu: 'currency',
content: <CurrencyMenuItemContent />,
},
{
subMenu: 'resources',
content: 'Resources',
Expand Down Expand Up @@ -101,6 +98,13 @@ export const useBurgerMenuItems = () => {
),
},
];
if (config.ui.currencyMenu) {
mainItems.unshift({
subMenu: 'currency',
content: <CurrencyMenuItemContent />,
});
}
menuMap.set('main', { items: mainItems });

const currencyItems = useMemo(
(): MenuItemType[] => [
Expand Down Expand Up @@ -133,6 +137,12 @@ export const useBurgerMenuItems = () => {
],
[availableCurrencies, selectedFiatCurrency, setSelectedFiatCurrency]
);
if (config.ui.currencyMenu) {
menuMap.set('currency', {
items: currencyItems,
title: 'Currency',
});
}

const resourcesItems: MenuItemType[] = [
{
Expand Down Expand Up @@ -171,12 +181,6 @@ export const useBurgerMenuItems = () => {
),
},
];

menuMap.set('main', { items: mainItems });
menuMap.set('currency', {
items: currencyItems,
title: 'Currency',
});
menuMap.set('resources', {
items: resourcesItems,
title: 'Resources',
Expand Down
1 change: 1 addition & 0 deletions src/config/blast/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@ export const commonConfig: AppConfig = {
priceChart: 'tradingView',
useGradientBranding: true,
tradeCount: false,
currencyMenu: false,
},
};
1 change: 1 addition & 0 deletions src/config/celo/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@ export const commonConfig: AppConfig = {
priceChart: 'native',
useGradientBranding: true,
tradeCount: true,
currencyMenu: false,
},
};
1 change: 1 addition & 0 deletions src/config/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ export const AppConfigSchema = v.object({
priceChart: v.union([v.literal('native'), v.literal('tradingView')]),
useGradientBranding: v.optional(v.boolean()),
tradeCount: v.optional(v.boolean()),
currencyMenu: v.optional(v.boolean()),
}),
});
1 change: 1 addition & 0 deletions src/config/ethereum/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,6 @@ export const commonConfig: AppConfig = {
priceChart: 'native',
useGradientBranding: true,
tradeCount: false,
currencyMenu: true,
},
};
1 change: 1 addition & 0 deletions src/config/sei/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ export const commonConfig: AppConfig = {
priceChart: 'native',
useGradientBranding: true,
tradeCount: true,
currencyMenu: false,
},
};
14 changes: 14 additions & 0 deletions src/services/localeStorage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ const migrations: Migration[] = [
migrateAndRemoveItem({ prevFormattedKey, nextFormattedKey });
},
},
{
migrate: (prevFormattedKey) => {
const prefix = `carbon-${NETWORK}-v1.2-`;
if (prevFormattedKey === `${prefix}currentCurrency`) {
if (NETWORK !== 'ethereum') removeItem({ prevFormattedKey });
}
const isMatch = prevFormattedKey.startsWith(prefix);
if (!isMatch) return;
const key = prevFormattedKey.slice(prefix.length);
if (!key) return;
const nextFormattedKey = ['carbon', NETWORK, 'v1.3', key].join('-');
migrateAndRemoveItem({ prevFormattedKey, nextFormattedKey });
},
},
];

export const lsService = new ManagedLocalStorage<LocalStorageSchema>(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const APP_ID = 'carbon';
export const APP_VERSION = 'v1.2';
export const APP_VERSION = 'v1.3';
export const NETWORK = import.meta.env.VITE_NETWORK || 'ethereum';

0 comments on commit ff01219

Please sign in to comment.