From 0eb7d05bfc54f4a8b050db77060d452a4568b95d Mon Sep 17 00:00:00 2001 From: nelsonkct Date: Thu, 17 Oct 2024 20:23:34 +0800 Subject: [PATCH 1/2] feat : add "hold new events" button --- src/components/icons/BellIcon.tsx | 12 +++++++++ src/components/icons/PlusIcon.tsx | 11 +++++++++ src/components/index.ts | 2 ++ src/routes/events/index.tsx | 41 +++++++++++++++++++++++-------- 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 src/components/icons/BellIcon.tsx create mode 100644 src/components/icons/PlusIcon.tsx diff --git a/src/components/icons/BellIcon.tsx b/src/components/icons/BellIcon.tsx new file mode 100644 index 0000000..f20930d --- /dev/null +++ b/src/components/icons/BellIcon.tsx @@ -0,0 +1,12 @@ + +import React from 'react'; +import IconProps from '../interface/IconProps'; +import { BasicIcon } from './BasicIcon'; + +export const BellIcon: React.FC = ({ fill, stroke, size }) => ( + + + +); + +export default BellIcon; \ No newline at end of file diff --git a/src/components/icons/PlusIcon.tsx b/src/components/icons/PlusIcon.tsx new file mode 100644 index 0000000..e5b8d4f --- /dev/null +++ b/src/components/icons/PlusIcon.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import IconProps from '../interface/IconProps'; +import { BasicIcon } from './BasicIcon'; + +export const PlusIcon: React.FC = ({ fill, stroke, size }) => ( + + + +); + +export default PlusIcon; \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 2ae526f..44eef03 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -5,8 +5,10 @@ export { Image } from './Common/Image'; export { VStack } from './Common/VStack'; export { Header } from './Header'; // Icons +export { BellIcon } from './icons/BellIcon'; export { CalendarIcon } from './icons/CalendarIcon'; export { LogoutIcon } from './icons/LogoutIcon'; +export { PlusIcon } from './icons/PlusIcon'; export { SidebarArrowDownIcon } from './icons/SidebarArrowDownIcon'; export { SidebarArrowRightIcon } from './icons/SidebarArrowRightIcon'; diff --git a/src/routes/events/index.tsx b/src/routes/events/index.tsx index 3f70e4a..957099b 100644 --- a/src/routes/events/index.tsx +++ b/src/routes/events/index.tsx @@ -1,5 +1,5 @@ import { createFileRoute, Link } from '@tanstack/react-router'; -import { Header } from '../../components'; +import { BellIcon, Header, PlusIcon } from '../../components'; import { AuthGuard } from '../../utils/auth'; import { supabase } from '../../utils/supabase'; @@ -9,7 +9,6 @@ const styles = { backgroundColor: '#333333', }, }; - export const Route = createFileRoute('/events/')({ beforeLoad: AuthGuard, loader: async () => { @@ -28,16 +27,38 @@ export const Route = createFileRoute('/events/')({ function EventIndex() { const { events } = Route.useLoaderData() + const navigate = Route.useNavigate(); return ( <> -
-
-

活動列表

- { - events.map((event) => ( - {event.name} - )) - } +
+
+
+

活動列表

+ { + events.map((event) => ( + {event.name} + )) + } +
+ +
+ {/* This button will close the dialog */} + +
+
+
+ + ) From e26f4a74d24d90eb1d72391440d09cc12e13defd Mon Sep 17 00:00:00 2001 From: nelsonkct Date: Thu, 17 Oct 2024 20:36:52 +0800 Subject: [PATCH 2/2] fix : meet code style and type check --- src/routes/events/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/events/index.tsx b/src/routes/events/index.tsx index 957099b..6909804 100644 --- a/src/routes/events/index.tsx +++ b/src/routes/events/index.tsx @@ -40,7 +40,11 @@ function EventIndex() { )) } -