From 6be7864a23b0db78b4626ead75932287d4023006 Mon Sep 17 00:00:00 2001 From: Hanna Lunne Date: Wed, 9 Oct 2024 20:07:56 +0200 Subject: [PATCH] fix: Fix lint issues --- apps/web/src/app/profile/page.tsx | 1 - .../molecules/ProfileMolecules/BioDisplay.tsx | 26 +++++----- .../ProfileMolecules/PersonalInfo.tsx | 48 ++++++++++--------- .../ProfileMolecules/StudyProgressionBox.tsx | 33 +++++++------ .../ProfileComponents/ProfileInfoBox.tsx | 46 ++++++++++-------- 5 files changed, 80 insertions(+), 74 deletions(-) diff --git a/apps/web/src/app/profile/page.tsx b/apps/web/src/app/profile/page.tsx index 707411cdb..922976456 100644 --- a/apps/web/src/app/profile/page.tsx +++ b/apps/web/src/app/profile/page.tsx @@ -3,7 +3,6 @@ import { getServerSession } from "next-auth" import { redirect } from "next/navigation" const ProfilePage = async () => { - const session = await getServerSession() if (session === null) { diff --git a/apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx b/apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx index 3e17fdf71..4e766cd36 100644 --- a/apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx +++ b/apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx @@ -1,19 +1,21 @@ -import { FC } from "react"; +import type { FC } from "react" type QuoteDisplayProps = { - quote: string; - name: string; - year: number; - className?: string; + quote: string + name: string + year: number + className?: string } const QuoteDisplay: FC = ({ quote, name, year, className }) => { - return ( -
-

{quote}

-

- {name} {year}

-
- ); + return ( +
+

{quote}

+

+ - {name} {year} +

+
+ ) } -export default QuoteDisplay; \ No newline at end of file +export default QuoteDisplay diff --git a/apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx b/apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx index 78022efe5..54b6cc3f9 100644 --- a/apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx +++ b/apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx @@ -1,30 +1,32 @@ "use client" -import { Avatar, AvatarFallback, AvatarImage, Button } from "@dotkomonline/ui"; -import type { User } from "next-auth"; -import Link from "next/link"; -import { FC } from "react"; +import { Avatar, AvatarFallback, AvatarImage, Button } from "@dotkomonline/ui" +import type { User } from "next-auth" +import Link from "next/link" +import type { FC } from "react" type PersonalInfoProps = { - user: User; - className?: string; -}; + user: User + className?: string +} const PersonalInfo: FC = ({ user, className }) => { - return ( -
- - - {user.name} - -

{user.name}

-

{user.email}

- - {/* */} -
- ); -}; + console.log("PersonalInfo") + console.log(user) + return ( +
+ + + {user.name} + +

{user.name}

+

{user.email}

+ + {/* */} +
+ ) +} -export default PersonalInfo; +export default PersonalInfo diff --git a/apps/web/src/components/molecules/ProfileMolecules/StudyProgressionBox.tsx b/apps/web/src/components/molecules/ProfileMolecules/StudyProgressionBox.tsx index eacc0da1f..add13c1ad 100644 --- a/apps/web/src/components/molecules/ProfileMolecules/StudyProgressionBox.tsx +++ b/apps/web/src/components/molecules/ProfileMolecules/StudyProgressionBox.tsx @@ -1,25 +1,24 @@ -import { FC } from "react"; -import StudentProgress from "../StudentProgress/StudentProgress"; +import type { FC } from "react" +import StudentProgress from "../StudentProgress/StudentProgress" type StudyProgressionBoxProps = { - className?: string; + className?: string } const StudyProgressionBox: FC = ({ className }) => { - // TODO: Implement dynamic way of getting grade - const startYear = 2022; - const grade = 3; + // TODO: Implement dynamic way of getting grade + const startYear = 2022 + const grade = 3 - - return ( -
-

{grade}. klasse

-

Studiesett: {startYear}

-
- -
-
- ) + return ( +
+

{grade}. klasse

+

Studiesett: {startYear}

+
+ +
+
+ ) } -export default StudyProgressionBox; \ No newline at end of file +export default StudyProgressionBox diff --git a/apps/web/src/components/organisms/ProfileComponents/ProfileInfoBox.tsx b/apps/web/src/components/organisms/ProfileComponents/ProfileInfoBox.tsx index 45be47e1c..f745387c8 100644 --- a/apps/web/src/components/organisms/ProfileComponents/ProfileInfoBox.tsx +++ b/apps/web/src/components/organisms/ProfileComponents/ProfileInfoBox.tsx @@ -1,32 +1,36 @@ +import BioDisplay from "@/components/molecules/ProfileMolecules/BioDisplay" import PersonalInfo from "@/components/molecules/ProfileMolecules/PersonalInfo" import StudyProgressionBox from "@/components/molecules/ProfileMolecules/StudyProgressionBox" import type { User } from "next-auth" -import { FC } from "react" -import BioDisplay from "@/components/molecules/ProfileMolecules/BioDisplay" +import type { FC } from "react" type ProfileInfoBoxProps = { - user: User + user: User } const ProfileInfoBox: FC = ({ user }) => { - const lineStyle = "flex flex-1 border-r border-slate-7 justify-center items-center last:border-r-0" - const bio = true + const lineStyle = "flex flex-1 border-r border-slate-7 justify-center items-center last:border-r-0" + const bio = true // TODO: Implement fetching bio from user, setting to false if no bio - return ( -
-
- -
- {bio && ( -
- -
- )} -
- -
-
- ) + return ( +
+
+ +
+ {bio && ( +
+ +
+ )} +
+ +
+
+ ) } -export default ProfileInfoBox \ No newline at end of file +export default ProfileInfoBox