Skip to content

Commit badba6f

Browse files
authored
Merge pull request #98 from Team-INSERT/fix/QA
QA, 버그 픽스
2 parents 6cdc663 + 6812684 commit badba6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+839
-317
lines changed

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3+
swcMinify: true,
34
images: {
45
domains: [
56
process.env.NEXT_PUBLIC_DOMAIN,

src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Provider from "@/provider/provider.helper";
2+
import React from "react";
23

34
export const metadata = {
45
title: "BSM",

src/app/not-found.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use client";
2+
3+
import { PageNotFound } from "@/assets/images";
4+
import { Button } from "@/components/atoms";
5+
import { ROUTER } from "@/constants";
6+
import { color, flex } from "@/styles";
7+
import Image from "next/image";
8+
import { useRouter } from "next/navigation";
9+
import React from "react";
10+
import styled from "styled-components";
11+
12+
const NotFound = () => {
13+
const router = useRouter();
14+
return (
15+
<Container>
16+
<StyledImage width={999} height={999} src={PageNotFound} alt="404" />
17+
<Button
18+
color={color.primary_blue}
19+
onClick={() => router.push(ROUTER.HOME)}
20+
>
21+
홈으로 돌아가기
22+
</Button>
23+
</Container>
24+
);
25+
};
26+
27+
const Container = styled.div`
28+
width: 100%;
29+
height: 70vh;
30+
${flex.COLUMN_CENTER};
31+
`;
32+
33+
const StyledImage = styled(Image)`
34+
width: 50%;
35+
height: fit-content;
36+
`;
37+
38+
export default NotFound;

src/assets/icons/Arrow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ const Arrow = ({
1414
height = 25,
1515
color = "#727272",
1616
direction = "bottom",
17+
...props
1718
}: SVGAttribute) => {
1819
return (
1920
<svg
21+
{...props}
2022
width={width}
2123
height={height}
2224
viewBox="0 0 41 41"

src/assets/icons/Logo.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import { SVGAttribute } from "@/interfaces";
21
import styled from "styled-components";
32

4-
const Logo = ({ isPointable }: SVGAttribute) => {
3+
const Logo = ({ ...props }: React.SVGProps<SVGSVGElement>) => {
54
return (
65
<StyledSVG
7-
cursor={isPointable ? "pointer" : ""}
8-
width={20}
9-
height={20}
6+
{...props}
7+
cursor="pointer"
108
viewBox="0 0 41 40"
119
fill="none"
1210
xmlns="http://www.w3.org/2000/svg"
@@ -209,9 +207,6 @@ const Logo = ({ isPointable }: SVGAttribute) => {
209207
};
210208

211209
const StyledSVG = styled.svg`
212-
width: 40px;
213-
height: 40px;
214-
215210
@media screen and (max-width: 1025px) {
216211
width: 34px;
217212
height: 34px;

src/assets/images/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export { default as ThinkingFace } from "./thinking_face.png";
88
export { default as HuggingFace } from "./hugging_face.png";
99
export { default as TestBanner } from "./test_banner.png";
1010
export { default as TestSmallBanner } from "./test_small_banner.png";
11+
export { default as PageNotFound } from "./page_not_found.png";

src/assets/images/page_not_found.png

56.8 KB
Loading

src/components/common/Aside/InfomationBox.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
import styled from "styled-components";
2-
import Link from "next/link";
32
import { color, font } from "@/styles";
4-
import { USER, ROUTER } from "@/constants";
3+
import { USER } from "@/constants";
54
import { IUser } from "@/interfaces";
65
import { Row, Column } from "@/components/Flex";
76
import { getUserRole } from "@/helpers";
87
import flex from "@/styles/flex";
98
import { ImageWithFallback } from "@/components/atoms";
109
import { defaultProfile } from "@/assets/images";
10+
import useModal from "@/hooks/useModal";
11+
import { useRouter } from "next/navigation";
12+
import LoginModal from "../Modal/LoginModal";
1113

1214
interface IInfomationBoxProps {
1315
user: IUser;
1416
isLogined: boolean;
1517
}
1618

1719
const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
18-
const ifLoginedStudent = isLogined && user.role === USER.STUDENT;
20+
const router = useRouter();
21+
const isLoginedStudent = isLogined && user.role === USER.STUDENT;
22+
const { openModal } = useModal();
23+
24+
const handleLoginButtonClick = () => {
25+
if (isLogined) router.push("/");
26+
openModal({
27+
component: <LoginModal />,
28+
});
29+
};
1930

2031
return (
2132
<Container>
@@ -29,7 +40,7 @@ const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
2940
rounded
3041
/>
3142
)}
32-
{ifLoginedStudent && (
43+
{isLoginedStudent && (
3344
<>
3445
<Column>
3546
<UserInfoBox>
@@ -42,15 +53,15 @@ const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
4253
<UserType>{getUserRole(user.role)}</UserType>
4354
</Row>
4455
</Column>
45-
<InfomationButton href={ROUTER.MYPAGE}>내 정보</InfomationButton>
56+
<InfomationButton onClick={handleLoginButtonClick}>
57+
내 정보
58+
</InfomationButton>
4659
</>
4760
)}
4861
{!isLogined && (
4962
<>
5063
<LoginText>로그인이 필요해요</LoginText>
51-
<InfomationButton
52-
href={process.env.NEXT_PUBLIC_OAUTH_URL || ROUTER.HOME}
53-
>
64+
<InfomationButton onClick={handleLoginButtonClick}>
5465
로그인
5566
</InfomationButton>
5667
</>
@@ -123,10 +134,11 @@ const UserType = styled.span`
123134
}
124135
`;
125136

126-
const InfomationButton = styled(Link)`
137+
const InfomationButton = styled.button`
127138
${flex.CENTER};
128139
${font.btn3};
129140
padding: 4px 10px;
141+
border: none;
130142
background-color: ${color.primary_blue};
131143
border-radius: 5px;
132144
margin-left: auto;

src/components/common/Header/Navigation.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
import styled from "styled-components";
22
import { color, flex, font } from "@/styles";
3+
import useWindow from "@/hooks/useWindow";
34

45
const navigationTypes = [
56
{
67
name: "학교",
8+
isDisplayNoneAtResponsive: false,
79
},
810
{
911
name: "기숙사",
12+
isDisplayNoneAtResponsive: false,
1013
},
1114
{
1215
name: "커뮤니티",
16+
isDisplayNoneAtResponsive: false,
1317
},
1418
{
1519
name: "기타 목록",
20+
isDisplayNoneAtResponsive: true,
1621
},
1722
];
1823

1924
const Navigation = () => {
25+
const { isWindow } = useWindow();
2026
return (
2127
<NavigationList>
22-
{navigationTypes.map((navigation) => (
23-
<NavigationListItem key={navigation.name}>
24-
{navigation.name}
25-
</NavigationListItem>
26-
))}
28+
{isWindow &&
29+
navigationTypes.map((navigation) => {
30+
if (navigation.isDisplayNoneAtResponsive && window.innerWidth <= 768)
31+
return;
32+
return (
33+
<NavigationListItem key={navigation.name}>
34+
{navigation.name}
35+
</NavigationListItem>
36+
);
37+
})}
2738
</NavigationList>
2839
);
2940
};

src/components/common/Header/SubNavigation.tsx

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import styled from "styled-components";
22
import { color, flex, font } from "@/styles";
33
import Link from "next/link";
4+
import useWindow from "@/hooks/useWindow";
45

56
const navigations = [
67
{
@@ -11,13 +12,15 @@ const navigations = [
1112
{ name: "🕐 시간표", href: "/timetable" },
1213
{ name: "🗓️ 캘린더", href: "/calender" },
1314
],
15+
isDisplayNoneAtResponsive: false,
1416
},
1517
{
1618
key: "기숙사 생활",
1719
items: [
18-
{ name: "🚪 입사 체크", href: "https://team-insert.com" },
20+
{ name: "🚪 (미완)", href: "/" },
1921
{ name: "☕️ 베르실 예약", href: "/reserve" },
2022
],
23+
isDisplayNoneAtResponsive: false,
2124
},
2225
{
2326
key: "커뮤니티",
@@ -26,25 +29,34 @@ const navigations = [
2629
{ name: "🎋 대나무숲", href: "/bamboo" },
2730
{ name: "📊 랭킹(미완)", href: "/rank" },
2831
],
32+
isDisplayNoneAtResponsive: false,
2933
},
3034
{
3135
key: "기타",
3236
items: [{ name: "💼 외부 서비스", href: "/applications" }],
37+
isDisplayNoneAtResponsive: true,
3338
},
3439
];
3540

3641
const SubNavigation = () => {
42+
const { isWindow } = useWindow();
43+
3744
return (
3845
<SubNavigationList>
39-
{navigations.map((navigation) => (
40-
<SubNavigationListItem key={navigation.key}>
41-
{navigation.items.map((item) => (
42-
<SubNavigationListItemLink key={item.href} href={item.href}>
43-
{item.name}
44-
</SubNavigationListItemLink>
45-
))}
46-
</SubNavigationListItem>
47-
))}
46+
{isWindow &&
47+
navigations.map((navigation) => {
48+
if (navigation.isDisplayNoneAtResponsive && window.innerWidth <= 768)
49+
return;
50+
return (
51+
<SubNavigationListItem key={navigation.key}>
52+
{navigation.items.map((item) => (
53+
<SubNavigationListItemLink key={item.href} href={item.href}>
54+
{item.name}
55+
</SubNavigationListItemLink>
56+
))}
57+
</SubNavigationListItem>
58+
);
59+
})}
4860
</SubNavigationList>
4961
);
5062
};
@@ -68,6 +80,14 @@ const SubNavigationListItemLink = styled(Link)`
6880
font-weight: 500;
6981
width: 90px;
7082
cursor: pointer;
83+
84+
@media screen and (max-width: 570px) {
85+
width: 85px;
86+
}
87+
88+
@media screen and (max-width: 490px) {
89+
width: 80px;
90+
}
7191
`;
7292

7393
export default SubNavigation;

0 commit comments

Comments
 (0)