Skip to content

Commit

Permalink
Merge pull request #142 from jemiks/feat/update-theme
Browse files Browse the repository at this point in the history
fix: update theme configuration
  • Loading branch information
Chkhikvadze authored Sep 26, 2023
2 parents d788aa1 + 875ff11 commit 2313245
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/ui/src/Route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { PublicRoute } from 'routes'
import UpdatePassword from 'pages/UpdatePassword'

import { ThemeProvider } from 'styled-components'
import { defaultTheme } from 'styles/theme'
import { defaultTheme, lightTheme } from 'styles/theme'
import { WelcomeLoader } from 'components/Loader/WelcomeLoader'
import { CheatCode } from 'pages/Auth/Register/CheatCode'

Expand Down Expand Up @@ -79,7 +79,7 @@ import ToolkitModal from 'modals/ToolkitModal'

const Route = () => {
const { user, loading } = useContext(AuthContext)
const [theme] = useState(defaultTheme)
const [theme, setTheme] = useState<any>(defaultTheme)
const [cmdkOpen, setCmdkOpen] = useState(false)

useHotkeys('ctrl+enter, meta+k', event => {
Expand All @@ -88,10 +88,18 @@ const Route = () => {
return false
})

// const handleChangeTheme = (theme: any) => {
// setTheme(theme)
// }

if (loading) return <WelcomeLoader />

return (
<ThemeProvider theme={theme}>
{/* <div>
<button onClick={() => handleChangeTheme(defaultTheme)}>default Theme</button>
<button onClick={() => handleChangeTheme(lightTheme)}>light Theme</button>
</div> */}
<Routes>
<>
<Router element={<RootLayout />}>
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/components/Layout/LayoutStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Link } from 'react-router-dom'
import styled from 'styled-components'

const StyledAppContainer = styled.div`
/* background: ${({ theme }) => theme.body.testVariableColor}; */
background: linear-gradient(265.15deg, rgba(76, 166, 248, 1) -32.37%, rgba(33, 82, 243, 1) 100%);
height: 100vh;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module 'styled-components' {
textColor: string
backgroundImage: string
backgroundImageSecondary: string
testVariableColor: string
}
}
}
2 changes: 2 additions & 0 deletions apps/ui/src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const defaultTheme: DefaultTheme = {
backdropFilter: 'blur(50px)',
textColor: 'rgba(255, 255, 255)',
backgroundImageSecondary: defaultBgImageSecondary,
testVariableColor: 'var(--color-brand-blue)',
},
}

Expand All @@ -22,6 +23,7 @@ const lightTheme: DefaultTheme = {
backdropFilter: 'blur(50px);',
textColor: 'rgba(255, 255, 255)',
backgroundImageSecondary: defaultBgImageSecondary,
testVariableColor: 'var(--color-highlight_blue)',
},
}

Expand Down

0 comments on commit 2313245

Please sign in to comment.