Skip to content

Commit

Permalink
feature-046: 머지 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0428 committed Feb 9, 2024
1 parent f21b1fb commit 509ba0b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
13 changes: 7 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ const App = () => {
const userToken = useRecoilValue(userTokenState);
const { initializeCategory } = handleCategory();
useEffect(() => {
getCategories()
.then((res) => {
setCategories(initializeCategory(res));
})
.catch((err) => console.log(err));
}, []);
userToken &&
getCategories()
.then((res) => {
setCategories(initializeCategory(res));
})
.catch((err) => console.log(err));
}, [userToken]);

return (
<ThemeProvider theme={theme}>
Expand Down
25 changes: 14 additions & 11 deletions src/components/Home/InsightVideos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ interface InsightVideosProps {
popularHashtags: string[];
}

const InsightVideos: React.FC<InsightVideosProps> = ({ username, popularHashtags }) => {
const formattedHashtags = popularHashtags.map(tag => '#' + tag);
const [categoryItems] = useState<cardDummy[]>([]);
const [checkedItems, setCheckedItems] = useState<boolean[]>([]);
const InsightVideos: React.FC<InsightVideosProps> = ({
username,
popularHashtags,
}) => {
const formattedHashtags = popularHashtags.map((tag) => '#' + tag);
const [categoryItems] = useState<cardDummy[]>([]);
const [checkedItems, setCheckedItems] = useState<boolean[]>([]);

return (
<InsightVideosContainer>
Expand All @@ -23,16 +26,16 @@ const InsightVideos: React.FC<InsightVideosProps> = ({ username, popularHashtags
콘텐츠에요!
</h4>
</div>
<div className='insight-videos'>
<Card
categoryItems={categoryItems}
checkedItems={checkedItems}
setCheckedItems={setCheckedItems}
/>
<div className="insight-videos">
<Card
videos={categoryItems}
checkedVideos={checkedItems}
setCheckedVideos={setCheckedItems}
/>
</div>
</div>
</InsightVideosContainer>
);
};
};

export default InsightVideos;
1 change: 0 additions & 1 deletion src/components/category/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const Card: React.FC<ICardProps> = ({
prev[id] = !prev[id];
setCheckedVideos(prev);
};
console.log(videos);
return (
<CardStyles.Container>
{videos.map((video, idx) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/sideBar/AddCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import * as AddCategoryStyle from '@/styles/layout/sideBar/AddCategory.style';
import PlusSvg from '@/assets/icons/plus.svg?react';
import { useRecoilValue, useSetRecoilState } from 'recoil';
import { topCategoryModalState } from '@/stores/modal';
import { userState } from '@/stores/user';
import { userTokenState } from '@/stores/user';
import { useState } from 'react';
import GuestNoticeModal from '@/components/modals/GuestNoticeModal';

const AddCategory = () => {
const isUser = useRecoilValue(userState);
const isUser = useRecoilValue(userTokenState);
const setTopCategoryModal = useSetRecoilState(topCategoryModalState);
const [isGuestNoticeModalOpen, setIsGuestNoticeModalOpen] = useState(false);

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/sideBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as SideBarStyles from '@/styles/layout/sideBar';
import { useRecoilValue } from 'recoil';
import { userState } from '@/stores/user';
import { userTokenState } from '@/stores/user';
import GuestMode from './GuestMode';
import UserMode from './UserMode';
import AddCategory from './AddCategory';
import ConvertVideo from './ConvertVideo';
import VinoGuide from './VinoGuide';

const SideBar = () => {
const isUser = useRecoilValue(userState);
const isUser = useRecoilValue(userTokenState);

return (
<SideBarStyles.Container>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const CategoryPage = () => {
)}
</CategoryPageStyles.MenuWrap>

{videos.length === 0 && <EmptyCard />}
{(videos.length === 0 || videos === undefined) && <EmptyCard />}
{videos.length > 0 && (
<Card
videos={videos}
Expand Down
5 changes: 0 additions & 5 deletions src/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import { atom } from 'recoil';

import localStorageEffect from './effects/localStorageEffect';

export const userState = atom({
key: 'user',
default: true,
});

export const userTokenState = atom<string | null>({
key: 'user-token',
default: null,
Expand Down

0 comments on commit 509ba0b

Please sign in to comment.