-
-
+
+
+
diff --git a/src/shared/ui/SidebarFilter/ui/SidebarFilter.module.scss b/src/shared/ui/SidebarFilter/ui/SidebarFilter.module.scss
index 86c6b69..0bea942 100644
--- a/src/shared/ui/SidebarFilter/ui/SidebarFilter.module.scss
+++ b/src/shared/ui/SidebarFilter/ui/SidebarFilter.module.scss
@@ -18,6 +18,7 @@
.categoryButton {
display: flex;
+ gap: 0.75rem;
align-items: center;
justify-content: center;
width: 100%;
@@ -26,7 +27,6 @@
font-weight: 700;
color: $primary-color;
text-align: center;
- gap: 0.75rem;
transition: all 0.2s ease;
&:hover {
@@ -47,9 +47,19 @@
display: flex;
flex-direction: column;
gap: 1.25rem;
- margin-top: 1.25rem;
max-height: 20rem;
+ margin-top: 1.25rem;
overflow-y: scroll;
+
+ &::-webkit-scrollbar {
+ width: 5px;
+ height: 10px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #ededed;
+ border-radius: 12px;
+ }
}
.subItem {
@@ -58,11 +68,11 @@
.subItemButton {
width: 100%;
- text-align: center;
padding: 0.5rem;
font-size: 1rem;
font-weight: 600;
color: $primary-color;
+ text-align: center;
transition: all 0.2s ease;
&:hover {
diff --git a/src/widgets/GatheringGrid/GatheringGrid.module.scss b/src/widgets/GatheringGrid/GatheringGrid.module.scss
index c303ded..9e2000e 100644
--- a/src/widgets/GatheringGrid/GatheringGrid.module.scss
+++ b/src/widgets/GatheringGrid/GatheringGrid.module.scss
@@ -1,24 +1,14 @@
.container {
+ display: flex;
+ justify-content: center;
width: 100%;
+ padding: 0 1.25rem;
margin-bottom: 3rem;
}
.list {
display: grid;
- grid-template-columns: repeat(3, 1fr);
+ grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
gap: 1.25rem;
-
- @media screen and (max-width: 1440px) {
- grid-template-columns: repeat(3, 1fr);
- }
-
- @media screen and (max-width: 1200px) {
- grid-template-columns: repeat(2, 1fr);
- gap: 1rem;
- }
-
- @media screen and (max-width: 830px) {
- grid-template-columns: 1fr;
- gap: 1.5rem;
- }
+ width: 100%;
}
diff --git a/src/widgets/Layout/index.tsx b/src/widgets/Layout/index.tsx
index 95f1595..983396b 100644
--- a/src/widgets/Layout/index.tsx
+++ b/src/widgets/Layout/index.tsx
@@ -3,7 +3,19 @@ import { Outlet } from 'react-router-dom';
import { Footer } from './ui/Footer/Footer';
import { Header } from './ui/Header/Header';
+import { useArchiveStore } from '@/features';
+import { usePageLifecycle } from '@/shared/hook';
+
export const Layout = () => {
+ const { resetArchiveData, clearStorage } = useArchiveStore();
+
+ usePageLifecycle({
+ onNavigate: () => {
+ resetArchiveData();
+ clearStorage();
+ },
+ });
+
return (
<>
diff --git a/src/widgets/Layout/ui/Header/Header.module.scss b/src/widgets/Layout/ui/Header/Header.module.scss
index 4990811..452438c 100644
--- a/src/widgets/Layout/ui/Header/Header.module.scss
+++ b/src/widgets/Layout/ui/Header/Header.module.scss
@@ -73,6 +73,7 @@
/* User Menu **/
& .userMenu {
+ position: relative;
display: flex;
flex-shrink: 0;
flex-basis: 1;
@@ -80,3 +81,14 @@
align-items: center;
}
}
+
+.button {
+ cursor: pointer;
+ transition: 0.3s ease;
+}
+
+.heart {
+ &:hover {
+ color: $red;
+ }
+}
diff --git a/src/widgets/Layout/ui/Header/Header.tsx b/src/widgets/Layout/ui/Header/Header.tsx
index f751440..758161f 100644
--- a/src/widgets/Layout/ui/Header/Header.tsx
+++ b/src/widgets/Layout/ui/Header/Header.tsx
@@ -1,12 +1,14 @@
+import { faHeart, faSearch } from '@fortawesome/free-solid-svg-icons';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import cn from 'classnames';
import React from 'react';
-import { Link, useLocation } from 'react-router-dom';
+import { Link, useLocation, useNavigate } from 'react-router-dom';
import styles from './Header.module.scss';
import { NAV_LINKS } from '../../constants';
//assets
import Logo from '@/shared/assets/paletteLogo.svg?react';
-import SearchIcon from '@/shared/assets/search.svg?react';
//model
import { useModalStore } from '@/shared/model/modalStore';
//component
@@ -14,6 +16,7 @@ import { Button } from '@/shared/ui';
export const Header = () => {
const { pathname } = useLocation();
+ const navigate = useNavigate();
const open = useModalStore(state => state.actions.open);
return (
@@ -42,7 +45,14 @@ export const Header = () => {
{/** UserMenu */}
-
+ {
+ navigate('/search');
+ }}
+ />
+
-
);
diff --git a/src/widgets/SearchAll/SearchAll.module.scss b/src/widgets/SearchAll/SearchAll.module.scss
new file mode 100644
index 0000000..dc25fc6
--- /dev/null
+++ b/src/widgets/SearchAll/SearchAll.module.scss
@@ -0,0 +1,40 @@
+.wrapper {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 4rem;
+}
+
+.listWrapper {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 2rem;
+
+ .tab {
+ font-size: 1rem;
+ color: $third-color;
+ }
+}
+
+.list {
+ display: grid;
+ grid-template-rows: auto;
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ gap: 1rem;
+
+ @media (width <= 1000px) {
+ grid-template-columns: 1fr 1fr;
+ }
+
+ @media (width <= 480px) {
+ grid-template-columns: 1fr;
+ }
+}
+
+.listHeader {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+}
diff --git a/src/widgets/SearchAll/SearchAll.tsx b/src/widgets/SearchAll/SearchAll.tsx
new file mode 100644
index 0000000..dd5bc6d
--- /dev/null
+++ b/src/widgets/SearchAll/SearchAll.tsx
@@ -0,0 +1,70 @@
+import { useNavigate } from 'react-router-dom';
+
+import styles from './SearchAll.module.scss';
+
+import type { ArchiveCardDTO } from '@/features';
+import { ArchiveCard } from '@/features';
+import { Button, GatheringCard } from '@/shared/ui';
+import type { GatheringCardProps } from '@/shared/ui/GatheringCard';
+
+export const SearchAll = ({
+ archives,
+ gatherings,
+ setActiveTab,
+}: {
+ archives: ArchiveCardDTO[];
+ gatherings: GatheringCardProps[];
+ setActiveTab: (t: string) => void;
+}) => {
+ const navigate = useNavigate();
+ return (
+
+
+
+
아카이브
+
+
+
+
+
+
+
게더링
+
+
+
+
+
+ );
+};
diff --git a/src/widgets/SearchTap/SearchTap.module.scss b/src/widgets/SearchTap/SearchTap.module.scss
new file mode 100644
index 0000000..4b1e9b4
--- /dev/null
+++ b/src/widgets/SearchTap/SearchTap.module.scss
@@ -0,0 +1,43 @@
+.wrapper {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 2rem;
+ width: 100%;
+}
+
+.tabList {
+ display: flex;
+ gap: 1.5rem;
+ width: 100%;
+ padding: 1.12rem 1.36rem;
+
+ li {
+ position: relative;
+ padding: 0.8rem;
+ font-size: 1rem;
+ font-style: normal;
+ font-weight: 700;
+ line-height: normal;
+ color: $primary-color;
+ text-align: center;
+ cursor: pointer;
+
+ &::after {
+ position: absolute;
+ bottom: -0.25rem;
+ left: 0;
+ display: block;
+ width: 0;
+ height: 0.125rem;
+ content: '';
+ background-color: $primary-color;
+ border-radius: 0.5rem;
+ transition: width 0.3s ease;
+ }
+
+ &.active::after {
+ width: 100%;
+ }
+ }
+}
diff --git a/src/widgets/SearchTap/SearchTap.tsx b/src/widgets/SearchTap/SearchTap.tsx
new file mode 100644
index 0000000..f4bcbcd
--- /dev/null
+++ b/src/widgets/SearchTap/SearchTap.tsx
@@ -0,0 +1,72 @@
+import { ArchiveGrid } from '../ArchiveGrid';
+import { GatheringGrid } from '../GatheringGrid';
+import styles from './SearchTap.module.scss';
+import { SearchAll } from '../SearchAll/SearchAll';
+
+import type { ArchiveCardDTO, Color } from '@/features';
+import type { GatheringCardProps } from '@/shared/ui/GatheringCard';
+
+const dummyArchives: ArchiveCardDTO[] = Array.from({ length: 9 }, (_, i) => ({
+ archiveId: i,
+ title: `Sample Archive`,
+ introduction: `Description for sample archive`,
+ type: ['red', 'blue', 'green', 'yellow', 'purple'][Math.floor(Math.random() * 4)] as Color,
+ username: '홍길동',
+ likeCount: Math.floor(Math.random() * 100),
+ isLiked: Math.random() > 0.5,
+ thumbnail: 'https://picsum.photos/300/200',
+ createDate: new Date(),
+}));
+
+const dummyGatherings: GatheringCardProps[] = Array.from({ length: 9 }, () => ({
+ title: `Sample Gathering`,
+ name: `Sample Name`,
+ introduction: `Description for sample gathering`,
+ tag: ['tag1', 'tag2', 'tag3'],
+ deadline: '2024-11-28',
+}));
+
+const renderingSearchTap = (activeTab: string, setActiveTab: (t: string) => void) => {
+ if (activeTab === '전체') {
+ return (
+
+ );
+ } else if (activeTab === '아카이브') {
+ return
;
+ } else if (activeTab === '소모임') {
+ return
;
+ }
+};
+
+export const SearchTap = ({
+ activeTab,
+ setActiveTab,
+}: {
+ activeTab: string;
+ setActiveTab: (t: string) => void;
+}) => {
+ const tabs = ['전체', '아카이브', '소모임'];
+
+ return (
+
+
+ {tabs.map(tab => (
+ - {
+ setActiveTab(tab);
+ }}
+ >
+ {tab}
+
+ ))}
+
+ {renderingSearchTap(activeTab, setActiveTab)}
+
+ );
+};
diff --git a/src/widgets/index.ts b/src/widgets/index.ts
index 5a559c8..f301db4 100644
--- a/src/widgets/index.ts
+++ b/src/widgets/index.ts
@@ -6,3 +6,5 @@ export * from './WriteArchive';
export * from './WriteGathering/WriteGatheringOpts';
export * from './WriteGathering/WriteGatheringDetail';
export * from './ArchiveGrid';
+export * from './SearchTap/SearchTap';
+export * from './SearchAll/SearchAll';