-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RSN-70] - Implemented base user info page (for me and for user/usern…
…ame) (#57)
- Loading branch information
Showing
11 changed files
with
226 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
|
||
const LoginLayout = ({ | ||
children, | ||
params, | ||
}: { | ||
children: React.ReactNode; | ||
params: { | ||
tag: string; | ||
item: string; | ||
}; | ||
}) => { | ||
return ( | ||
<section className="relative mx-auto flex min-h-screen w-3/4 justify-between py-10"> | ||
{children} | ||
</section> | ||
); | ||
}; | ||
|
||
export default LoginLayout; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client"; | ||
|
||
import { SharedUserPage } from "@reasn/ui/src/components/web"; | ||
|
||
const MePage = () => { | ||
return <SharedUserPage username="memememe" />; | ||
}; | ||
|
||
export default MePage; |
20 changes: 20 additions & 0 deletions
20
Client/reasn-client/apps/web/app/user/[username]/layout.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
|
||
const UserLayout = ({ | ||
children, | ||
params, | ||
}: { | ||
children: React.ReactNode; | ||
params: { | ||
tag: string; | ||
item: string; | ||
}; | ||
}) => { | ||
return ( | ||
<section className="relative mx-auto flex min-h-screen w-3/4 justify-between py-10"> | ||
{children} | ||
</section> | ||
); | ||
}; | ||
|
||
export default UserLayout; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use client"; | ||
import { SharedUserPage } from "@reasn/ui/src/components/web"; | ||
import React from "react"; | ||
|
||
const UserPage = ({ params }: { params: { username: string } }) => { | ||
const { username } = params; | ||
return <SharedUserPage username={username} />; | ||
}; | ||
|
||
export default UserPage; |
21 changes: 21 additions & 0 deletions
21
Client/reasn-client/packages/ui/src/components/shared/Interest.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
|
||
interface InterestProps { | ||
text: string; | ||
onDelete: () => void; | ||
} | ||
|
||
export const Interest = (props: InterestProps) => { | ||
const { text, onDelete } = props; | ||
|
||
return ( | ||
<div className="flex flex-row items-center gap-3 rounded-xl bg-[#232326] px-4 py-2"> | ||
<p>{text}</p> | ||
<button onClick={onDelete} className="text-[#ccc]"> | ||
x | ||
</button> | ||
</div> | ||
); | ||
}; |
11 changes: 9 additions & 2 deletions
11
Client/reasn-client/packages/ui/src/components/shared/form/Button.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
2 changes: 2 additions & 0 deletions
2
Client/reasn-client/packages/ui/src/components/shared/form/Input.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,3 +1,5 @@ | ||
"use client"; | ||
|
||
import clsx from "clsx"; | ||
import React, { useState } from "react"; | ||
|
||
|
1 change: 1 addition & 0 deletions
1
Client/reasn-client/packages/ui/src/components/shared/index.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,3 +1,4 @@ | ||
export { Card, CardVariant } from "./Card"; | ||
export { Navbar } from "./Navbar"; | ||
export { Footer } from "./Footer"; | ||
export { Interest } from "./Interest"; |
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,3 +1,4 @@ | ||
export { HeroSection } from "./main/HeroSection"; | ||
export { QuickFilters } from "./main/QuickFilters"; | ||
export { QuickFilters, QuickFilterButton } from "./main/QuickFilters"; | ||
export { CTASection } from "./main/CTASection"; | ||
export { SharedUserPage } from "./user/SharedUserPage"; |
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
122 changes: 122 additions & 0 deletions
122
Client/reasn-client/packages/ui/src/components/web/user/SharedUserPage.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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
"use client"; | ||
|
||
import React, { useState } from "react"; | ||
import { ButtonBase } from "../../shared/form"; | ||
import { Card, CardVariant, Interest } from "../../shared"; | ||
import { QuickFilterButton } from "../main/QuickFilters"; | ||
|
||
interface SharedUserPageProps { | ||
username: string; | ||
} | ||
|
||
export const SharedUserPage = (props: SharedUserPageProps) => { | ||
const { username } = props; | ||
const isMePage = username === "memememe"; | ||
|
||
return ( | ||
<div className="relative flex w-full flex-col gap-10"> | ||
<div className="flex h-fit items-center gap-10"> | ||
<div className="relative rounded-full bg-gradient-to-r from-[#32346A] to-[#4E4F75] p-1"> | ||
<img | ||
src="https://avatars.githubusercontent.com/u/63869461?v=4" | ||
alt="avatar" | ||
className="relative z-10 h-32 w-32 rounded-full" | ||
/> | ||
<div className="absolute right-[-150%] top-[-175%] z-0 h-[400%] w-[400%] rounded-full bg-[#000b6d] opacity-15 blur-3xl"></div> | ||
</div> | ||
<div className="flex flex-col gap-1"> | ||
{isMePage ? ( | ||
<h1 className="relative z-10 text-4xl font-bold"> | ||
Imię Nazwisko{" "} | ||
<span className="text-base text-[#ccc]">({username})</span> | ||
</h1> | ||
) : ( | ||
<h1 className="relative z-10 text-4xl font-bold">{username}</h1> | ||
)} | ||
<p className="text-sm text-[#ccc]">Wrocław, Polska</p> | ||
</div> | ||
{isMePage && ( | ||
<ButtonBase | ||
text="edytuj profil" | ||
onClick={() => {}} | ||
className="ml-auto" | ||
/> | ||
)} | ||
</div> | ||
{isMePage ? <MeUserContent /> : <UserContent />} | ||
</div> | ||
); | ||
}; | ||
|
||
const MeUserContent = () => { | ||
const [selectedFilter, setSelectedFilter] = useState<string>("Wszystkie"); | ||
return ( | ||
<> | ||
<div className="z-10 w-full rounded-xl bg-[#1E1F29] p-4"> | ||
<h3 className="mb-6 text-lg font-semibold">Trwające wydarzenia:</h3> | ||
<div className="flex flex-col gap-2"> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
</div> | ||
</div> | ||
<div className="z-10 w-full rounded-xl bg-[#1E1F29] p-4"> | ||
<h3 className="mb-6 text-lg font-semibold">Nadchodzące wydarzenia:</h3> | ||
<div className="flex w-full gap-2 pb-4"> | ||
<QuickFilterButton | ||
text="Wszystkie" | ||
onClick={() => setSelectedFilter("Wszystkie")} | ||
selected={selectedFilter === "Wszystkie"} | ||
/> | ||
<QuickFilterButton | ||
text="Biorę udział" | ||
onClick={() => setSelectedFilter("Biorę udział")} | ||
selected={selectedFilter === "Biorę udział"} | ||
/> | ||
<QuickFilterButton | ||
text="Polubione" | ||
onClick={() => setSelectedFilter("Polubione")} | ||
selected={selectedFilter === "Polubione"} | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-2"> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
</div> | ||
</div> | ||
<div className="z-10 w-full rounded-xl bg-[#1E1F29] p-4"> | ||
<h3 className="mb-6 text-lg font-semibold">Twoje zainteresowania:</h3> | ||
<div className="flex w-full flex-row justify-start gap-2"> | ||
<Interest text="piłka nożna" onDelete={() => {}} /> | ||
<Interest text="pływanie" onDelete={() => {}} /> | ||
<Interest text="gry komputerowe" onDelete={() => {}} /> | ||
<ButtonBase text="+" onClick={() => {}} className="ml-auto w-16" /> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
const UserContent = () => { | ||
return ( | ||
<> | ||
<div className="z-10 w-full rounded-xl bg-[#1E1F29] p-4"> | ||
<h3 className="mb-6 text-lg font-semibold"> | ||
Obecne wydarzenia tego użytkownika: | ||
</h3> | ||
<div className="flex flex-col gap-2"> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
</div> | ||
</div> | ||
<div className="z-10 w-full rounded-xl bg-[#1E1F29] p-4"> | ||
<h3 className="mb-6 text-lg font-semibold"> | ||
Polubione wydarzenia tego użytkownika: | ||
</h3> | ||
<div className="flex flex-col gap-2"> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
<Card variant={CardVariant.List} event={"a"} /> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |