Skip to content

Commit

Permalink
Merge branch 'dev' into feature/study-detail-info
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 authored Aug 28, 2024
2 parents bbd11af + 11c2399 commit 22ebd07
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 885 deletions.
2 changes: 1 addition & 1 deletion apps/admin/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ const errorPageContentStyle = css({
});

const buttonStyle = {
width: 328,
maxWidth: 328,
};
2 changes: 1 addition & 1 deletion apps/admin/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ const notFoundPageContentStyle = css({
});

const buttonStyle = {
width: 328,
maxWidth: 328,
};
4 changes: 2 additions & 2 deletions apps/admin/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const middleware = async (req: NextRequest) => {
if (studyRole === "STUDENT" && manageRole === "NONE") {
const url =
process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
? process.env.CLIENT_PROD_URL
: process.env.CLIENT_DEV_URL;
? process.env.NEXT_PUBLIC_CLIENT_PROD_URL
: process.env.NEXT_PUBLIC_CLIENT_DEV_URL;

return NextResponse.redirect(new URL("/auth", url));
}
Expand Down
7 changes: 6 additions & 1 deletion apps/client/app/(afterLogin)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<>
<Navbar />
<styled.main padding="54px 0 0 101px" width="calc(100vw - 351px)">
<styled.main
left="250px"
padding="54px 0 0 101px"
position="absolute"
width="calc(100vw - 351px)"
>
{children}
</styled.main>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const StudyCurriculum = async () => {
period: { startDate, endDate },
attendanceStatus,
assignmentSubmissionStatus,
sessionStatus,
curriculumStatus,
submissionLink,
},
index
Expand Down Expand Up @@ -65,7 +65,7 @@ const StudyCurriculum = async () => {
{week}주차
</Text>
</div>
{sessionStatus === "CANCELLED" ? (
{curriculumStatus === "CANCELLED" ? (
<Text as="h3" color="sub" typo="h3">
휴강 주차
</Text>
Expand Down
48 changes: 33 additions & 15 deletions apps/client/app/(afterLogin)/study-apply/_components/StudyItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Link from "next/link";
import type { ComponentProps } from "react";
import type { StudyList } from "types/dtos/applyStudy";
import type { StudyType } from "types/entities/common/study";
import type { Time } from "types/entities/common/time";
import Button from "wowds-ui/Button";
import Tag from "wowds-ui/Tag";
interface StudyItemProps {
Expand All @@ -24,40 +25,51 @@ const StudyItem = ({ study, appliedStudyId }: StudyItemProps) => {
mentorName,
studyType,
dayOfWeek,
startTime: { hour: startTimeHour, minute: startTimeMinute },
endTime: { hour: endTimeHour, minute: endTimeMinute },
startTime,
endTime,
openingDate: openingDateString,
applicationEndDate: endDateString,
totalWeek,
} = study;

const openingDate = parseISODate(openingDateString);
const endDate = parseISODate(endDateString);
const studyTime = `${dayToKorean[dayOfWeek.toUpperCase()]} ${startTimeHour}:${padWithZero(startTimeMinute)} - ${
endTimeHour
}:${padWithZero(endTimeMinute)}`;

const formatTime = (startTime: Time, endTime: Time) => {
const { hour: startTimeHour, minute: startTimeMinute } = startTime;
const { hour: endTimeHour, minute: endTimeMinute } = endTime;

return `${dayToKorean[dayOfWeek.toUpperCase()]} ${startTimeHour}:${padWithZero(startTimeMinute)} - ${
endTimeHour
}:${padWithZero(endTimeMinute)}`;
};
const studyTime = startTime && endTime ? formatTime(startTime, endTime) : "-";

const isApplicable = appliedStudyId === null;
const isCancelable = appliedStudyId === studyId;
const isNotApplicable = !isApplicable && !isCancelable;
return (
<Table>
<Flex direction="column" gap="xxs" justifyContent="center">
<Flex direction="column" gap="xxs" justifyContent="center" width={334}>
<Flex className={contentStyle} gap="xs">
<Text typo="h3">{title}</Text>
<Tag color={sessionColors[studyType] ?? "green"} variant="solid1">
{studyType}
</Tag>
</Flex>
<Text color="sub" typo="body2">
{`${introduction} -`}
<Link href={notionLink ?? ""} target="_blank">
{notionLink}
</Link>
</Text>
<Link href={notionLink ?? ""} target="_blank">
<Text className={introductionLinkTextStyle} color="sub" typo="body2">
{`(${introduction})`}
</Text>
</Link>
</Flex>
<Text className={textCellStyle}>{mentorName}</Text>
<Text className={textCellStyle}>{studyTime}</Text>
<Text
className={textCellStyle}
style={{ width: "11rem", textAlign: "center" }}
>
{studyTime}
</Text>
<Text className={textCellStyle}>{totalWeek}주 코스</Text>
<Flex direction="column" textAlign="center">
<Text className={textCellStyle}>
Expand Down Expand Up @@ -102,10 +114,16 @@ const contentStyle = css({
minWidth: "313px",
});

const introductionLinkTextStyle = css({
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
});

const sessionColors: Record<StudyType, ComponentProps<typeof Tag>["color"]> = {
"과제 스터디": "green",
"온라인 세션": "blue",
"오프라인 세션": "yellow",
"온라인 커리큘럼": "blue",
"오프라인 커리큘럼": "yellow",
};

export default StudyItem;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const AuthErrorAfterRecruitmentPage = () => {
모집 기간에 합류 후 이용해주세요.
</p>
<div className={buttonContainerStyle}>
<Button aria-label="홈으로 이동" asProp={Link} href={routePath.landing}>
<Button
aria-label="홈으로 이동"
asProp={Link}
href={routePath.landing}
style={buttonStyle}
>
홈으로 이동
</Button>
</div>
Expand Down Expand Up @@ -79,3 +84,7 @@ const buttonContainerStyle = css({
gap: "12px",
width: "100%",
});

const buttonStyle = {
maxWidth: "328px",
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ const AuthErrorDuringRecruitmentPage = () => {
아래 버튼을 눌러 가입할 수 있어요!
</p>
<div className={buttonContainerStyle}>
<Button aria-label="홈으로 이동" asProp={Link} href={routePath.landing}>
<Button
aria-label="홈으로 이동"
asProp={Link}
href={routePath.landing}
style={buttonStyle}
>
홈으로 이동
</Button>
<Button
aria-label="GDSC Hongik 가입하기"
asProp={Link}
href={routePath.onboarding}
style={buttonStyle}
variant="outline"
>
GDSC Hongik 가입하기
Expand Down Expand Up @@ -87,3 +93,7 @@ const buttonContainerStyle = css({
gap: "12px",
width: "100%",
});

const buttonStyle = {
maxWidth: "328px",
};
7 changes: 6 additions & 1 deletion apps/client/app/(beforeLogin)/auth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const AuthPage = async () => {
asProp={Link}
href={routePath["github-oauth"]}
icon={githubLogoIcon}
style={{ backgroundColor: `${color.github}` }}
style={githubLoginButtonStyle}
>
GitHub 로그인
</Button>
Expand Down Expand Up @@ -108,3 +108,8 @@ const authImageStyle = css({
height: "100%",
width: "100%",
});

const githubLoginButtonStyle = {
backgroundColor: `${color.github}`,
maxWidth: "328px",
};
5 changes: 5 additions & 0 deletions apps/client/app/(beforeLogin)/landing/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const LandingPage = () => {
asProp={Link}
href={routePath.auth}
size="lg"
style={loginButtonStyle}
>
로그인
</Button>
Expand Down Expand Up @@ -85,3 +86,7 @@ const descriptionStyle = css({
marginBottom: "48px",
zIndex: 1,
});

const loginButtonStyle = {
maxWidth: "232px",
};
2 changes: 1 addition & 1 deletion apps/client/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ const errorPageContentStyle = css({
});

const buttonStyle = {
width: 328,
maxWidth: 328,
};
2 changes: 1 addition & 1 deletion apps/client/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ const notFoundPageContentStyle = css({
});

const buttonStyle = {
width: 328,
maxWidth: 328,
};
5 changes: 3 additions & 2 deletions apps/client/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Navbar = async () => {
alt={menu.alt}
href={menu.href}
imageUrl={menu.imageUrl}
items={menu.items}
// items={menu.items}
key={menu.name}
name={menu.name}
/>
Expand All @@ -66,7 +66,8 @@ export default Navbar;
const navbarContainerStyle = css({
width: "250px",
minWidth: "250px",
minHeight: "100vh",
height: "100vh",
position: "fixed",
paddingTop: "54px",
borderRightWidth: "arrow",
borderColor: "mono.400",
Expand Down
2 changes: 1 addition & 1 deletion apps/client/constants/apiPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const enum apiPath {
myOngoingStudy = "/studies/me/ongoing",
studyHistory = "/study-history",
studyDetail = "/study-details/assignments",
studyCurriculum = "/study-details/sessions",
studyCurriculum = "/study-details/curriculums",
dailyTask = "/study-details/todo",
logout = "/auth/logout",
members = "/common/members",
Expand Down
18 changes: 9 additions & 9 deletions apps/client/constants/navMenu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import folderImageUrl from "../public/images/folder.svg";
// import folderImageUrl from "../public/images/folder.svg";
import homeImageUrl from "../public/images/home.svg";
import personImageUrl from "../public/images/person.svg";
import scheduleImageUrl from "../public/images/schedule.svg";
Expand All @@ -9,14 +9,14 @@ export const navMenu = [
imageUrl: homeImageUrl,
alt: "home-icon",
name: "나의 스터디",
items: [
{
href: "/my-assignment",
imageUrl: folderImageUrl,
alt: "folder-icon",
name: "나의 과제",
},
],
// items: [
// {
// href: "my-assignment",
// imageUrl: folderImageUrl,
// alt: "folder-icon",
// name: "나의 과제",
// },
// ],
},
{
href: "/study-apply",
Expand Down
4 changes: 2 additions & 2 deletions apps/client/types/dtos/applyStudy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface StudyList {
introduction: string;
mentorName: string;
dayOfWeek: DayOfWeekType;
startTime: Time;
endTime: Time;
startTime: Time | null;
endTime: Time | null;
totalWeek: number;
openingDate: string;
applicationEndDate: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/client/types/dtos/myStudy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type {
AssignmentSubmissionStatusType,
AttendanceStatusType,
DailyTaskType,
StudyCurriculumStatusType,
StudyDifficultyType,
StudySessionStatusType,
} from "types/entities/myStudy";

export interface BasicStudyInfoDto {
Expand Down Expand Up @@ -56,7 +56,7 @@ interface StudyCurriculumDto {
week: number;
title: string;
description: string;
sessionStatus: StudySessionStatusType;
curriculumStatus: StudyCurriculumStatusType;
difficulty: StudyDifficultyType;
attendanceStatus: AttendanceStatusType;
assignmentStatus: AssignmentStatusType;
Expand Down
2 changes: 1 addition & 1 deletion apps/client/types/entities/common/study.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type StudyType = "과제 스터디" | "온라인 세션" | "오프라인 세션";
export type StudyType = "과제 스터디" | "온라인 커리큘럼" | "오프라인 커리큘럼";
2 changes: 1 addition & 1 deletion apps/client/types/entities/myStudy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type AssignmentSubmissionFailureType =
| "LOCATION_UNIDENTIFIABLE"
| "UNKNOWN";

export type StudySessionStatusType = "NONE" | "OPEN" | "CANCELLED";
export type StudyCurriculumStatusType = "NONE" | "OPEN" | "CANCELLED";

export type AssignmentSubmissionStatusType =
| "NOT_SUBMITTED"
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ const backDropStyle = css({
width: "100vw",
height: "100vh",

position: "absolute",
position: "fixed",
top: 0,
left: 0,
zIndex: 9999,

background: "backgroundDimmer",
});
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/NavItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const NavItem = ({ href, imageUrl, alt, name, items }: NavItemProps) => {
role="menuitem"
tabIndex={0}
className={navItemStyle({
type: !segment[1] && segment[0] === href ? "active" : "inactive",
type:
!segment[1] && `/${segment[0]}` === href ? "active" : "inactive",
})}
onClick={handleClickNavItem}
>
Expand Down
Loading

0 comments on commit 22ebd07

Please sign in to comment.