further ProfileCard adjustments
This commit is contained in:
@@ -28,6 +28,8 @@
|
|||||||
}
|
}
|
||||||
.inner {
|
.inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
header {
|
header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -49,6 +51,7 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
margin-top: auto;
|
||||||
.badge {
|
.badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const ProfileCard = ({ data }: UserProfileCardProps) => {
|
|||||||
className={styles.dot}
|
className={styles.dot}
|
||||||
style={{ background: data.accentColor }}
|
style={{ background: data.accentColor }}
|
||||||
/>
|
/>
|
||||||
DEV
|
Developer
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,36 @@
|
|||||||
import { useUser } from "@auth0/nextjs-auth0/client";
|
import { useUser } from "@auth0/nextjs-auth0/client";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { ProfileCard } from "../../components/ProfileCard/ProfileCard";
|
import { ProfileCard } from "../../components/ProfileCard/ProfileCard";
|
||||||
import { SEO } from "../../components/SEO";
|
import { SEO } from "../../components/SEO";
|
||||||
|
|
||||||
const PageMe = () => {
|
const PageMe = () => {
|
||||||
const { user, error, isLoading } = useUser();
|
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<personsSchema | null>(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 (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -29,14 +55,15 @@ const PageMe = () => {
|
|||||||
data={{
|
data={{
|
||||||
username: user.name || "unknown user",
|
username: user.name || "unknown user",
|
||||||
picture: user.picture,
|
picture: user.picture,
|
||||||
description: "Twój opis. ヽ(*・ω・)ノ",
|
description: personsData?.Desc || "twój opis.",
|
||||||
isAdmin: true,
|
isAdmin: personsData?.IsAdmin,
|
||||||
isDeveloper: true,
|
isDeveloper: personsData?.DevBadge,
|
||||||
experience: {
|
// isAdmin: true,
|
||||||
level: 69,
|
// experience: {
|
||||||
looseXP: 420,
|
// level: 69,
|
||||||
tilNextLevel: 69,
|
// looseXP: 420,
|
||||||
},
|
// tilNextLevel: 69,
|
||||||
|
// },
|
||||||
badges: [
|
badges: [
|
||||||
{
|
{
|
||||||
badgeName: "Odkrywca internetowy",
|
badgeName: "Odkrywca internetowy",
|
||||||
@@ -71,10 +98,15 @@ const PageMe = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Link href="/ja/ustawienia">
|
<Link href="/ja/ustawienia">
|
||||||
<button style={{ width: "100%", margin: 0 }}>
|
<button style={{ width: "100%", margin: 0, marginBottom: "12px" }}>
|
||||||
Ustawienia Konta
|
Ustawienia Konta
|
||||||
</button>
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
|
{/* <Link href="/ja/ustawienia-profilu-publicznego">
|
||||||
|
<button style={{ width: "100%", margin: 0, marginBottom: "12px" }}>
|
||||||
|
Ustawienia Profilu Publicznego
|
||||||
|
</button>
|
||||||
|
</Link> */}
|
||||||
</main>
|
</main>
|
||||||
)}
|
)}
|
||||||
{!isLoading && !user && (
|
{!isLoading && !user && (
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const ProfilePage = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SEO title={person.Name} />
|
<SEO title={person.Name} />
|
||||||
<main>
|
{/* <main>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -71,26 +71,26 @@ const ProfilePage = () => {
|
|||||||
<h1>{person.Name}</h1>
|
<h1>{person.Name}</h1>
|
||||||
<p>{person.Desc}</p>
|
<p>{person.Desc}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
{/* FOR LATER BIGDESC DATASET */}
|
{/* FOR LATER BIGDESC DATASET */}
|
||||||
{/* {person.profile?.bigdesc.map((el, index) => {
|
{/* {person.profile?.bigdesc.map((el, index) => {
|
||||||
return <p key={index}>{el || <br />}</p>;
|
return <p key={index}>{el || <br />}</p>;
|
||||||
})} */}
|
})} */}
|
||||||
</main>
|
{/* </main> */}
|
||||||
<main>
|
<main>
|
||||||
<ProfileCard
|
<ProfileCard
|
||||||
data={{
|
data={{
|
||||||
username: person.Name,
|
username: person.Name,
|
||||||
picture: person.Img,
|
picture: person.Img,
|
||||||
description: "Twój opis. ヽ(*・ω・)ノ",
|
description: person.Desc,
|
||||||
// accentColor: "violet",
|
|
||||||
isAdmin: person.IsAdmin,
|
isAdmin: person.IsAdmin,
|
||||||
isDeveloper: person.DevBadge,
|
isDeveloper: person.DevBadge,
|
||||||
experience: {
|
// accentColor: "violet",
|
||||||
level: 69,
|
// experience: {
|
||||||
looseXP: 420,
|
// level: 69,
|
||||||
tilNextLevel: 69,
|
// looseXP: 420,
|
||||||
},
|
// tilNextLevel: 69,
|
||||||
|
// },
|
||||||
badges: [
|
badges: [
|
||||||
{
|
{
|
||||||
badgeName: "Odkrywca internetowy",
|
badgeName: "Odkrywca internetowy",
|
||||||
|
|||||||
Reference in New Issue
Block a user