Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] fix: 버그 일괄 수정 #320

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading