Skip to content

Commit

Permalink
Merge pull request #98 from Team-INSERT/fix/QA
Browse files Browse the repository at this point in the history
QA, 버그 픽스
  • Loading branch information
Ubinquitous authored Nov 2, 2023
2 parents 6cdc663 + 6812684 commit badba6f
Show file tree
Hide file tree
Showing 48 changed files with 839 additions and 317 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
swcMinify: true,
images: {
domains: [
process.env.NEXT_PUBLIC_DOMAIN,
Expand Down
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Provider from "@/provider/provider.helper";
import React from "react";

export const metadata = {
title: "BSM",
Expand Down
38 changes: 38 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use client";

import { PageNotFound } from "@/assets/images";
import { Button } from "@/components/atoms";
import { ROUTER } from "@/constants";
import { color, flex } from "@/styles";
import Image from "next/image";
import { useRouter } from "next/navigation";
import React from "react";
import styled from "styled-components";

const NotFound = () => {
const router = useRouter();
return (
<Container>
<StyledImage width={999} height={999} src={PageNotFound} alt="404" />
<Button
color={color.primary_blue}
onClick={() => router.push(ROUTER.HOME)}
>
홈으로 돌아가기
</Button>
</Container>
);
};

const Container = styled.div`
width: 100%;
height: 70vh;
${flex.COLUMN_CENTER};
`;

const StyledImage = styled(Image)`
width: 50%;
height: fit-content;
`;

export default NotFound;
2 changes: 2 additions & 0 deletions src/assets/icons/Arrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ const Arrow = ({
height = 25,
color = "#727272",
direction = "bottom",
...props
}: SVGAttribute) => {
return (
<svg
{...props}
width={width}
height={height}
viewBox="0 0 41 41"
Expand Down
11 changes: 3 additions & 8 deletions src/assets/icons/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { SVGAttribute } from "@/interfaces";
import styled from "styled-components";

const Logo = ({ isPointable }: SVGAttribute) => {
const Logo = ({ ...props }: React.SVGProps<SVGSVGElement>) => {
return (
<StyledSVG
cursor={isPointable ? "pointer" : ""}
width={20}
height={20}
{...props}
cursor="pointer"
viewBox="0 0 41 40"
fill="none"
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -209,9 +207,6 @@ const Logo = ({ isPointable }: SVGAttribute) => {
};

const StyledSVG = styled.svg`
width: 40px;
height: 40px;
@media screen and (max-width: 1025px) {
width: 34px;
height: 34px;
Expand Down
1 change: 1 addition & 0 deletions src/assets/images/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export { default as ThinkingFace } from "./thinking_face.png";
export { default as HuggingFace } from "./hugging_face.png";
export { default as TestBanner } from "./test_banner.png";
export { default as TestSmallBanner } from "./test_small_banner.png";
export { default as PageNotFound } from "./page_not_found.png";
Binary file added src/assets/images/page_not_found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 21 additions & 9 deletions src/components/common/Aside/InfomationBox.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import styled from "styled-components";
import Link from "next/link";
import { color, font } from "@/styles";
import { USER, ROUTER } from "@/constants";
import { USER } from "@/constants";
import { IUser } from "@/interfaces";
import { Row, Column } from "@/components/Flex";
import { getUserRole } from "@/helpers";
import flex from "@/styles/flex";
import { ImageWithFallback } from "@/components/atoms";
import { defaultProfile } from "@/assets/images";
import useModal from "@/hooks/useModal";
import { useRouter } from "next/navigation";
import LoginModal from "../Modal/LoginModal";

interface IInfomationBoxProps {
user: IUser;
isLogined: boolean;
}

const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
const ifLoginedStudent = isLogined && user.role === USER.STUDENT;
const router = useRouter();
const isLoginedStudent = isLogined && user.role === USER.STUDENT;
const { openModal } = useModal();

const handleLoginButtonClick = () => {
if (isLogined) router.push("/");
openModal({
component: <LoginModal />,
});
};

return (
<Container>
Expand All @@ -29,7 +40,7 @@ const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
rounded
/>
)}
{ifLoginedStudent && (
{isLoginedStudent && (
<>
<Column>
<UserInfoBox>
Expand All @@ -42,15 +53,15 @@ const InfomationBox = ({ user, isLogined }: IInfomationBoxProps) => {
<UserType>{getUserRole(user.role)}</UserType>
</Row>
</Column>
<InfomationButton href={ROUTER.MYPAGE}>내 정보</InfomationButton>
<InfomationButton onClick={handleLoginButtonClick}>
내 정보
</InfomationButton>
</>
)}
{!isLogined && (
<>
<LoginText>로그인이 필요해요</LoginText>
<InfomationButton
href={process.env.NEXT_PUBLIC_OAUTH_URL || ROUTER.HOME}
>
<InfomationButton onClick={handleLoginButtonClick}>
로그인
</InfomationButton>
</>
Expand Down Expand Up @@ -123,10 +134,11 @@ const UserType = styled.span`
}
`;

const InfomationButton = styled(Link)`
const InfomationButton = styled.button`
${flex.CENTER};
${font.btn3};
padding: 4px 10px;
border: none;
background-color: ${color.primary_blue};
border-radius: 5px;
margin-left: auto;
Expand Down
21 changes: 16 additions & 5 deletions src/components/common/Header/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
import styled from "styled-components";
import { color, flex, font } from "@/styles";
import useWindow from "@/hooks/useWindow";

const navigationTypes = [
{
name: "학교",
isDisplayNoneAtResponsive: false,
},
{
name: "기숙사",
isDisplayNoneAtResponsive: false,
},
{
name: "커뮤니티",
isDisplayNoneAtResponsive: false,
},
{
name: "기타 목록",
isDisplayNoneAtResponsive: true,
},
];

const Navigation = () => {
const { isWindow } = useWindow();
return (
<NavigationList>
{navigationTypes.map((navigation) => (
<NavigationListItem key={navigation.name}>
{navigation.name}
</NavigationListItem>
))}
{isWindow &&
navigationTypes.map((navigation) => {
if (navigation.isDisplayNoneAtResponsive && window.innerWidth <= 768)
return;
return (
<NavigationListItem key={navigation.name}>
{navigation.name}
</NavigationListItem>
);
})}
</NavigationList>
);
};
Expand Down
40 changes: 30 additions & 10 deletions src/components/common/Header/SubNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from "styled-components";
import { color, flex, font } from "@/styles";
import Link from "next/link";
import useWindow from "@/hooks/useWindow";

const navigations = [
{
Expand All @@ -11,13 +12,15 @@ const navigations = [
{ name: "🕐 시간표", href: "/timetable" },
{ name: "🗓️ 캘린더", href: "/calender" },
],
isDisplayNoneAtResponsive: false,
},
{
key: "기숙사 생활",
items: [
{ name: "🚪 입사 체크", href: "https://team-insert.com" },
{ name: "🚪 (미완)", href: "/" },
{ name: "☕️ 베르실 예약", href: "/reserve" },
],
isDisplayNoneAtResponsive: false,
},
{
key: "커뮤니티",
Expand All @@ -26,25 +29,34 @@ const navigations = [
{ name: "🎋 대나무숲", href: "/bamboo" },
{ name: "📊 랭킹(미완)", href: "/rank" },
],
isDisplayNoneAtResponsive: false,
},
{
key: "기타",
items: [{ name: "💼 외부 서비스", href: "/applications" }],
isDisplayNoneAtResponsive: true,
},
];

const SubNavigation = () => {
const { isWindow } = useWindow();

return (
<SubNavigationList>
{navigations.map((navigation) => (
<SubNavigationListItem key={navigation.key}>
{navigation.items.map((item) => (
<SubNavigationListItemLink key={item.href} href={item.href}>
{item.name}
</SubNavigationListItemLink>
))}
</SubNavigationListItem>
))}
{isWindow &&
navigations.map((navigation) => {
if (navigation.isDisplayNoneAtResponsive && window.innerWidth <= 768)
return;
return (
<SubNavigationListItem key={navigation.key}>
{navigation.items.map((item) => (
<SubNavigationListItemLink key={item.href} href={item.href}>
{item.name}
</SubNavigationListItemLink>
))}
</SubNavigationListItem>
);
})}
</SubNavigationList>
);
};
Expand All @@ -68,6 +80,14 @@ const SubNavigationListItemLink = styled(Link)`
font-weight: 500;
width: 90px;
cursor: pointer;
@media screen and (max-width: 570px) {
width: 85px;
}
@media screen and (max-width: 490px) {
width: 80px;
}
`;

export default SubNavigation;
11 changes: 6 additions & 5 deletions src/components/common/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ const Header = () => {
>>(null);

const handleMouseEnter = () => {
if (isHover) return setIsHover(true);
setDelayHandeler(setTimeout(() => setIsHover(true), 400));
if (isHover) return setIsHover((prev) => !prev);
setDelayHandeler(setTimeout(() => setIsHover((prev) => !prev), 300));
};

const handleMouseLeave = () => {
if (!isHover && delayHandler) return clearTimeout(delayHandler);
setIsHover(false);
setIsHover((prev) => !prev);
};

return (
<HeaderLayout
onMouseOver={handleMouseEnter}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
<Layout>
<Container>
<Link href="/">
<Logo width={42} isPointable />
<Logo width={42} />
</Link>
<Navigation />
<Setting onClick={() => openModal({ component: <SettingModal /> })} />
Expand All @@ -46,6 +46,7 @@ const Header = () => {

const HeaderLayout = styled.div`
${flex.COLUMN};
background-color: green;
`;

const Layout = styled.div`
Expand Down
15 changes: 10 additions & 5 deletions src/components/common/Modal/EmojiModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled, { css } from "styled-components";
import { color } from "@/styles";
import { color, flex } from "@/styles";
import ModalList from "./ModalList";
import ModalHeader from "./ModalHeader";

Expand All @@ -17,8 +17,13 @@ const EmojiModal = (direction: IEmojiModalProps) => {
return (
<>
<Container {...direction}>
<ModalHeader handleClickCloseButton={onClose} />
<ModalList />
아직 지원하지 않는 기능이에요.
{false && (
<>
<ModalHeader handleClickCloseButton={onClose} />
<ModalList />
</>
)}
</Container>
<ModalBackground onClick={onClose} />
</>
Expand All @@ -35,9 +40,9 @@ const Container = styled.div<{
z-index: 10;
width: 30vw;
border-radius: 12px;
min-height: 20vh;
height: fit-content;
display: flex;
flex-direction: column;
${flex.COLUMN_CENTER};
background-color: ${color.white};
box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.1);
${({ top, right, bottom, left }) => css`
Expand Down
Loading

0 comments on commit badba6f

Please sign in to comment.