Skip to content

Commit

Permalink
Merge pull request #53 from keepgoingLikelion/feature/42-build-setting
Browse files Browse the repository at this point in the history
[Feat] #42 -
  • Loading branch information
flareseek authored Feb 21, 2024
2 parents 6d2503b + 84747b2 commit f147bde
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 47 deletions.
36 changes: 18 additions & 18 deletions dist/assets/index-B2GMnS08.js → dist/assets/index-CuyJAMme.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>머랭?!</title>
<script type="module" crossorigin src="/meringue-FE/assets/index-B2GMnS08.js"></script>
<script type="module" crossorigin src="/meringue-FE/assets/index-CuyJAMme.js"></script>
<link rel="stylesheet" crossorigin href="/meringue-FE/assets/index-Bx_8Ul5v.css">
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.0.0",
"type": "module",
"homepage": "https://keepgoinglikelion.github.io/meringue-FE/",
"scripts": {
"dev": "vite",
"build": "tsc && vite build --base=/meringue-FE",
Expand Down
45 changes: 24 additions & 21 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './App.css';
import {
BrowserRouter,
BrowserRouter as Router, Route, Routes,
} from 'react-router-dom';
import axios from 'axios';
Expand Down Expand Up @@ -35,27 +36,29 @@ function App() {
}, []);

return (
<Router>
{!todayPost && (
<div>
<LuLoader
style={{ color: '#FFFBF2', width: '30px', height: '30px' }}
/>
</div>
)}
<Routes>
<Route path="/" element={<LoginView />} />
<Route path="/main" element={todayPost && <div><MainPage /></div>} />
<Route path="/newpost" element={<TodayPostView setType={setType} />} />
<Route path="/start" element={<StartView type={type} />} />
<Route path="/post/:postId" element={todayPost && <StickerView />} />
<Route path="/mypage" element={<UserPage />} />
<Route path="/mylog/:emotionType" element={<UserLog />} />
<Route path="/post/:postId" element={<PostDetail />} />
<Route path="/myLikedPost/:postId" element={<LikedPostDetail />} />
<Route path="/post/today" element={<TodayPostDetail />} />
</Routes>
</Router>
<BrowserRouter basename={process.env.PUBLIC_URL}>
<Router>
{!todayPost && (
<div>
<LuLoader
style={{ color: '#FFFBF2', width: '30px', height: '30px' }}
/>
</div>
)}
<Routes>
<Route path="/" element={<LoginView />} />
<Route path="/main" element={todayPost && <div><MainPage /></div>} />
<Route path="/newpost" element={<TodayPostView setType={setType} />} />
<Route path="/start" element={<StartView type={type} />} />
<Route path="/post/:postId" element={todayPost && <StickerView />} />
<Route path="/mypage" element={<UserPage />} />
<Route path="/mylog/:emotionType" element={<UserLog />} />
<Route path="/post/:postId" element={<PostDetail />} />
<Route path="/myLikedPost/:postId" element={<LikedPostDetail />} />
<Route path="/post/today" element={<TodayPostDetail />} />
</Routes>
</Router>
</BrowserRouter>
);
}

Expand Down
5 changes: 1 addition & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import ReactDOM from 'react-dom/client';
import { QueryClient, QueryClientProvider } from 'react-query';

Expand All @@ -11,9 +10,7 @@ const queryClient = new QueryClient();
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<BrowserRouter basename="https://keepgoinglikelion.github.io/meringue-FE/">
<App />
</BrowserRouter>
<App />
</QueryClientProvider>
</React.StrictMode>,
);
9 changes: 6 additions & 3 deletions src/pages/UserPage/UserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { LuLoader } from 'react-icons/lu';
import { format } from 'date-fns';
import { Link } from 'react-router-dom';
import axios from 'axios';
import MenuBar from '../../components/Menu/Menu';
import styles from '../../styles/Layout.module.css';
import Calendar from '../../components/Calendar/Container';
Expand All @@ -23,9 +24,11 @@ function Mypage() {
const [userName, setUserName] = useState('');

useEffect(() => {
setTodayDate(new Date());
fetchTodayPost();
fetchUserNickname().then((nickname) => setUserName(nickname ?? ''));
if (axios.defaults.headers.common.Authorization) {
setTodayDate(new Date());
fetchTodayPost();
fetchUserNickname().then((nickname) => setUserName(nickname ?? ''));
}
}, [currentDate, fetchTodayPost]);

if (!todayPost) {
Expand Down

0 comments on commit f147bde

Please sign in to comment.