Skip to content

Commit

Permalink
feat: LInk 로 교체
Browse files Browse the repository at this point in the history
  • Loading branch information
SeieunYoo committed Aug 20, 2024
1 parent 3b16c5b commit 3c02230
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { Space, Text } from "@wow-class/ui";
import { padWithZero, parseISODate } from "@wow-class/utils";
import { tags } from "constants/tags";
import { revalidateTag } from "next/cache";
import Link from "next/link";
import type { SubmittableAssignment } from "types/dtos/study-detail-dashboard";
import { Link, Reload } from "wowds-icons";
import { Link as LinkIcon, Reload as ReloadIcon } from "wowds-icons";
import Box from "wowds-ui/Box";
import Button from "wowds-ui/Button";
import TextButton from "wowds-ui/TextButton";
Expand Down Expand Up @@ -50,33 +51,40 @@ export const HomeworkBoxWithLinkEdit = ({
<Text as="h2" typo="h2">
{title}
</Text>
<TextButton
as="a"
href={descriptionLink}
style={{ paddingLeft: "0px", width: "fit-content" }}
text="과제 명세 확인"
/>
<Link href={descriptionLink} target="_blank">
<TextButton
style={{ paddingLeft: "0px" }}
text="과제 명세 확인"
/>
</Link>
<Space height="xs" />
<Text color="sub">{deadlineText}</Text>

<Space height={26} />
<Link href={submissionLink} target="_blank">
<Button
disabled={isButtonDisabled}
style={{ maxWidth: "100%" }}
variant="outline"
icon={
<LinkIcon
stroke={isButtonDisabled ? "mono100" : "primary"}
/>
}
>
제출하러 가기
</Button>
</Link>
<Space height={8} />
<Button
as="a"
disabled={isButtonDisabled}
href={submissionLink}
style={{ maxWidth: "100%" }}
variant="outline"
icon={
<Link stroke={isButtonDisabled ? "mono100" : "primary"} />
<ReloadIcon
stroke={
isButtonDisabled ? "mono100" : "backgroundNormal"
}
/>
}
>
제출하러 가기
</Button>
<Space height={8} />
<Button
disabled={isButtonDisabled}
icon={<Reload />}
style={{ maxWidth: "100%" }}
onClick={handleClickSubmissionComplete}
>
제출 완료
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Flex, styled } from "@styled-system/jsx";
import { Space, Table, Text } from "@wow-class/ui";
import { padWithZero, parseISODate } from "@wow-class/utils";
import Link from "next/link";
import type { ComponentProps } from "react";
import type { AssignmentHistoryDto } from "types/dtos/study-history";
import type { AssignmentSubmissionStatusType } from "types/entities/assignment";
import type { HomeworkSubmissionStatusType } from "types/entities/homework";
import Button from "wowds-ui/Button";
import Tag from "wowds-ui/Tag";
import TextButton from "wowds-ui/TextButton";
Expand Down Expand Up @@ -48,7 +49,9 @@ export const HomeworkHistoryItem = ({ history }: HomeworkHistoryItemProps) => {
textStyle="body1"
>
{descriptionLink ? (
<TextButton as="a" href={descriptionLink} text="과제 명세 확인" />
<Link href={descriptionLink} target="_blank">
<TextButton text="과제 명세 확인" />
</Link>
) : (
"-"
)}
Expand All @@ -68,9 +71,11 @@ export const HomeworkHistoryItem = ({ history }: HomeworkHistoryItemProps) => {
textStyle="body1"
>
{submissionLink ? (
<Button as="a" href={submissionLink} size="sm" variant="outline">
제출한 과제 확인
</Button>
<Link href={submissionLink} target="_blank">
<Button size="sm" variant="outline">
제출한 과제 확인
</Button>
</Link>
) : (
"-"
)}
Expand All @@ -81,7 +86,7 @@ export const HomeworkHistoryItem = ({ history }: HomeworkHistoryItemProps) => {
};

const homeworkSubmissionMap: Record<
AssignmentSubmissionStatusType,
HomeworkSubmissionStatusType,
{ message: string; color: ComponentProps<typeof Tag>["color"] }
> = {
FAILURE: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Flex, styled } from "@styled-system/jsx";
import { Space, Text } from "@wow-class/ui";
import { tags } from "constants/tags";
import { revalidateTag } from "next/cache";
import Link from "next/dist/client/link";
import Image from "next/image";
import type { SubmittableAssignment } from "types/dtos/study-detail-dashboard";
import { Link, Reload } from "wowds-icons";
import { Link as LinkIcon, Reload as ReloadIcon } from "wowds-icons";
import Box from "wowds-ui/Box";
import Button from "wowds-ui/Button";
import Tag from "wowds-ui/Tag";
Expand Down Expand Up @@ -40,12 +41,12 @@ export const HomeworkOverviewBox = ({
{assignment.assignmentSubmissionStatus}
</Tag>
</Flex>
<TextButton
as="a"
href={assignment.descriptionLink}
style={{ paddingLeft: "0px", width: "fit-content" }}
text="과제 명세 확인"
/>
<Link href={assignment.descriptionLink} target="_blank">
<TextButton
style={{ paddingLeft: "0px" }}
text="과제 명세 확인"
/>
</Link>
<Space height="xs" />
<Text color="sub">종료 일시 : {assignment.deadline}</Text>
<Flex gap="xs">
Expand All @@ -63,18 +64,18 @@ export const HomeworkOverviewBox = ({
</styled.div>
</Flex>
<Space height={26} />
<Button
as="a"
href={assignment.submissionLink}
icon={<Link stroke="primary" />}
style={{ maxWidth: "100%" }}
variant="outline"
>
제출하러 가기
</Button>
<Link href={assignment.submissionLink} target="_blank">
<Button
icon={<LinkIcon stroke="primary" />}
style={{ maxWidth: "100%" }}
variant="outline"
>
제출하러 가기
</Button>
</Link>
<Space height={8} />
<Button
icon={<Reload />}
icon={<ReloadIcon />}
style={{ maxWidth: "100%" }}
onClick={handleClickSubmissionComplete}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Table, Text } from "@wow-class/ui";
import { parseISODate, splitTime } from "@wow-class/utils";
import { studyApplyApi } from "apis/studyApplyApi";
import { dayToKorean } from "constants/dayToKorean";
import Link from "next/link";
import type { ComponentProps } from "react";
import type { StudyListApiResponseDto } from "types/dtos/apply-study";
import Button from "wowds-ui/Button";
Expand Down Expand Up @@ -66,9 +67,9 @@ const StudyItem = ({ study }: StudyItemProps) => {
</Flex>
<Text color="sub" typo="body2">
{`${introduction} -`}
<a href={notionLink} target="_blank">
<Link href={notionLink} target="_blank">
{notionLink}
</a>
</Link>
</Text>
</Flex>
<Text className={textCellStyle}>{mentorName}</Text>
Expand Down
4 changes: 2 additions & 2 deletions apps/client/types/dtos/study-detail-dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AssignmentSubmissionStatusType } from "types/entities/assignment";
import type { HomeworkSubmissionStatusType } from "types/entities/homework";

export interface StudyDetailDashboardDto {
repositoryLink: string;
Expand All @@ -11,7 +11,7 @@ export interface SubmittableAssignment {
assignmentStatus: "NONE" | "OPEN" | "CANCELLED";
week: number;
title: string;
assignmentSubmissionStatus: AssignmentSubmissionStatusType;
assignmentSubmissionStatus: HomeworkSubmissionStatusType;
descriptionLink: string;
deadline: string;
submissionLink: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/client/types/dtos/study-history.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AssignmentSubmissionStatusType } from "types/entities/assignment";
import type { HomeworkSubmissionStatusType } from "types/entities/homework";

export interface AssignmentHistoryDto {
assignmentHistoryId: number;
title: string;
deadline: string;
descriptionLink?: string;
submissionLink?: string;
assignmentSubmissionStatus: AssignmentSubmissionStatusType; //TODO: 과제 휴강 여부 추가
assignmentSubmissionStatus: HomeworkSubmissionStatusType; //TODO: 과제 휴강 여부 추가
week: number;
}
1 change: 0 additions & 1 deletion apps/client/types/entities/assignment.ts

This file was deleted.

1 change: 1 addition & 0 deletions apps/client/types/entities/homework.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type HomeworkSubmissionStatusType = "FAILURE" | "SUCCESS"; //TODO: 과제 휴강 여부 추가

0 comments on commit 3c02230

Please sign in to comment.