Skip to content

Commit

Permalink
chore: simplify codes
Browse files Browse the repository at this point in the history
  • Loading branch information
yumincho committed May 27, 2024
1 parent 3816642 commit 54b4f9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import ReactGA from 'react-ga4';
import { useDispatch } from 'react-redux';
import { useLocation, Outlet } from 'react-router-dom';

Check warning on line 5 in src/App.tsx

View check run for this annotation

Codecov / codecov/patch

src/App.tsx#L1-L5

Added lines #L1 - L5 were not covered by tests
Expand All @@ -14,9 +14,7 @@ import { setIsPortrait, setSemesters, setTracks, setUser } from '@/redux/actions
const App: React.FC = () => {
const dispatch = useDispatch();
const location = useLocation();
const [popupOpen, setPopupOpen] = React.useState(
localStorage.getItem(STORAGE_KEY) !== CAMPAIGN_KEY,
);
const [popupOpen, setPopupOpen] = useState(localStorage.getItem(STORAGE_KEY) !== CAMPAIGN_KEY);
const portraitMediaQuery = window.matchMedia('(max-aspect-ratio: 4/3)');

Check warning on line 18 in src/App.tsx

View check run for this annotation

Codecov / codecov/patch

src/App.tsx#L14-L18

Added lines #L14 - L18 were not covered by tests

useEffect(() => {
Expand Down Expand Up @@ -107,7 +105,7 @@ const App: React.FC = () => {
<Header />
<Outlet />
<section>
<BannerPopup popupOpen={popupOpen} setPopupOpen={(state) => setPopupOpen(state)}>
<BannerPopup popupOpen={popupOpen} setPopupOpen={setPopupOpen}>
<CampaignPopupImage closePopup={() => setPopupOpen(false)} />

Check warning on line 109 in src/App.tsx

View check run for this annotation

Codecov / codecov/patch

src/App.tsx#L109

Added line #L109 was not covered by tests
<PopupMenu
onClose={() => {
Expand Down
10 changes: 5 additions & 5 deletions src/redux/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { combineReducers } from 'redux';

Check warning on line 1 in src/redux/index.ts

View check run for this annotation

Codecov / codecov/patch

src/redux/index.ts#L1

Added line #L1 was not covered by tests

import dictionaryReducer from '@/redux/reducers/dictionary/index';
import timetableReducer from '@/redux/reducers/timetable/index';
import writeReviewsReducer from '@/redux/reducers/write-reviews/index';
import commonReducer from '@/redux/reducers/common/index';
import plannerReducer from '@/redux/reducers/planner/index';
import dictionaryReducer from '@/redux/reducers/dictionary';
import timetableReducer from '@/redux/reducers/timetable';
import writeReviewsReducer from '@/redux/reducers/write-reviews';
import commonReducer from '@/redux/reducers/common';
import plannerReducer from '@/redux/reducers/planner';

Check warning on line 7 in src/redux/index.ts

View check run for this annotation

Codecov / codecov/patch

src/redux/index.ts#L3-L7

Added lines #L3 - L7 were not covered by tests

const rootReducer = combineReducers({

Check warning on line 9 in src/redux/index.ts

View check run for this annotation

Codecov / codecov/patch

src/redux/index.ts#L9

Added line #L9 was not covered by tests
common: commonReducer,
Expand Down

0 comments on commit 54b4f9c

Please sign in to comment.