Skip to content

Commit

Permalink
Merge pull request #221 from COW-dev/fix/#220
Browse files Browse the repository at this point in the history
banner 바로가기 버튼 style 변경
  • Loading branch information
yougyung authored Jan 22, 2025
2 parents 915d484 + c04ba8f commit 0989088
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/constants/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type RoleText = {
documents: NavBox;
FAQ?: NavBox;
feed: NavBox;
banner?: NavBox;
};
};

Expand Down Expand Up @@ -63,6 +64,11 @@ export const ROLE_TEXT: RoleText = {
subtitle: '동아리의 활동 사진 및 영상을 업로드하고 홍보해요.',
route: '/feed',
},
banner: {
title: '배너 관리',
subtitle: '띵동의 모바일/웹 버전 배너를 관리해요',
route: '/banner',
},
},
[ROLE_TYPE.ROLE_CLUB]: {
club: {
Expand Down
30 changes: 13 additions & 17 deletions src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useEffect, useState } from 'react';
import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';
import { useCookies } from 'react-cookie';
import Write from '@/assets/write.svg';
import AdminHeading from '@/components/admin/AdminHeading';
import Slider from '@/components/common/Slider';
import { ROLE_TEXT, ROLE_TYPE } from '@/constants/text';
Expand Down Expand Up @@ -70,21 +68,6 @@ export default function Index() {
{infoElement}
</div>
<div className="relative mt-7">
<Link
href="/banner"
className={`absolute right-2 top-6 z-10 inline-block w-12 p-2 opacity-40 transition-opacity hover:opacity-70 ${
role === ROLE_TYPE.ROLE_CLUB && 'invisible'
}`}
>
<Image
src={Write}
width={100}
height={100}
priority
alt="banner"
className="w-5"
/>
</Link>
<Slider />
</div>
<div className="mt-2 grid w-full grid-cols-1 gap-3 sm:grid-cols-3 md:mt-6 md:gap-5">
Expand Down Expand Up @@ -186,6 +169,19 @@ export default function Index() {
</div>
</Link>
)}
{role === ROLE_TYPE.ROLE_ADMIN && (
<Link
href={ROLE_TEXT[role]?.banner?.route ?? ''}
className=" inline-block min-h-[7rem] w-full rounded-xl border-[1.5px] px-6 py-5 transition-colors hover:border-gray-300 hover:bg-gray-50 md:min-h-[8.5rem] md:px-8 md:py-7"
>
<h2 className="text-xl font-bold md:text-2xl">
{ROLE_TEXT[role]?.banner?.title ?? ''}
</h2>
<div className="mt-2 text-sm font-semibold leading-tight text-gray-400 md:mt-3 md:text-base md:leading-tight">
<p>{ROLE_TEXT[role]?.banner?.subtitle ?? ''}</p>
</div>
</Link>
)}
</div>
<div className="mt-4 w-full rounded-xl border-[1.5px] p-6 md:mt-8 md:p-8">
<div className="flex w-full items-center justify-between">
Expand Down

0 comments on commit 0989088

Please sign in to comment.