Skip to content

Commit

Permalink
⚙ Setting(#37): Route 최신화
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetree7878 committed Nov 5, 2024
1 parent d42fe16 commit fd71ed4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Router from './route/Router';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { ThemeProvider } from 'styled-components';
import { theme } from './style/theme';
import { media } from './style/media';
import GlobalStyle from './style/GlobalStyle';
import GlobalFont from './style/GlobalFont';

Expand All @@ -18,7 +18,7 @@ function App() {
return (
<>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<ThemeProvider theme={media}>
<GlobalStyle />
<GlobalFont />
<Router />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/Main.tsx → src/pages/learn/Learn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
LayOutDiv,
FeatureDiv,
} from '../../style/LayOut';
export default function Main() {
export default function Learn() {
return (
<AlignCenter>
<GridContainer>
Expand Down
16 changes: 9 additions & 7 deletions src/route/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import Main from '../pages/main/Main';
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom';
import Learn from '../pages/learn/Learn';
import Quest from '../pages/quest/Quest';
import Ranking from '../pages/ranking/Ranking';
import Quiz from '../pages/quiz/Quiz';
import Login from '../pages/login/Login';

export default function Router() {
return (
<>
<BrowserRouter>
<Routes>
<Route path="/" element={<Main />}></Route>
<Route path="/quest" element={<Quest />}></Route>
<Route path="/ranking" element={<Ranking />}></Route>
<Route path="/quiz" element={<Quiz />}></Route>
<Route path="/login" element={<Login />}></Route>
<Route path="/" element={<Navigate to="/learn" />} />
<Route path="/learn" element={<Learn />} />
<Route path="/quest" element={<Quest />} />
<Route path="/ranking" element={<Ranking />} />
<Route path="/quiz" element={<Quiz />} />
<Route path="/login" element={<Login />} />
</Routes>
</BrowserRouter>
</>
Expand Down
6 changes: 6 additions & 0 deletions src/style/GlobalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const GlobalStyle = createGlobalStyle`
padding: 0;
box-sizing: border-box;
}
body {
background-color: #FFF8EB;
}
button {
cursor: pointer;
}
`;

export default GlobalStyle;
8 changes: 1 addition & 7 deletions src/style/theme.ts → src/style/media.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
export const theme = {
/** @example color: ${({ theme }) => theme.color.main; */
color: {
main: '#0070f3',
sub: '#1db954',
},

export const media = {
/**
* @example
* ${({ theme }) => theme.media.desktop} {
Expand Down

0 comments on commit fd71ed4

Please sign in to comment.