Skip to content

Commit

Permalink
fixed few lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
amanbairagi30 committed Aug 19, 2024
1 parent ff1a9b3 commit 5f79633
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 90 deletions.
16 changes: 8 additions & 8 deletions src/app/MainProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client'
import React, { ReactNode } from 'react'
import { Appbar } from '@/components/Appbar'
import MainSidebar from '@/components/MainSidebar'
import { mainSideBarToggle } from '@/store/atoms/mainSidebar'
import { useRecoilState, useRecoilValue } from 'recoil'
import { useSession } from 'next-auth/react'
'use client';
import React, { ReactNode } from 'react';
import { Appbar } from '@/components/Appbar';
import MainSidebar from '@/components/MainSidebar';
import { mainSideBarToggle } from '@/store/atoms/mainSidebar';
import { useRecoilState, useRecoilValue } from 'recoil';
import { useSession } from 'next-auth/react';
// import Topbar from '@/components/Topbar'


Expand All @@ -28,7 +28,7 @@ export default function MainProvider({ children }: { children: ReactNode }) {
)}
{(session && session?.user && !isLoading) && <MainSidebar />}

<div className={`flex flex-col w-full ${isMainSideBarCompressed ? ` ${(session && session?.user && !isLoading) ? 'md:w-[calc(100vw-4rem)]':'w-full'}` : 'md:w-[calc(100vw-15rem)]'} `}>
<div className={`flex flex-col w-full ${isMainSideBarCompressed ? ` ${(session && session?.user && !isLoading) ? 'md:w-[calc(100vw-4rem)]' : 'w-full'}` : 'md:w-[calc(100vw-15rem)]'} `}>
{/* <Topbar /> */}
<Appbar />
<div className='!h-[calc(100vh-4rem)] w-full overflow-y-auto'>
Expand Down
12 changes: 6 additions & 6 deletions src/app/payout-methods/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
import { useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
import NewPayoutDialog from "@/components/NewPayoutDialog";
import { Trash } from "lucide-react"
import { Trash } from "lucide-react";
import { deleteSolanaAddress, deleteUpiId, getPayoutMethods } from "@/actions/payoutMethods";
import { SolanaAddress, UpiId } from "@prisma/client";
import { useAction } from "@/hooks/useAction";
import { toast } from "sonner";

export default function Page() {

const [isDialogBoxOpen, setIsDialogBoxOpen] = useState<boolean>(false)
const [btnClicked, setBtnClicked] = useState<string>("")
const [isDialogBoxOpen, setIsDialogBoxOpen] = useState<boolean>(false);
const [btnClicked, setBtnClicked] = useState<string>("");

const openDialog = (e: any) => {
setIsDialogBoxOpen(true)
setBtnClicked(e.target.id)
setIsDialogBoxOpen(true);
setBtnClicked(e.target.id);
}

const closeDialog = () => setIsDialogBoxOpen(false)
const closeDialog = () => setIsDialogBoxOpen(false);

const [upiAddresses, setUpiAddresses] = useState<UpiId[] | undefined>([])
const [solanaAddresses, setSolanaAddresses] = useState<SolanaAddress[] | undefined>([])
Expand Down
2 changes: 1 addition & 1 deletion src/components/CircularProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function CircularProgressBar({ percentage = 91 }) {
<RadialBarChart
data={chartData}
startAngle={90}
endAngle={endAngle == 0 ? 450 : endAngle}
endAngle={endAngle === 0 ? 450 : endAngle}
innerRadius={28}
outerRadius={40}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/ContentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CheckCircle2 } from 'lucide-react';
import PercentageComplete from './PercentageComplete';
// import { CheckCircle2 } from 'lucide-react';
// import PercentageComplete from './PercentageComplete';
import { Bookmark } from '@prisma/client';
import BookmarkButton from './bookmark/BookmarkButton';
import { formatTime } from '@/lib/utils';
import VideoThumbnail from './videothumbnail';
import CardComponent from './CardComponent';
// import CardComponent from './CardComponent';
import CardThumbnail from './CardThumbnail';
import { CircularProgressBar } from './CircularProgressBar';

Expand Down
6 changes: 3 additions & 3 deletions src/components/FolderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useRouter } from 'next/navigation';
import { ContentCard } from './ContentCard';
import { Bookmark } from '@prisma/client';
import { useRecoilState } from 'recoil';
import { useRecoilValue } from 'recoil';
import { sidebarOpen as sidebarOpenAtom } from '@/store/atoms/sidebar';
import { mainSideBarToggle } from '@/store/atoms/mainSidebar';

Expand Down Expand Up @@ -41,8 +41,8 @@ export const FolderView = ({
}
// why? because we have to reset the segments or they will be visible always after a video

const [sidebarOpen, setSidebarOpen] = useRecoilState(sidebarOpenAtom);
const [isMainSideBarCompressed, setIsMainSideBarCompressed] = useRecoilState(mainSideBarToggle);
const sidebarOpen = useRecoilValue(sidebarOpenAtom);
const isMainSideBarCompressed = useRecoilValue(mainSideBarToggle);


return (
Expand Down
23 changes: 11 additions & 12 deletions src/components/MainSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
'use client'
import React, { useEffect, useState } from 'react'
import Logo from './landing/logo/logo'
import { Bookmark, Files, FileStack, HelpCircle, History, LogOut, MessageSquare, PanelLeftOpen, PanelRightOpen } from 'lucide-react'
import Link from 'next/link'
import Image from 'next/image'
import { usePathname, useRouter } from 'next/navigation'
import { signOut, useSession } from 'next-auth/react'
import { useRecoilState } from 'recoil'
import { mainSideBarToggle } from '@/store/atoms/mainSidebar'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip'
'use client';
import React, { useEffect, useState } from 'react';
import Logo from './landing/logo/logo';
import { Bookmark, Files, FileStack, HelpCircle, History, LogOut, MessageSquare, PanelLeftOpen, PanelRightOpen } from 'lucide-react';
import Link from 'next/link';
// import Image from 'next/image';
import { usePathname, useRouter } from 'next/navigation';
import { signOut, useSession } from 'next-auth/react';
import { useRecoilState } from 'recoil';
import { mainSideBarToggle } from '@/store/atoms/mainSidebar';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip';

interface ActiveItem {
general: number | null;
others: number | null;
}

export default function MainSidebar() {

const pathName = usePathname();
const [activeItems, setActiveItems] = useState<ActiveItem>({
general: null,
Expand Down
48 changes: 24 additions & 24 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,34 +246,34 @@ export function ToggleButton({
);
}

function GoBackButton() {
const router = useRouter();
// function GoBackButton() {
// const router = useRouter();

const goBack = () => {
const pathSegments = window.location.pathname.split('/');
// const goBack = () => {
// const pathSegments = window.location.pathname.split('/');

// Remove the last segment of the path
pathSegments.pop();
// // Remove the last segment of the path
// pathSegments.pop();

// Check if it's the last page in the course, then go to root
if (pathSegments.length <= 2) {
router.push('/');
} else {
const newPath = pathSegments.join('/');
router.push(newPath);
}
};
// // Check if it's the last page in the course, then go to root
// if (pathSegments.length <= 2) {
// router.push('/');
// } else {
// const newPath = pathSegments.join('/');
// router.push(newPath);
// }
// };

return (
<div className="w-full p-2">
{/* Your component content */}
<Button size={'full'} onClick={goBack} className="group rounded-full">
<BackArrow className="h-5 w-5 transition-all duration-200 ease-in-out group-hover:-translate-x-1 rtl:rotate-180" />{' '}
<div className="pl-4">Go Back</div>
</Button>
</div>
);
}
// return (
// <div className="w-full p-2">
// {/* Your component content */}
// <Button size={'full'} onClick={goBack} className="group rounded-full">
// <BackArrow className="h-5 w-5 transition-all duration-200 ease-in-out group-hover:-translate-x-1 rtl:rotate-180" />{' '}
// <div className="pl-4">Go Back</div>
// </Button>
// </div>
// );
// }

function VideoIcon() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/SidebarToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import React from 'react'
import { ToggleButton } from './Sidebar';
'use client';
import React from 'react';
// import { ToggleButton } from './Sidebar';
import { usePathname } from 'next/navigation';
import { useRecoilState } from 'recoil';
import { sidebarOpen as sidebarOpenAtom } from '../store/atoms/sidebar';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeToggler.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import * as React from 'react';
import { Moon, SunDimIcon, SunMoonIcon } from 'lucide-react';
import { Moon, SunDimIcon } from 'lucide-react';
import { useTheme } from 'next-themes';
import { Button } from './ui/button';

Expand Down
9 changes: 0 additions & 9 deletions src/components/Topbar.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/admin/ContentRendererClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { VideoPlayerSegment } from '@/components/VideoPlayerSegment';
import VideoContentChapters from '../VideoContentChapters';
import { useMemo, useState } from 'react';
import { handleMarkAsCompleted } from '@/lib/utils';
import { Check, ChevronLast, Milestone, Presentation, X } from "lucide-react"
import { Check, ChevronLast, Milestone, Presentation, X } from "lucide-react";

export const ContentRendererClient = ({
metadata,
Expand Down Expand Up @@ -89,7 +89,7 @@ export const ContentRendererClient = ({
setLoadingMarkAs(false);
};

const neitherChapterNorNext = !(metadata.segments?.length > 0) && !nextContent
const neitherChapterNorNext = !(metadata.segments?.length > 0) && !nextContent;

return (
<div className="flex flex-col items-start gap-2 semi:flex-row">
Expand Down
34 changes: 17 additions & 17 deletions src/components/profile-menu/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ import { SelectTheme } from './SelectTheme';

const ProfileDropdown = () => {
const menuItemLinks = [
{
href: '/history',
icon: <HistoryIcon className="mr-2 h-4 w-4" />,
label: 'Watch History',
},
{
href: '/bookmarks',
icon: <BookmarkIcon className="mr-2 h-4 w-4" />,
label: 'Bookmarks',
},
{
href: '/questions',
icon: <Bird className="mr-2 h-4 w-4" />,
label: 'Questions',
},
// {
// href: '/history',
// icon: <HistoryIcon className="mr-2 h-4 w-4" />,
// label: 'Watch History',
// },
// {
// href: '/bookmarks',
// icon: <BookmarkIcon className="mr-2 h-4 w-4" />,
// label: 'Bookmarks',
// },
// {
// href: '/questions',
// icon: <Bird className="mr-2 h-4 w-4" />,
// label: 'Questions',
// },
{
href: '/payout-methods',
icon: <CreditCard className="mr-2 h-4 w-4" />,
Expand All @@ -53,7 +53,7 @@ const ProfileDropdown = () => {
</div>
</DropdownMenuTrigger>
<DropdownMenuContent className="mr-3 mt-2 w-56 shadow-2xl">
{/* <DropdownMenuGroup>
<DropdownMenuGroup>
{menuItemLinks.map(({ href, label, icon }) => (
<Link href={href} key={href}>
<DropdownMenuItem>
Expand All @@ -64,7 +64,7 @@ const ProfileDropdown = () => {
))}
</DropdownMenuGroup>

<DropdownMenuSeparator /> */}
<DropdownMenuSeparator />

{/* <DropdownMenuGroup>
<SelectTheme />
Expand Down
2 changes: 1 addition & 1 deletion src/components/videothumbnail.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import VideoPreview from '@/actions/videopreview/videoPreview';
import { useEffect } from 'react';
import CardComponent from './CardComponent';
// import CardComponent from './CardComponent';
import CardThumbnail from './CardThumbnail';

const VideoThumbnail = ({
Expand Down

0 comments on commit 5f79633

Please sign in to comment.