Skip to content

Commit

Permalink
fix: Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlun0804 committed Oct 9, 2024
1 parent 149f059 commit 6be7864
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 74 deletions.
1 change: 0 additions & 1 deletion apps/web/src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getServerSession } from "next-auth"
import { redirect } from "next/navigation"

const ProfilePage = async () => {

const session = await getServerSession()

if (session === null) {
Expand Down
26 changes: 14 additions & 12 deletions apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx
Original file line number Diff line number Diff line change
@@ -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<QuoteDisplayProps> = ({ quote, name, year, className }) => {
return (
<div className={`px-16 items-center justify-center ${className}`}>
<p className="text-slate-10">{quote}</p>
<p className="text-slate-10">- {name} {year}</p>
</div>
);
return (
<div className={`px-16 items-center justify-center ${className}`}>
<p className="text-slate-10">{quote}</p>
<p className="text-slate-10">
- {name} {year}
</p>
</div>
)
}

export default QuoteDisplay;
export default QuoteDisplay
48 changes: 25 additions & 23 deletions apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx
Original file line number Diff line number Diff line change
@@ -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<PersonalInfoProps> = ({ user, className }) => {
return (
<div className={`flex flex-col items-center justify-center gap-3 ${className}`}>
<Avatar className="w-40 h-auto opacity-60">
<AvatarImage src={user.image} alt="UserAvatar" />
<AvatarFallback className="w-40 h-40">{user.name}</AvatarFallback>
</Avatar>
<p className="text-lg">{user.name}</p>
<p className="text-lg text-slate-10">{user.email}</p>
<Button variant="gradient" className="self-auto">
<Link href="/settings">Profil Innstillinger</Link>
</Button>
{/* <ChangeAvatar {...user} /> */}
</div>
);
};
console.log("PersonalInfo")
console.log(user)
return (
<div className={`flex flex-col items-center justify-center gap-3 ${className}`}>
<Avatar className="w-40 h-auto opacity-60">
<AvatarImage src={user.image} alt="UserAvatar" />
<AvatarFallback className="w-40 h-40">{user.name}</AvatarFallback>
</Avatar>
<p className="text-lg">{user.name}</p>
<p className="text-lg text-slate-10">{user.email}</p>
<Button variant="gradient" className="self-auto">
<Link href="/settings">Profil Innstillinger</Link>
</Button>
{/* <ChangeAvatar {...user} /> */}
</div>
)
}

export default PersonalInfo;
export default PersonalInfo
Original file line number Diff line number Diff line change
@@ -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<StudyProgressionBoxProps> = ({ 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 (
<div className={`flex flex-col items-center justify-center gap-3 ${className ?? ''}`}>
<p>{grade}. klasse</p>
<p>Studiesett: {startYear}</p>
<div className="transform scale-90">
<StudentProgress year={grade} />
</div>
</div>
)
return (
<div className={`flex flex-col items-center justify-center gap-3 ${className ?? ""}`}>
<p>{grade}. klasse</p>
<p>Studiesett: {startYear}</p>
<div className="transform scale-90">
<StudentProgress year={grade} />
</div>
</div>
)
}

export default StudyProgressionBox;
export default StudyProgressionBox
Original file line number Diff line number Diff line change
@@ -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<ProfileInfoBoxProps> = ({ 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 (
<div className="border-slate-7 mt-9 min-w-[970px] rounded-xl left-0 z-0 w-full border flex flex-row justify-evenly py-16">
<div className={`min-w-[340px] ${lineStyle}`}>
<PersonalInfo user={user} />
</div>
{bio && (
<div className={`min-w-[220px] ${lineStyle}`}>
<BioDisplay quote="Most people call me Ho Lee, but you can call me anytime <3. " name="Ho Lee Fuk" year={2024} />
</div>
)}
<div className={`min-w-[410px] ${lineStyle}`}>
<StudyProgressionBox />
</div>
</div>
)
return (
<div className="border-slate-7 mt-9 min-w-[970px] rounded-xl left-0 z-0 w-full border flex flex-row justify-evenly py-16">
<div className={`min-w-[340px] ${lineStyle}`}>
<PersonalInfo user={user} />
</div>
{bio && (
<div className={`min-w-[220px] ${lineStyle}`}>
<BioDisplay
quote="Most people call me Ho Lee, but you can call me anytime <3. "
name="Ho Lee Fuk"
year={2024}
/>
</div>
)}
<div className={`min-w-[410px] ${lineStyle}`}>
<StudyProgressionBox />
</div>
</div>
)
}

export default ProfileInfoBox
export default ProfileInfoBox

0 comments on commit 6be7864

Please sign in to comment.