-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: moved theme to config (#21)
* refactor: moved theme to config * fix: fixed typo * fix: fixed by cr
- Loading branch information
1 parent
5e29132
commit f9b9158
Showing
13 changed files
with
56 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,2 +1 @@ | ||
export * from './Theme'; | ||
export * from './Disclaimer'; |
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,14 @@ | ||
import { getMuiThemeConfig } from './muiThemeConfig'; | ||
import { customTheme as rainbowTheme } from './rainbowTheme'; | ||
import { lightTheme, darkTheme } from './theme'; | ||
|
||
export const getCustomThemes = () => { | ||
return { | ||
main: { | ||
light: lightTheme, | ||
dark: darkTheme, | ||
}, | ||
getMui: getMuiThemeConfig, | ||
rainbow: rainbowTheme, | ||
}; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,13 +1,11 @@ | ||
import { Env } from '~/types'; | ||
|
||
export const getEnv = (): Env => { | ||
const NEXT_PUBLIC_RPC_URL = process.env.NEXT_PUBLIC_RPC_URL; | ||
const NEXT_PUBLIC_PROJECT_ID = process.env.NEXT_PUBLIC_PROJECT_ID; | ||
const NEXT_PUBLIC_ALCHEMY_KEY = process.env.NEXT_PUBLIC_ALCHEMY_KEY; | ||
const env: Env = { | ||
RPC_URL: process.env.NEXT_PUBLIC_RPC_URL as string, | ||
PROJECT_ID: process.env.NEXT_PUBLIC_PROJECT_ID as string, | ||
ALCHEMY_KEY: process.env.NEXT_PUBLIC_ALCHEMY_KEY as string, | ||
}; | ||
|
||
return { | ||
RPC_URL: NEXT_PUBLIC_RPC_URL as string, | ||
PROJECT_ID: NEXT_PUBLIC_PROJECT_ID as string, | ||
ALCHEMY_KEY: NEXT_PUBLIC_ALCHEMY_KEY as string, | ||
}; | ||
export const getEnv = (): Env => { | ||
return env; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { darkTheme, lightTheme } from '~/components/Theme'; | ||
import { getConfig } from '~/config'; | ||
import { Theme, ThemeName } from '~/types'; | ||
|
||
export const getTheme = (theme?: ThemeName): Theme => { | ||
const { dark, light } = getConfig().customThemes.main; | ||
|
||
switch (theme) { | ||
case 'light': | ||
return lightTheme; | ||
return light; | ||
case 'dark': | ||
return darkTheme; | ||
return dark; | ||
default: | ||
return lightTheme; | ||
return light; | ||
} | ||
}; |