Skip to content

Commit 669e4ec

Browse files
committed
Add support for adding custom themes for specific paratimes
1 parent 1b7c6af commit 669e4ec

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Layer } from './oasis-nexus/generated/api'
44
import { NativeToken, NativeTokenInfo } from './types/ticker'
55
import { SearchScope } from './types/searchScope'
66
import { Network } from './types/network'
7+
import type { Theme } from '@mui/material/styles/createTheme'
78

89
export const consensusDecimals = 9
910
/**
@@ -213,3 +214,8 @@ export const specialScopePaths: Partial<Record<Network, Partial<Record<Layer, [s
213214
[Network.mainnet]: {},
214215
[Network.testnet]: {},
215216
}
217+
218+
export const specialScopeThemes: Partial<Record<Network, Partial<Record<Layer, Theme>>>> = {
219+
[Network.mainnet]: {},
220+
[Network.testnet]: {},
221+
}

src/styles/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defaultTheme } from './defaultTheme'
33
import { testnetTheme } from './testnet/theme'
44
import type { Theme } from '@mui/material/styles/createTheme'
55
import { Layer } from '../../oasis-nexus/api'
6+
import { specialScopeThemes } from '../../config'
67

78
export { defaultTheme } from './defaultTheme'
89
export { testnetTheme } from './testnet/theme'
@@ -11,6 +12,9 @@ export const tooltipDelay = 500
1112
export const typingDelay = 1000
1213

1314
export const getThemeForScope = (network: Network, layer?: Layer): Theme => {
15+
const specialTheme = layer ? specialScopeThemes[network]?.[layer] : undefined
16+
if (specialTheme) return specialTheme
17+
1418
switch (network) {
1519
case Network.mainnet:
1620
return defaultTheme

0 commit comments

Comments
 (0)