From 39a503ff5e22cdab489572c8eb67876d56c7aff9 Mon Sep 17 00:00:00 2001
From: daejlee
Date: Fri, 13 Dec 2024 16:55:51 +0900
Subject: [PATCH 01/14] Feat: X button componented
---
src/components/buttons/XBtn.tsx | 5 ++++
src/components/modals/GroupSettingModal.tsx | 5 ++--
src/components/modals/MySettingModal.tsx | 31 +++++----------------
src/components/modals/NewGroupModal.tsx | 11 +++-----
src/components/modals/SearchModal.tsx | 5 ++--
5 files changed, 20 insertions(+), 37 deletions(-)
create mode 100644 src/components/buttons/XBtn.tsx
diff --git a/src/components/buttons/XBtn.tsx b/src/components/buttons/XBtn.tsx
new file mode 100644
index 0000000..416077d
--- /dev/null
+++ b/src/components/buttons/XBtn.tsx
@@ -0,0 +1,5 @@
+import { X } from 'lucide-react';
+
+export default function XBtn({ onClick }: { onClick: () => void }) {
+ return ;
+}
diff --git a/src/components/modals/GroupSettingModal.tsx b/src/components/modals/GroupSettingModal.tsx
index 96945f9..1d89d1e 100644
--- a/src/components/modals/GroupSettingModal.tsx
+++ b/src/components/modals/GroupSettingModal.tsx
@@ -1,5 +1,4 @@
import { useState, useRef, FormEvent } from 'react';
-import { X } from 'lucide-react';
import { DialogTrigger } from '@radix-ui/react-dialog';
import { Dialog, DialogContent, DialogTitle, DialogClose } from '@/components/ui/dialog';
import groupApi from '@/api/groupApi';
@@ -9,6 +8,7 @@ import { Button } from '@/components/ui/button';
import Group from '@/types/Group';
import { useToast } from '@/components/ui/use-toast';
import GroupSettingBtn from '@/components/buttons/GroupSettingBtn';
+import XBtn from '@/components/buttons/XBtn';
export default function GroupSettingModal({ curGroup }: { curGroup: Group }) {
const [isDelete, setIsDelete] = useState(false);
@@ -153,8 +153,7 @@ export default function GroupSettingModal({ curGroup }: { curGroup: Group }) {
/>
{groupName && (
- {
formRef.current?.reset();
setGroupName('');
diff --git a/src/components/modals/MySettingModal.tsx b/src/components/modals/MySettingModal.tsx
index d42290a..56dcace 100644
--- a/src/components/modals/MySettingModal.tsx
+++ b/src/components/modals/MySettingModal.tsx
@@ -1,22 +1,13 @@
import { useState, useRef, FormEvent } from 'react';
-import { X } from 'lucide-react';
import { DialogTrigger } from '@radix-ui/react-dialog';
import { DropdownMenuTrigger } from '@radix-ui/react-dropdown-menu';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
-} from '@/components/ui/dialog';
+import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import memberApi from '@/api/memberApi';
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
-} from '@/components/ui/dropdown-menu';
+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu';
import { useUserStore } from '@/lib/stores';
import CustomLocationContent from '@/components/utils/CustomLocationContent';
import SettingBtn from '@/components/buttons/MySettingBtn';
+import XBtn from '@/components/buttons/XBtn';
export default function MySettingModal() {
const [isMessage, setIsMessage] = useState(false);
@@ -80,14 +71,10 @@ export default function MySettingModal() {
setIsMessage(true)}>
-
- 상태 메시지 수정
-
+ 상태 메시지 수정
setIsMessage(false)}>
-
- 수동 위치 설정
-
+ 수동 위치 설정
@@ -115,8 +102,7 @@ export default function MySettingModal() {
{searchValue.length}/15
{searchValue && (
- {
formRef.current?.reset();
setSearchValue('');
@@ -128,10 +114,7 @@ export default function MySettingModal() {
) : (
-
+
)}
);
diff --git a/src/components/modals/NewGroupModal.tsx b/src/components/modals/NewGroupModal.tsx
index 85c3cbd..dffd119 100644
--- a/src/components/modals/NewGroupModal.tsx
+++ b/src/components/modals/NewGroupModal.tsx
@@ -1,5 +1,4 @@
import { useState, useRef, useEffect, FormEvent } from 'react';
-import { X } from 'lucide-react';
import Image from 'next/image';
import { Button } from '@/components/ui/button';
import {
@@ -25,6 +24,7 @@ import Group from '@/types/Group';
import { useToast } from '@/components/ui/use-toast';
import { SearchedUser, User } from '@/types/User';
import SearchedCard from '@/components/cards/SearchedCard';
+import XBtn from '@/components/buttons/XBtn';
export default function NewGroupModal() {
const { groups, setGroups } = useGroupsStore();
@@ -212,8 +212,7 @@ export default function NewGroupModal() {
className="flex flex-row items-center gap-2 rounded-xl border border-gray-400 p-2 shadow-lg"
>
{selectedUser.intraName}
- {
setSelectedUsers(
selectedUsers.filter((selected) => selected !== selectedUser),
@@ -233,8 +232,7 @@ export default function NewGroupModal() {
onChange={(e) => setSearchValue(e.target.value)}
/>
{searchValue && (
- {
formRef.current?.reset();
setSearchValue('');
@@ -277,8 +275,7 @@ export default function NewGroupModal() {
/>
{searchValue && (
- {
formRef.current?.reset();
setSearchValue('');
diff --git a/src/components/modals/SearchModal.tsx b/src/components/modals/SearchModal.tsx
index e760842..5d87332 100644
--- a/src/components/modals/SearchModal.tsx
+++ b/src/components/modals/SearchModal.tsx
@@ -1,6 +1,5 @@
import { useState, useRef, FormEvent } from 'react';
import Image from 'next/image';
-import { X } from 'lucide-react';
import { z } from 'zod';
import SearchedCard from '@/components/cards/SearchedCard';
import SearchBtn from '@/components/buttons/SearchBtn';
@@ -14,6 +13,7 @@ import {
import memberApi from '@/api/memberApi';
import { useUserStore } from '@/lib/stores';
import { SearchedUser } from '@/types/User';
+import XBtn from '@/components/buttons/XBtn';
const SearchInputSchema = z.string().regex(/^[a-zA-Z0-9-]*$/, {
message: '영어, 숫자, -만 입력 가능합니다.',
@@ -111,8 +111,7 @@ export default function SearchModal() {
/>
{searchValue && (
- {
formRef.current?.reset();
setSearchValue('');
From c13c5d102ab7b4f5b739a91299bedf14061734f7 Mon Sep 17 00:00:00 2001
From: daejlee
Date: Fri, 13 Dec 2024 17:09:20 +0900
Subject: [PATCH 02/14] Style: New group ui enhaced, add pink color const
---
src/components/ProfilePic.tsx | 25 +++++-----------------
src/components/admin/AnnouncementMenu.tsx | 2 +-
src/components/announcement/SurveyLink.tsx | 2 +-
src/components/cards/ProfileCard.tsx | 2 +-
src/components/cards/SearchedCard.tsx | 14 ++++++------
src/components/modals/NewGroupModal.tsx | 3 +++
src/styles/globals.css | 1 +
tailwind.config.ts | 1 +
8 files changed, 19 insertions(+), 31 deletions(-)
diff --git a/src/components/ProfilePic.tsx b/src/components/ProfilePic.tsx
index 757be58..3ac639f 100644
--- a/src/components/ProfilePic.tsx
+++ b/src/components/ProfilePic.tsx
@@ -1,20 +1,9 @@
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { User } from '@/types/User';
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from '@/components/ui/tooltip';
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import { CardType } from '@/types/enums';
-export default function ProfilePic({
- user,
- type,
-}: {
- user: User;
- type: CardType;
-}) {
+export default function ProfilePic({ user, type }: { user: User; type: CardType }) {
return (
@@ -24,13 +13,11 @@ export default function ProfilePic({
${type === 'myCard' && 'size-24 cursor-pointer lg:size-28'}
${type === 'userCard' && 'size-20 cursor-pointer md:size-28'}
${
- user.location || user.inCluster ? 'border-[#FFB5B5]' : ''
+ (user.location || user.inCluster) && 'border-basepink'
} border-4 hover:border-[#bfb5ff]`}
onClick={() => {
if (type !== 'searchedCard') {
- window.open(
- `https://profile.intra.42.fr/users/${user.intraId}`,
- );
+ window.open(`https://profile.intra.42.fr/users/${user.intraId}`);
}
}}
>
@@ -38,9 +25,7 @@ export default function ProfilePic({
- {type !== 'searchedCard' && (
- 인트라 프로필 방문
- )}
+ {type !== 'searchedCard' && 인트라 프로필 방문}
);
diff --git a/src/components/admin/AnnouncementMenu.tsx b/src/components/admin/AnnouncementMenu.tsx
index 06a4d3a..9cae5c9 100644
--- a/src/components/admin/AnnouncementMenu.tsx
+++ b/src/components/admin/AnnouncementMenu.tsx
@@ -17,7 +17,7 @@ export default function AnnouncementMenu({
return (
-
+
종류: {type}
diff --git a/src/components/announcement/SurveyLink.tsx b/src/components/announcement/SurveyLink.tsx
index fd70fb4..6977035 100644
--- a/src/components/announcement/SurveyLink.tsx
+++ b/src/components/announcement/SurveyLink.tsx
@@ -30,7 +30,7 @@ export default function SurveyLink({
🏃 설문조사 참여하기 🏃
diff --git a/src/components/cards/ProfileCard.tsx b/src/components/cards/ProfileCard.tsx
index e004726..8843670 100644
--- a/src/components/cards/ProfileCard.tsx
+++ b/src/components/cards/ProfileCard.tsx
@@ -30,7 +30,7 @@ export default function ProfileCard({
return (