-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
149f059
commit 6be7864
Showing
5 changed files
with
80 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
apps/web/src/components/molecules/ProfileMolecules/BioDisplay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
48
apps/web/src/components/molecules/ProfileMolecules/PersonalInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
33 changes: 16 additions & 17 deletions
33
apps/web/src/components/molecules/ProfileMolecules/StudyProgressionBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
46 changes: 25 additions & 21 deletions
46
apps/web/src/components/organisms/ProfileComponents/ProfileInfoBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |