Skip to content

Commit

Permalink
fix : aside
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubinquitous committed Nov 2, 2023
1 parent e5f41ac commit f51665e
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 39 deletions.
34 changes: 19 additions & 15 deletions src/components/common/Aside/InfomationBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,24 @@ const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
rounded
/>
)}
<Column>
<UserInfoBox>
<UserGrade>{user.grade}</UserGrade>
<UserClass>{user.classNum}</UserClass>
<UserStudentNumber>{user.studentNumber}</UserStudentNumber>
</UserInfoBox>
<Row gap="4px">
<UserName>{user.name}</UserName>
<UserType>{getUserRole(user.role)}</UserType>
</Row>
</Column>
<InfomationButton onClick={handleLoginButtonClick}>
내 정보
</InfomationButton>
{isLogined && (
<>
<Column>
<UserInfoBox>
<UserGrade>{user.grade}</UserGrade>
<UserClass>{user.classNum}</UserClass>
<UserStudentNumber>{user.studentNumber}</UserStudentNumber>
</UserInfoBox>
<Row gap="4px">
<UserName>{user.name}</UserName>
<UserType>{getUserRole(user.role)}</UserType>
</Row>
</Column>
<InfomationButton onClick={handleLoginButtonClick}>
내 정보
</InfomationButton>
</>
)}
{!isLogined && (
<>
<LoginText>로그인이 필요해요</LoginText>
Expand All @@ -71,7 +75,7 @@ const Container = styled.main`
height: 100%;
background-color: ${color.white};
gap: 8px;
padding: 14px 22px;
padding: 4px 22px;
border-radius: 5px;
@media screen and (max-width: 1074px) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Aside/JoinCheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const JoinCheckBox = () => {
<Date>7월 1주차</Date>
<RoomNumber>334</RoomNumber>
</HGroup>
<CheckButton disabled />
<CheckButton />
</Container>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Header/SubNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const navigations = [
{
key: "기숙사 생활",
items: [
{ name: "🚪 (미완)", href: "/" },
{ name: "🚪 입사 체크", href: "/" },
{ name: "☕️ 베르실 예약", href: "/reserve" },
],
isDisplayNoneAtResponsive: false,
Expand Down
18 changes: 9 additions & 9 deletions src/provider/provider.helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import StyledComponentsProvider from "./styledComponentsProvider.helper";

const Provider = ({ children }: React.PropsWithChildren) => {
return (
<ReactQueryProvider>
<ApolloClientProvider>
<RecoilRoot>
<LayoutProvider>
<StyledComponentsProvider>{children}</StyledComponentsProvider>
</LayoutProvider>
</RecoilRoot>
</ApolloClientProvider>
</ReactQueryProvider>
<StyledComponentsProvider>
<ReactQueryProvider>
<ApolloClientProvider>
<RecoilRoot>
<LayoutProvider>{children}</LayoutProvider>
</RecoilRoot>
</ApolloClientProvider>
</ReactQueryProvider>
</StyledComponentsProvider>
);
};

Expand Down
17 changes: 10 additions & 7 deletions src/provider/styledComponentsProvider.helper.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"use client";

import React, { useState } from "react";
import { useServerInsertedHTML } from "next/navigation";
import type { ReactNode } from "react";
import { useState } from "react";
import { ServerStyleSheet, StyleSheetManager } from "styled-components";

export default function StyledComponentsProvider({
children,
}: {
children: React.ReactNode;
}) {
interface Props {
children: ReactNode;
}

const StyledComponentsRegistry = ({ children }: Props) => {
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());

useServerInsertedHTML(() => {
Expand All @@ -26,4 +27,6 @@ export default function StyledComponentsProvider({
{children}
</StyleSheetManager>
);
}
};

export default StyledComponentsRegistry;
1 change: 0 additions & 1 deletion src/templates/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import HomeReserve from "./layouts/HomeReserve";
import HomeMainBanner from "./layouts/HomeMainBanner";
import HomeCalender from "./layouts/HomeCalender";
import HomePost from "./layouts/HomePost";
import HomeRadarChart from "./layouts/HomeRadarChart";
import HomeMiniBanner from "./layouts/HomeMiniBanner";
import HomeBamboo from "./layouts/HomeBamboo";

Expand Down
2 changes: 1 addition & 1 deletion src/templates/home/layouts/HomeBamboo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const HomeBamboo = ({ allowedId, content }: IHomeBambooProps) => {
href="/bamboo"
/>
<StyledContent>
{content.length > 30 ? `${content}...` : content}
{content?.length > 30 ? `${content}...` : content}
</StyledContent>
</Container>
);
Expand Down
4 changes: 2 additions & 2 deletions src/templates/home/layouts/HomeCalender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ interface IHomeCalenderProps {
const HomeCalender = ({ calenders }: IHomeCalenderProps) => {
return (
<Container>
<HomeHead icon={<CalenderIcon />} title="오늘의 일정" href="/Calender" />
<HomeHead icon={<CalenderIcon />} title="오늘의 일정" href="/calender" />
<CalenderBody>
{calenders.map((calender) => (
{calenders?.map((calender) => (
<CalenderContent>
- {calender.title} <span>{getPlanType(calender.type)}</span>
</CalenderContent>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/home/layouts/HomePostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const HomePostList = ({ posts }: IHomePostListProps) => {
const { formatDate } = useDate();
return (
<Container>
{posts.map((post) => (
{posts?.map((post) => (
<PostListItem href={`${ROUTER.POST.LIST}/${post.id}`} key={post.id}>
<StyledTitle>{post.title}</StyledTitle>
<StyledDate>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/meister/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const MeisterPage = () => {
</StatusCardBox>
<Row width="100%" justifyContent="space-between">
{meisterData.isSuccess && (
<YearlyMeisterScore meisterData={meister} />
<YearlyMeisterScore meisterData={meisterData.data} />
)}
<Distribution meisterData={meister} />
</Row>
Expand Down

0 comments on commit f51665e

Please sign in to comment.