Skip to content

Commit

Permalink
perf: notice
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Aug 13, 2024
1 parent 1ed0680 commit 784166c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
19 changes: 18 additions & 1 deletion pageTemplates/notice/NoticeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Flex,
Text,
} from "@chakra-ui/react";
import Link from "next/link";
import { useEffect } from "react";

import { NoticeIcon } from "../../components/atoms/Icons/NoticeIcons";
Expand Down Expand Up @@ -47,7 +48,23 @@ function NoticeItem() {
color="var(--gray-700)"
lineHeight="22px"
>
{item.content}
<p>{item.content}</p>
{item?.link && (
<Link href={item.link}>
<Box
my="12px"
bgColor="var(--gray-200)"
color="var(--gray-700)"
fontSize="13px"
w="max-content"
p="4px 8px"
rounded="lg"
textDecoration="underline"
>
@{item.title}
</Box>
</Link>
)}
</AccordionPanel>
</AccordionItem>
))}
Expand Down
2 changes: 1 addition & 1 deletion pageTemplates/square/SecretSquare/SquareItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Flex, Image, Text } from "@chakra-ui/react";
import dayjs from "dayjs";
import { useSession } from "next-auth/react";
import Link from "next/link";
import { useSession } from "next-auth/react";
import styled from "styled-components";

import { useTypeToast } from "../../../hooks/custom/CustomToast";
Expand Down
10 changes: 10 additions & 0 deletions storage/notice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface INoticeArr {
category: NoticeCategory;
content: string;
date: string;
link?: string;
}

export type NoticeCategory = "main" | "sub" | "event" | "update";
Expand Down Expand Up @@ -866,4 +867,13 @@ export const NOTICE_ARR: INoticeArr[] = [
"라운지에 이어 익명 커뮤니티가 출시되었습니다! 익명이 보장되니까 할 얘기가 있다면 부담없이 소통하세요!",
date: "2023-08-13",
},
{
id: "110",
title: "8월 3주차 주간 공지",
category: "main",
content:
"이벤트 당첨자 발표, 커뮤니티 출시, 번개/소모임 개설 가이드. 상세 내용은 하단 링크 참조.",
date: "2023-08-13",
link: "https://mewing-sombrero-e36.notion.site/8-0eec96824f8e4ff09d6a66a27de9572f?pvs=25",
},
];

0 comments on commit 784166c

Please sign in to comment.