diff --git a/components/Navigation/Navigation.module.scss b/components/Navigation/Navigation.module.scss index 3b409a8..25e79a9 100644 --- a/components/Navigation/Navigation.module.scss +++ b/components/Navigation/Navigation.module.scss @@ -91,7 +91,7 @@ display: none; } -@media screen and (max-width: 800px) { +@media screen and (max-width: 860px) { .nav { height: 3rem; } @@ -101,6 +101,12 @@ .mobile { display: inherit; } + .menumobile { + padding: 0 1rem; + } + .logoutmobile { + padding: 0 1rem; + } } /* FOR TESTING MOBILE NAV WITHOUT DEVTOOLS */ diff --git a/components/Navigation/Navigation.tsx b/components/Navigation/Navigation.tsx index 2dec81d..85da3c7 100644 --- a/components/Navigation/Navigation.tsx +++ b/components/Navigation/Navigation.tsx @@ -27,7 +27,10 @@ const Navigation = () => { ); })} -
+
{/* TUTAJ WSTAWIĆ IKONKĘ PÓŹNIEJ */}
@@ -68,7 +71,7 @@ const Navigation = () => { {!isLoading && user && ( diff --git a/components/ProfileCard/ProfileCard.module.scss b/components/ProfileCard/ProfileCard.module.scss new file mode 100644 index 0000000..3be1bef --- /dev/null +++ b/components/ProfileCard/ProfileCard.module.scss @@ -0,0 +1,108 @@ +.profile { + margin: 2rem 0; + background: var(--black1); + border-radius: 8px; + box-shadow: var(--shadow0); + article { + display: flex; + flex-direction: row; + padding: 1.5rem 1.5rem 1rem 1.5rem; + gap: 1rem; + background-color: var(--black2); + border-radius: 8px 8px 0 0; + @media screen and (max-width: 400px) { + flex-direction: column; + justify-content: center; + } + img { + border-radius: 50%; + height: 128px; + width: 128px; + aspect-ratio: 1 / 1; + object-fit: cover; + object-position: 50% 35%; + @media screen and (max-width: 600px) { + height: 64px; + width: 64px; + } + } + .inner { + width: 100%; + display: flex; + flex-direction: column; + header { + display: flex; + flex-direction: row; + align-items: baseline; + justify-content: space-between; + width: 100%; + h1 { + font-size: 2rem; + } + p { + font-family: var(--fonts-bold); + span { + font-size: 2rem; + } + } + } + .badges { + display: flex; + flex-direction: row; + gap: 1rem; + margin: 8px 0; + margin-top: auto; + .badge { + display: flex; + flex-direction: row; + align-items: center; + width: initial; + gap: 8px; + padding: 4px 8px; + background: rgba(white, 0.1); + border-radius: 4px; + .dot { + width: 16px; + height: 16px; + border-radius: 50%; + background-color: #fb636b; + } + } + } + } + } + .xpinfo { + display: flex; + flex-direction: row; + justify-content: space-between; + background: var(--black2); + color: #ababab; + padding: 0 14px; + } + .xpbar { + display: block; + width: 100%; + height: 10px; + background: rgba(white, 0.025); + .xpinner { + display: block; + height: 100%; + width: 99%; + background: #fb636b; + opacity: 75%; + } + } + footer { + min-height: 16px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + section { + width: 50%; + padding: 2rem; + @media screen and (max-width: 800px) { + width: 100%; + } + } + } +} diff --git a/components/ProfileCard/ProfileCard.tsx b/components/ProfileCard/ProfileCard.tsx new file mode 100644 index 0000000..94f5176 --- /dev/null +++ b/components/ProfileCard/ProfileCard.tsx @@ -0,0 +1,116 @@ +import styles from "./ProfileCard.module.scss"; + +type UserProfileCardProps = { + data: { + username: string; + description?: string; + picture?: string | null; + isAdmin?: boolean; + isDeveloper?: boolean; + experience?: { + level: number; + tilNextLevel?: number; + looseXP?: number; + }; + badges?: { + badgeName: string; + badgeDesc?: string; + badgeMerit?: string; + badgeImage?: string; + }[]; + accentColor?: string; + }; +}; + +const ProfileCard = ({ data }: UserProfileCardProps) => { + return ( + <> +
+
+ {data.username} +
+
+

{data.username}

+

+ {data.experience?.level && ( + <> + {"LVL "} + {data.experience.level} + + )} +

+
+

{data.description}

+
+ {data.isAdmin && ( +
+
+ Admin +
+ )} + {data.isDeveloper && ( +
+
+ Developer +
+ )} +
+
+
+ {data.experience?.looseXP && data.experience.tilNextLevel && ( +
+

XP: {data.experience.looseXP}

+

XP until next level: {data.experience.tilNextLevel}

+
+ )} + {data.experience?.looseXP && data.experience.tilNextLevel && ( +
+
+
+ )} +
+ {data.badges + ?.slice(0, 1) + .map( + (el: { + badgeName: string; + badgeDesc?: string; + badgeMerit?: string; + badgeImage?: string; + }) => { + return ( +
+

{el.badgeName}

+

{el.badgeDesc}

+
+ ); + } + )} +
+
+ + ); +}; + +export { ProfileCard }; diff --git a/pages/ja.tsx b/pages/ja.tsx deleted file mode 100644 index 2bf12b9..0000000 --- a/pages/ja.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import styles from "../styles/Ja.module.scss"; -import { useUser } from "@auth0/nextjs-auth0/client"; - -const PageMe = () => { - const { user, error, isLoading } = useUser(); - return ( - <> - {isLoading && ( -
-

Ładujemy dane dla Ciebie...

-

Sit tight.

-
- )} - {error && ( -
-

Wystąpił błąd.

-

Tyle wiemy.

-
- )} - {!isLoading && !error && user && ( -
-
- {`${user.name}'s -

{user.name}

-
-
- )} - {!isLoading && !user && ( -
-

/ja

-

- Musisz być zalogowany aby skorzystać z funkcjonalności tej strony. -

-
- )} - - ); -}; - -export default PageMe; diff --git a/pages/ja/index.tsx b/pages/ja/index.tsx new file mode 100644 index 0000000..872ebca --- /dev/null +++ b/pages/ja/index.tsx @@ -0,0 +1,125 @@ +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(() => { + if (!user) return; + 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 ( + <> + {isLoading && ( +
+

Ładujemy dane dla Ciebie...

+

Sit tight.

+
+ )} + {error && ( +
+

Wystąpił błąd.

+

Tyle wiemy:

+

{error.name}

+

{error.message}

+
+ )} + {!isLoading && !error && user && ( +
+ + + + + + {/* + + */} +
+ )} + {!isLoading && !user && ( +
+

/ja

+

+ Musisz być zalogowany aby skorzystać z funkcjonalności tej strony. +

+
+ )} + + ); +}; + +export default PageMe; diff --git a/pages/ja/ustawienia.tsx b/pages/ja/ustawienia.tsx new file mode 100644 index 0000000..bdc01eb --- /dev/null +++ b/pages/ja/ustawienia.tsx @@ -0,0 +1,42 @@ +import { useUser } from "@auth0/nextjs-auth0/client"; +import { SEO } from "../../components/SEO"; +import styles from "../../styles/ustawienia.module.scss"; + +const PageMeSettings = () => { + const { user, error, isLoading } = useUser(); + + return ( + <> + {isLoading && ( + <> +
+

Ładowanie danych...

+
+ + )} + {error && ( +
+

Wystąpił błąd.

+

Tyle wiemy.

+
+ )} + {!isLoading && !error && user && ( + <> +
+ +

ustawienia konta

+

+ Kolor akcentowy +

+
+
+

uwaga: strona w trakcie budowy. funkcjonalność niegotowa.

+ +
+ + )} + + ); +}; + +export default PageMeSettings; diff --git a/pages/profil/[profname]/index.tsx b/pages/profil/[profname]/index.tsx index cc4a8be..3bd1051 100644 --- a/pages/profil/[profname]/index.tsx +++ b/pages/profil/[profname]/index.tsx @@ -1,5 +1,6 @@ import { useRouter } from "next/router"; import { useEffect, useState } from "react"; +import { ProfileCard } from "../../../components/ProfileCard/ProfileCard"; import { SEO } from "../../../components/SEO"; const ProfilePage = () => { @@ -43,37 +44,64 @@ const ProfilePage = () => { return wpis.Name.replaceAll(" ", "-").toLocaleLowerCase() === profname; })[0]; return ( -
+ <> -
- {`${person.Name} +
-
-

{person.Name}

-

{person.Desc}

-
-
+ > + {`${person.Name} +
+

{person.Name}

+

{person.Desc}

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

{el ||
}

; })} */} -
+ {/* */} +
+ +
+ ); } else { return ( diff --git a/styles/Ja.module.scss b/styles/Ja.module.scss deleted file mode 100644 index fad7f83..0000000 --- a/styles/Ja.module.scss +++ /dev/null @@ -1,14 +0,0 @@ -.header { - margin: 2rem 0; - display: flex; - flex-direction: row; - align-items: center; - gap: 1rem; - img { - height: 69px; - border-radius: 50%; - } - h1 { - font-size: 2rem; - } -} diff --git a/styles/globals.scss b/styles/globals.scss index 0d50be4..9c12678 100644 --- a/styles/globals.scss +++ b/styles/globals.scss @@ -62,6 +62,17 @@ button { // color: black; } } +input { + display: inline-block; + font-size: 1rem; + padding: 4px; + border-radius: 3px; + background: rgba(white, 0.1); + border: 0; + color: white; + outline: none; + font-family: var(--fonts-norm); +} .chips { display: flex;