-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1441 from oasisprotocol/csillag/more-extension-po…
…ints More configuration options for paratimes
- Loading branch information
Showing
18 changed files
with
152 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add more configuration options for paratimes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
src/app/components/ThemeByNetwork/index.tsx → src/app/components/ThemeByScope/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
import { FC, ReactNode } from 'react' | ||
import { Network } from '../../../types/network' | ||
import { ThemeProvider } from '@mui/material/styles' | ||
import { getThemesForNetworks } from '../../../styles/theme' | ||
import { getThemeForScope } from '../../../styles/theme' | ||
import CssBaseline from '@mui/material/CssBaseline' | ||
import { fixedNetwork } from '../../utils/route-utils' | ||
import { Layer } from '../../../oasis-nexus/api' | ||
|
||
export const ThemeByNetwork: FC<{ network: Network; isRootTheme: boolean; children: React.ReactNode }> = ({ | ||
network, | ||
isRootTheme, | ||
children, | ||
}) => ( | ||
<ThemeProvider theme={getThemesForNetworks()[network]}> | ||
export const ThemeByScope: FC<{ | ||
network: Network | ||
layer?: Layer | ||
isRootTheme: boolean | ||
children: React.ReactNode | ||
}> = ({ network, layer, isRootTheme, children }) => ( | ||
<ThemeProvider theme={getThemeForScope(network, layer)}> | ||
{isRootTheme && <CssBaseline />} | ||
{children} | ||
</ThemeProvider> | ||
) | ||
|
||
export const withDefaultTheme = (node: ReactNode, alwaysMainnet = false) => ( | ||
<ThemeByNetwork | ||
<ThemeByScope | ||
isRootTheme={true} | ||
network={alwaysMainnet ? Network.mainnet : fixedNetwork ?? Network.mainnet} | ||
> | ||
{node} | ||
</ThemeByNetwork> | ||
</ThemeByScope> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.