From b13047e6e9a5e0f9a2a5b9ecbfbb637e95663591 Mon Sep 17 00:00:00 2001 From: Faiq Naufal <43695578+faiq-naufal@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:13:32 +0700 Subject: [PATCH] fix: update homepage design (#232) --- app/_features/home/join-room-field.tsx | 22 +++-- app/_features/home/not-signed-in.tsx | 3 +- app/_features/home/signed-in.tsx | 2 +- app/_features/meeting/meeting-list.tsx | 90 +++++++++---------- .../icons/tabler-circle-arrow-down-icon.tsx | 22 +++++ 5 files changed, 85 insertions(+), 54 deletions(-) create mode 100644 app/_shared/components/icons/tabler-circle-arrow-down-icon.tsx diff --git a/app/_features/home/join-room-field.tsx b/app/_features/home/join-room-field.tsx index ee95aaa4..820b4335 100644 --- a/app/_features/home/join-room-field.tsx +++ b/app/_features/home/join-room-field.tsx @@ -1,7 +1,7 @@ 'use client'; import { Button } from '@nextui-org/react'; -import { useForm, type SubmitHandler } from 'react-hook-form'; +import { useForm, type SubmitHandler, useWatch } from 'react-hook-form'; import { useNavigate } from '@/_shared/hooks/use-navigate'; import TablerArrowRightIcon from '@/_shared/components/icons/tabler-arrow-right-icon'; @@ -9,13 +9,16 @@ type JoinRoomInput = { roomID: string }; export default function JoinRoomField() { const { navigateTo } = useNavigate(); - const { register, handleSubmit } = useForm(); + const { register, handleSubmit, control } = useForm(); const handleJoinRoom: SubmitHandler = async (data) => { const { roomID } = data; navigateTo(`/rooms/${roomID}`); }; + const roomID = useWatch({ control, name: 'roomID' }); + const roomIDLength = roomID ? roomID.trim().length : 0; + return (
diff --git a/app/_features/home/not-signed-in.tsx b/app/_features/home/not-signed-in.tsx index 10fa1899..05e1b940 100644 --- a/app/_features/home/not-signed-in.tsx +++ b/app/_features/home/not-signed-in.tsx @@ -5,6 +5,7 @@ import Image from 'next/image'; import { Button } from '@nextui-org/react'; import JoinRoomField from '@/_features/home/join-room-field'; import TablerArrowRightIcon from '@/_shared/components/icons/tabler-arrow-right-icon'; +import TablerCircleArrowDownIcon from '@/_shared/components/icons/tabler-circle-arrow-down-icon'; import TablerExternalIcon from '@/_shared/components/icons/tabler-external-icon'; export default function NotSignedIn() { @@ -44,7 +45,7 @@ export default function NotSignedIn() { > Learn more - + diff --git a/app/_features/home/signed-in.tsx b/app/_features/home/signed-in.tsx index fcdddad2..99dc8cd8 100644 --- a/app/_features/home/signed-in.tsx +++ b/app/_features/home/signed-in.tsx @@ -83,7 +83,7 @@ export default function SignedIn({ return ( <>
-
+

Hi, {firstName}. diff --git a/app/_features/meeting/meeting-list.tsx b/app/_features/meeting/meeting-list.tsx index cfed2983..eee25b72 100644 --- a/app/_features/meeting/meeting-list.tsx +++ b/app/_features/meeting/meeting-list.tsx @@ -64,50 +64,51 @@ export default function MeetingList({ events }: { events: EventType.Event[] }) { <>
-

{activeItem && now ? ( diff --git a/app/_shared/components/icons/tabler-circle-arrow-down-icon.tsx b/app/_shared/components/icons/tabler-circle-arrow-down-icon.tsx new file mode 100644 index 00000000..8324db9e --- /dev/null +++ b/app/_shared/components/icons/tabler-circle-arrow-down-icon.tsx @@ -0,0 +1,22 @@ +import type { SVGElementPropsType } from '@/_shared/types/types'; + +export default function TablerCircleArrowDownIcon(props: SVGElementPropsType) { + return ( + + + + + + + + ); +}