Skip to content

Commit 18fea54

Browse files
committed
chore: responsive tabs for dashboard route
1 parent e3311c1 commit 18fea54

File tree

11 files changed

+74
-50
lines changed

11 files changed

+74
-50
lines changed

next.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const config = {
4343
protocol: 'https',
4444
hostname: 'encrypted-tbn0.gstatic.com',
4545
},
46-
]
46+
],
4747
},
4848
experimental: {
4949
esmExternals: 'loose',

src/app/(auth)/signin/[id]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export default function SignIn({
164164
width={1440}
165165
height={900}
166166
priority
167-
style={{ width: 'auto', height: 'auto' }}
167+
style={{ width: 'auto', height: 'auto' }}
168168
/>
169169
</div>
170170
);

src/app/(dashboard)/dashboard/_components/cards/VideoCard.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ const VideoCard: React.FC<VideoCardProps> = memo(({ videos }) => {
7272
{he.decode(video.snippet.description)}
7373
</p>
7474
<div className="flex flex-wrap gap-2 mb-4">
75-
<Badge
76-
variant="secondary"
77-
className={`text-xs text-navy`}
78-
>
75+
<Badge variant="secondary" className={`text-xs text-navy`}>
7976
<Eye className="w-3 h-3 mr-1" />
8077
{viewedVideos[video.id.videoId] ? 'Not viewed' : 'Viewed'}
8178
</Badge>

src/app/(dashboard)/dashboard/_components/dashboard.tsx

+12-8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import VideoCard from './cards/VideoCard';
3131
import DiscussionWithAI from './discussion-with-ai';
3232

3333
import type { FurtherInfo, Note, Output, ParsedVideoData, Question, VideoItem } from './interfaces';
34+
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
3435

3536
export const Dashboard = () => {
3637
const [isOpen, setIsOpen] = useState(false);
@@ -289,13 +290,16 @@ export const Dashboard = () => {
289290
</div>
290291
) : (
291292
<Tabs defaultValue="summary" className="w-full">
292-
<TabsList className="grid w-full grid-cols-5">
293-
<TabsTrigger value="summary">Summary</TabsTrigger>
294-
<TabsTrigger value="video">Video recommendation</TabsTrigger>
295-
<TabsTrigger value="qna">Q&A</TabsTrigger>
296-
<TabsTrigger value="further-info">Further Information</TabsTrigger>
297-
<TabsTrigger value="action-items">Action Items</TabsTrigger>
298-
</TabsList>
293+
<ScrollArea className="w-full">
294+
<TabsList className="inline-flex w-full min-w-max">
295+
<TabsTrigger value="summary">Summary</TabsTrigger>
296+
<TabsTrigger value="video">Video recommendation</TabsTrigger>
297+
<TabsTrigger value="qna">Q&A</TabsTrigger>
298+
<TabsTrigger value="further-info">Further Information</TabsTrigger>
299+
<TabsTrigger value="action-items">Action Items</TabsTrigger>
300+
</TabsList>
301+
<ScrollBar orientation={`horizontal`} />
302+
</ScrollArea>
299303
<TabsContent value="summary">
300304
{summaryData && <SummaryCard summaryData={summaryData} />}
301305
</TabsContent>
@@ -369,4 +373,4 @@ export const Dashboard = () => {
369373
);
370374
};
371375

372-
export default Dashboard;
376+
export default Dashboard;

src/app/(dashboard)/dashboard/_components/discussion-with-ai.tsx

+12-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
66
import { Input } from '@/components/ui/input';
77
import { ScrollArea } from '@/components/ui/scroll-area';
88
import axios from 'axios';
9-
import { Bot, Send, User, Loader2, Copy, Check } from 'lucide-react';
9+
import { Bot, Check, Copy, Loader2, Send, User } from 'lucide-react';
1010
import type React from 'react';
1111
import { useCallback, useEffect, useRef, useState } from 'react';
1212
import ReactMarkdown from 'react-markdown';
@@ -26,7 +26,10 @@ interface DiscussionWithAIProps {
2626

2727
const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
2828
const [input, setInput] = useState<string>('');
29-
const [responses, setResponses, removeResponses] = useLocalStorage<Message[]>(`chat-responses-${learningid}`, []);
29+
const [responses, setResponses, removeResponses] = useLocalStorage<Message[]>(
30+
`chat-responses-${learningid}`,
31+
[],
32+
);
3033
const [chatSession, setChatSession] = useState<any>(null);
3134
const [loading, setLoading] = useState<boolean>(false);
3235
const [basicQuestions, setBasicQuestions] = useState<string[]>([]);
@@ -156,10 +159,11 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
156159
className={`flex ${response.sender === 'user' ? 'justify-end' : 'justify-start'}`}
157160
>
158161
<div
159-
className={`p-2 rounded-lg max-w-[80%] text-sm ${response.sender === 'user'
162+
className={`p-2 rounded-lg max-w-[80%] text-sm ${
163+
response.sender === 'user'
160164
? 'bg-primary dark:text-navy text-white'
161165
: 'bg-secondary text-secondary-foreground'
162-
} relative group`}
166+
} relative group`}
163167
>
164168
{response.sender === 'user' ? (
165169
<User className="inline-block mr-2 h-4 w-4" />
@@ -210,7 +214,9 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
210214
</Button>
211215
))
212216
) : (
213-
<div className="text-sm text-muted-foreground">No suggested questions available.</div>
217+
<div className="text-sm text-muted-foreground">
218+
No suggested questions available.
219+
</div>
214220
)}
215221
</div>
216222
</ScrollArea>
@@ -244,4 +250,4 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
244250
);
245251
};
246252

247-
export default DiscussionWithAI;
253+
export default DiscussionWithAI;

src/app/(dashboard)/notes/_components/NewNote.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,7 @@ export const NewNoteSection: React.FC<{
212212
<FormItem>
213213
<FormLabel>Title</FormLabel>
214214
<FormControl>
215-
<Input
216-
{...field}
217-
placeholder="Title"
218-
className="w-full"
219-
/>
215+
<Input {...field} placeholder="Title" className="w-full" />
220216
</FormControl>
221217
</FormItem>
222218
)}
@@ -282,4 +278,4 @@ export const NewNoteSection: React.FC<{
282278
</Dialog>
283279
</div>
284280
);
285-
};
281+
};

