Skip to content

Commit 9326ad5

Browse files
Refactor layout and add metadata to components
1 parent 08312a5 commit 9326ad5

File tree

6 files changed

+141
-5
lines changed

6 files changed

+141
-5
lines changed

app/layout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import "./globals.css";
33
import { Inter } from "next/font/google";
44
import { ClerkProvider } from "@clerk/nextjs";
55
import { Toaster } from "@/components/ui/toaster"
6+
import "@stream-io/video-react-sdk/dist/css/styles.css";
7+
import 'react-datepicker/dist/react-datepicker.css'
68

79
const inter = Inter({ subsets: ["latin"] });
810
import '@stream-io/video-react-sdk/dist/css/styles.css';

components/MeetingTypeList.tsx

+25-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { Call, useStreamVideoClient } from '@stream-io/video-react-sdk';
77
import { useUser } from '@clerk/nextjs';
88
import Loader from './Loader';
99
import { useToast } from "@/hooks/use-toast"
10-
10+
import { Textarea } from './ui/textarea';
11+
import ReactDatePicker from 'react-datepicker';
12+
import { Input } from './ui/input';
1113

1214
const initialValues = {
1315
dateTime: new Date(),
@@ -111,11 +113,27 @@ const MeetingTypeList = () => {
111113
<label className="text-base font-normal leading-[22.4px] text-sky-2">
112114
Add a description
113115
</label>
116+
<Textarea
117+
className="border-none bg-dark-3 focus-visible:ring-0 focus-visible:ring-offset-0"
118+
onChange={(e) =>
119+
setValues({ ...values, description: e.target.value })
120+
}
121+
/>
114122
</div>
115123
<div className="flex w-full flex-col gap-2.5">
116124
<label className="text-base font-normal leading-[22.4px] text-sky-2">
117125
Select Date and Time
118126
</label>
127+
<ReactDatePicker
128+
selected={values.dateTime}
129+
onChange={(date) => setValues({ ...values, dateTime: date! })}
130+
showTimeSelect
131+
timeFormat="HH:mm"
132+
timeIntervals={15}
133+
timeCaption="time"
134+
dateFormat="MMMM d, yyyy h:mm aa"
135+
className="w-full rounded bg-dark-3 p-2 focus:outline-none"
136+
/>
119137
</div>
120138
</MeetingModal>
121139
) : (
@@ -127,7 +145,7 @@ const MeetingTypeList = () => {
127145
navigator.clipboard.writeText(meetingLink);
128146
toast({ title: 'Link Copied' });
129147
}}
130-
image="/icons/checked.svg"
148+
image={'/icons/checked.svg'}
131149
buttonIcon="/icons/copy.svg"
132150
className="text-center"
133151
buttonText="Copy Meeting Link"
@@ -142,7 +160,11 @@ const MeetingTypeList = () => {
142160
buttonText="Join Meeting"
143161
handleClick={() => router.push(values.link)}
144162
>
145-
163+
<Input
164+
placeholder="Meeting link"
165+
onChange={(e) => setValues({ ...values, link: e.target.value })}
166+
className="border-none bg-dark-3 focus-visible:ring-0 focus-visible:ring-offset-0"
167+
/>
146168
</MeetingModal>
147169

148170
<MeetingModal

components/ui/input.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as React from "react"
2+
3+
import { cn } from "@/lib/utils"
4+
5+
export interface InputProps
6+
extends React.InputHTMLAttributes<HTMLInputElement> {}
7+
8+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
9+
({ className, type, ...props }, ref) => {
10+
return (
11+
<input
12+
type={type}
13+
className={cn(
14+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15+
className
16+
)}
17+
ref={ref}
18+
{...props}
19+
/>
20+
)
21+
}
22+
)
23+
Input.displayName = "Input"
24+
25+
export { Input }

components/ui/textarea.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as React from "react"
2+
3+
import { cn } from "@/lib/utils"
4+
5+
export interface TextareaProps
6+
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
7+
8+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
9+
({ className, ...props }, ref) => {
10+
return (
11+
<textarea
12+
className={cn(
13+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
14+
className
15+
)}
16+
ref={ref}
17+
{...props}
18+
/>
19+
)
20+
}
21+
)
22+
Textarea.displayName = "Textarea"
23+
24+
export { Textarea }

package-lock.json

+62-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@
1818
"@stream-io/video-react-sdk": "^1.4.2",
1919
"class-variance-authority": "^0.7.0",
2020
"clsx": "^2.1.1",
21+
"date-fns": "^4.1.0",
2122
"lucide-react": "^0.441.0",
2223
"next": "^14.2.11",
2324
"react": "^18.3.1",
25+
"react-datepicker": "^7.4.0",
2426
"react-dom": "^18.3.1",
2527
"tailwind-merge": "^2.5.2",
2628
"tailwindcss-animate": "^1.0.7"
2729
},
2830
"devDependencies": {
2931
"@types/node": "^20",
3032
"@types/react": "^18",
33+
"@types/react-datepicker": "^6.2.0",
3134
"@types/react-dom": "^18",
3235
"eslint": "^8",
3336
"eslint-config-next": "14.2.10",

0 commit comments

Comments
 (0)