File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ import { ThemeProvider } from '@mui/material/styles'
44import { getThemeForScope } from '../../../styles/theme'
55import CssBaseline from '@mui/material/CssBaseline'
66import { fixedNetwork } from '../../utils/route-utils'
7+ import { Layer } from '../../../oasis-nexus/api'
78
8- export const ThemeByScope : FC < { network : Network ; isRootTheme : boolean ; children : React . ReactNode } > = ( {
9- network,
10- isRootTheme,
11- children,
12- } ) => (
13- < ThemeProvider theme = { getThemeForScope ( network ) } >
9+ export const ThemeByScope : FC < {
10+ network : Network
11+ layer ?: Layer
12+ isRootTheme : boolean
13+ children : React . ReactNode
14+ } > = ( { network, layer, isRootTheme, children } ) => (
15+ < ThemeProvider theme = { getThemeForScope ( network , layer ) } >
1416 { isRootTheme && < CssBaseline /> }
1517 { children }
1618 </ ThemeProvider >
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { Network } from '../../../types/network'
1010export const RoutingErrorPage : FC = ( ) => {
1111 const scope = useScopeParam ( )
1212 return (
13- < ThemeByScope isRootTheme = { true } network = { scope ?. network ?? Network . mainnet } >
13+ < ThemeByScope isRootTheme = { true } network = { scope ?. network ?? Network . mainnet } layer = { scope ?. layer } >
1414 < PageLayout >
1515 < Divider variant = "layout" />
1616 < ErrorDisplay error = { useRouteError ( ) } />
Original file line number Diff line number Diff line change @@ -59,11 +59,14 @@ import { ConsensusAccountTransactionsCard } from './app/pages/ConsensusAccountDe
5959import { FC , useEffect } from 'react'
6060import { AnalyticsConsentProvider } from './app/components/AnalyticsConsent'
6161
62- const ScopeSpecificPart = ( ) => (
63- < ThemeByScope isRootTheme = { true } network = { useRequiredScopeParam ( ) . network } >
64- < Outlet />
65- </ ThemeByScope >
66- )
62+ const ScopeSpecificPart = ( ) => {
63+ const { network, layer } = useRequiredScopeParam ( )
64+ return (
65+ < ThemeByScope isRootTheme = { true } network = { network } layer = { layer } >
66+ < Outlet />
67+ </ ThemeByScope >
68+ )
69+ }
6770
6871/**
6972 * In case of being restricted to a specific layer or layers, jump to a dashboard
Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ import { Network } from '../../types/network'
22import { defaultTheme } from './defaultTheme'
33import { testnetTheme } from './testnet/theme'
44import type { Theme } from '@mui/material/styles/createTheme'
5+ import { Layer } from '../../oasis-nexus/api'
56
67export { defaultTheme } from './defaultTheme'
78export { testnetTheme } from './testnet/theme'
89
910export const tooltipDelay = 500
1011export const typingDelay = 1000
1112
12- export const getThemeForScope = ( network : Network ) : Theme => {
13+ export const getThemeForScope = ( network : Network , layer ?: Layer ) : Theme => {
1314 switch ( network ) {
1415 case Network . mainnet :
1516 return defaultTheme
You can’t perform that action at this time.
0 commit comments