src/app/(legal)/layout.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ export default function LegalLayout({
2525
>
2626
<div className="container mx-auto px-4">
2727
<Link href="/" className="text-2xl font-bold">
28-
<Image
29-
width={150}
28+
<Image
29+
width={150}
3030
height={50}
31-
src={`/assets/svgs/home/main-logo.svg`} alt="Home Logo"
31+
src={`/assets/svgs/home/main-logo.svg`}
32+
alt="Home Logo"
3233
/>
3334
</Link>
3435
</div>

src/app/HomeNavigation.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { UserNav } from '@/components';
44
import { Button } from '@/components/ui/button';
55
import { createClient } from '@/utils/supabase/client';
66
import type { User } from '@supabase/supabase-js';
7-
import Link from 'next/link';
8-
import { useRouter } from 'next/navigation';
9-
import { useState, useEffect } from 'react';
107
import { Menu, X } from 'lucide-react';
118
import Image from 'next/image';
9+
import Link from 'next/link';
10+
import { useRouter } from 'next/navigation';
11+
import { useEffect, useState } from 'react';
1212

1313
export const HomeNavigation = () => {
1414
const [user, setUser] = useState<User | null>(null);
@@ -36,9 +36,9 @@ export const HomeNavigation = () => {
3636
{ name: 'Home', path: '/' },
3737
...(user
3838
? [
39-
{ name: 'My Learning', path: '/my-learning' },
40-
{ name: 'Dashboard', path: '/dashboard' },
41-
]
39+
{ name: 'My Learning', path: '/my-learning' },
40+
{ name: 'Dashboard', path: '/dashboard' },
41+
]
4242
: []),
4343
];
4444

@@ -130,4 +130,4 @@ export const HomeNavigation = () => {
130130
)}
131131
</nav>
132132
);
133-
};
133+
};

