Skip to content

Commit

Permalink
fix: 버그 일괄 수정 (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
semnil5202 authored Aug 16, 2023
1 parent f892740 commit 830087e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
24 changes: 9 additions & 15 deletions frontend/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Layout = ({ children }: LayoutProps) => {
const mapContainer = useRef(null);
const { width } = useContext(LayoutWidthContext);
const isLogined = localStorage.getItem('userToken');
const user = JSON.parse(localStorage.getItem('user') || '');

const loginButtonClick = () => {
window.location.href = 'https://mapbefine.kro.kr/api/oauth/kakao';
Expand Down Expand Up @@ -60,25 +59,20 @@ const Layout = ({ children }: LayoutProps) => {
<SeeTogetherProvider>
<TagProvider>
<Flex height="100vh" width="100vw" overflow="hidden">
<LayoutFlex
<LayoutFlex
$flexDirection="column"
$minWidth={width}
height="100vh"
$backgroundColor="white"
>
<Flex
$justifyContent="space-between"
padding="20px 20px 0 20px"
>
<Logo />
{isLogined ? (
<MyInfoImg src={user.imageUrl} />
) : (
<InfoDefalutImg onClick={loginButtonClick} />
)}
</Flex>
<Flex
height="calc(100vh - 40px)"
<Flex
$justifyContent="space-between"
padding="20px 20px 0 20px"
>
<Logo />
</Flex>
<Flex
height="calc(100vh - 40px)"
$flexDirection="column"
overflow="auto"
padding="0 20px 20px 20px"
Expand Down
21 changes: 13 additions & 8 deletions frontend/src/components/MyInfoContainer/MyInfoList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Fragment, useEffect, useState } from 'react';
import { styled } from 'styled-components';
import { getApi } from '../../../apis/getApi';
import { MyInfoPinType, MyInfoTopicType } from '../../../types/MyInfo';
import PinCard from '../../PinCard';
import TopicCard from '../../TopicCard';
import { TopicType } from '../../../types/Topic';

const MyInfoList = () => {
const [myInfoTopics, setMyInfoTopics] = useState<MyInfoTopicType[]>([]);
const [myInfoTopics, setMyInfoTopics] = useState<TopicType[]>([]);

const getMyInfoListFromServer = async () => {
const serverMyInfoTopics = await getApi<MyInfoTopicType[]>(
const serverMyInfoTopics = await getApi<TopicType[]>(
'default',
'/members/my/topics',
);
Expand All @@ -28,11 +28,16 @@ const MyInfoList = () => {
return (
<Fragment key={topic.id}>
<TopicCard
topicId={topic.id}
topicImage={topic.image}
topicTitle={topic.name}
topicUpdatedAt={topic.updatedAt}
topicPinCount={topic.pinCount}
id={topic.id}
image={topic.image}
name={topic.name}
creator={topic.creator}
updatedAt={topic.updatedAt}
pinCount={topic.pinCount}
bookmarkCount={topic.bookmarkCount}
isInAtlas={topic.isInAtlas}
isBookmarked={topic.isBookmarked}
setTopicsFromServer={getMyInfoListFromServer}
/>
</Fragment>
);
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import MyInfo from '../components/MyInfo';
import MyInfoContainer from '../components/MyInfoContainer';
import useNavigator from '../hooks/useNavigator';
import useSetNavbarHighlight from '../hooks/useSetNavbarHighlight';
import useSetLayoutWidth from '../hooks/useSetLayoutWidth';
import { FULLSCREEN } from '../constants';

const Profile = () => {
const { routePage } = useNavigator();
const { width: _ } = useSetLayoutWidth(FULLSCREEN);
const { navbarHighlights: __ } = useSetNavbarHighlight('profile');

const goToPopularTopics = () => {
Expand Down

0 comments on commit 830087e

Please sign in to comment.