diff --git a/components/ProfileCard/ProfileCard.module.scss b/components/ProfileCard/ProfileCard.module.scss index af8fb01..3be1bef 100644 --- a/components/ProfileCard/ProfileCard.module.scss +++ b/components/ProfileCard/ProfileCard.module.scss @@ -28,6 +28,8 @@ } .inner { width: 100%; + display: flex; + flex-direction: column; header { display: flex; flex-direction: row; @@ -49,6 +51,7 @@ flex-direction: row; gap: 1rem; margin: 8px 0; + margin-top: auto; .badge { display: flex; flex-direction: row; diff --git a/components/ProfileCard/ProfileCard.tsx b/components/ProfileCard/ProfileCard.tsx index 9a11ca9..94f5176 100644 --- a/components/ProfileCard/ProfileCard.tsx +++ b/components/ProfileCard/ProfileCard.tsx @@ -60,7 +60,7 @@ const ProfileCard = ({ data }: UserProfileCardProps) => { className={styles.dot} style={{ background: data.accentColor }} /> - DEV + Developer )} diff --git a/pages/ja/index.tsx b/pages/ja/index.tsx index 3a60d17..d9e084b 100644 --- a/pages/ja/index.tsx +++ b/pages/ja/index.tsx @@ -1,10 +1,36 @@ import { useUser } from "@auth0/nextjs-auth0/client"; import Link from "next/link"; +import { useEffect, useState } from "react"; import { ProfileCard } from "../../components/ProfileCard/ProfileCard"; import { SEO } from "../../components/SEO"; const PageMe = () => { const { user, error, isLoading } = useUser(); + type personsSchema = { + Id: string; + Name: string; + Desc?: string; + Img?: string; + IsAdmin?: boolean; + DevBadge?: boolean; + AssignedUser?: string; + }; + const [personsData, setPersonsData] = useState(null); + + useEffect(() => { + fetch("https://gractwo.pl/api/v1/admincards") + .then((res) => { + return res.json(); + }) + .then((data) => { + setPersonsData( + data.filter((el: personsSchema) => { + if (!user) return false; + return el.AssignedUser === user.sub?.replace("oauth2|discord|", ""); + })[0] + ); + }); + }, [user]); return ( <> @@ -29,14 +55,15 @@ const PageMe = () => { data={{ username: user.name || "unknown user", picture: user.picture, - description: "Twój opis. ヽ(*・ω・)ノ", - isAdmin: true, - isDeveloper: true, - experience: { - level: 69, - looseXP: 420, - tilNextLevel: 69, - }, + description: personsData?.Desc || "twój opis.", + isAdmin: personsData?.IsAdmin, + isDeveloper: personsData?.DevBadge, + // isAdmin: true, + // experience: { + // level: 69, + // looseXP: 420, + // tilNextLevel: 69, + // }, badges: [ { badgeName: "Odkrywca internetowy", @@ -71,10 +98,15 @@ const PageMe = () => { }} /> - + {/* + + */} )} {!isLoading && !user && ( diff --git a/pages/profil/[profname]/index.tsx b/pages/profil/[profname]/index.tsx index 433fdc8..3bd1051 100644 --- a/pages/profil/[profname]/index.tsx +++ b/pages/profil/[profname]/index.tsx @@ -46,7 +46,7 @@ const ProfilePage = () => { return ( <> -
+ {/*
{

{person.Name}

{person.Desc}

- - {/* FOR LATER BIGDESC DATASET */} - {/* {person.profile?.bigdesc.map((el, index) => { + */} + {/* FOR LATER BIGDESC DATASET */} + {/* {person.profile?.bigdesc.map((el, index) => { return

{el ||
}

; })} */} -
+ {/*
*/}