src/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use client';
22

3+
import { Footer } from '@/components';
34
import { Button } from '@/components/ui/button';
45
import Image from 'next/image';
56
import Link from 'next/link';
67
import { useRouter } from 'next/navigation';
78
import { HomeNavigation } from './HomeNavigation';
8-
import { Footer } from '@/components';
99

1010
export default function Home() {
1111
const router = useRouter();

src/components/custom/Footer.tsx

+32-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react'
2-
import Link from 'next/link'
3-
import Image from 'next/image'
1+
import Image from 'next/image';
2+
import Link from 'next/link';
3+
import React from 'react';
44

55
const Footer = () => {
66
return (
@@ -30,7 +30,10 @@ const Footer = () => {
3030
</Link>
3131
</li>
3232
<li>
33-
<Link href="/features" className="text-gray-600 hover:text-navy transition-colors">
33+
<Link
34+
href="/features"
35+
className="text-gray-600 hover:text-navy transition-colors"
36+
>
3437
Features
3538
</Link>
3639
</li>
@@ -47,17 +50,26 @@ const Footer = () => {
4750
<nav>
4851
<ul className="space-y-2">
4952
<li>
50-
<Link href="/legal/privacy" className="text-gray-600 hover:text-navy transition-colors">
53+
<Link
54+
href="/legal/privacy"
55+
className="text-gray-600 hover:text-navy transition-colors"
56+
>
5157
Privacy Policy
5258
</Link>
5359
</li>
5460
<li>
55-
<Link href="/legal/terms" className="text-gray-600 hover:text-navy transition-colors">
61+
<Link
62+
href="/legal/terms"
63+
className="text-gray-600 hover:text-navy transition-colors"
64+
>
5665
Terms of Service
5766
</Link>
5867
</li>
5968
<li>
60-
<Link href="/legal/cookies" className="text-gray-600 hover:text-navy transition-colors">
69+
<Link
70+
href="/legal/cookies"
71+
className="text-gray-600 hover:text-navy transition-colors"
72+
>
6173
Cookie Policy
6274
</Link>
6375
</li>
@@ -73,7 +85,11 @@ const Footer = () => {
7385
<a href="#" className="text-gray-600 hover:text-navy transition-colors">
7486
<span className="sr-only">Facebook</span>
7587
<svg className="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
76-
<path fillRule="evenodd" d="M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z" clipRule="evenodd" />
88+
<path
89+
fillRule="evenodd"
90+
d="M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z"
91+
clipRule="evenodd"
92+
/>
7793
</svg>
7894
</a>
7995
<a href="#" className="text-gray-600 hover:text-navy transition-colors">
@@ -85,14 +101,18 @@ const Footer = () => {
85101
<a href="#" className="text-gray-600 hover:text-navy transition-colors">
86102
<span className="sr-only">GitHub</span>
87103
<svg className="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
88-
<path fillRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clipRule="evenodd" />
104+
<path
105+
fillRule="evenodd"
106+
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
107+
clipRule="evenodd"
108+
/>
89109
</svg>
90110
</a>
91111
</div>
92112
</div>
93113
</div>
94114
</footer>
95-
)
96-
}
115+
);
116+
};
97117

98-
export { Footer }
118+
export { Footer };

src/components/custom/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export * from './Video';
33
export * from './AuthButton';
44
export * from './LoadingDots';
55
export * from './search-bar';
6-
export * from './Footer';
6+
export * from './Footer';

0 commit comments

Comments
 (0)