-
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.
- Loading branch information
1 parent
ead3007
commit e025307
Showing
11 changed files
with
146 additions
and
61 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
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
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
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
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
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
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,18 @@ | ||
import { GetProjectResponse } from "../utils/models"; | ||
import { Divider } from "./Divider/Divider"; | ||
import { TagBlock } from "./TagBlock/TagBlock"; | ||
|
||
export const ProjectItem = ({ project }: { project: GetProjectResponse }) => ( | ||
<div key={project.title} style={{ marginBlock: '1rem' }}> | ||
<h3 style={{ color: 'var(--color-text)' }}>{project.title}</h3> | ||
<p>{project.description}</p> | ||
<p>Właściciel: <a href={'profile/' + project.ownerId} style={{ textDecoration: 'underline' }}>{project.owner}</a></p> | ||
<p>Współpracownicy: {project.collaboratorsCount}</p> | ||
<div style={{ display: 'flex', gap: '0.5rem', marginBlock: '1rem' }}> | ||
{project.tags.map(tag => ( | ||
<TagBlock key={tag.name} tag={tag} /> | ||
))} | ||
</div> | ||
<Divider /> | ||
</div> | ||
) |
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,16 @@ | ||
import { GetTagResponse } from "../../utils/models"; | ||
|
||
export const TagBlock = ({ tag }: { tag: GetTagResponse }) => ( | ||
<div style={{ | ||
width: '5rem', | ||
height: '5rem', | ||
padding: '0.5rem', | ||
backgroundColor: 'white', | ||
borderRadius: '15%', | ||
cursor: 'pointer', | ||
userSelect: 'none', | ||
|
||
}}> | ||
<img src={tag.imagePath} draggable='false' style={{ width: '100%', height: '100%' }} /> | ||
</div> | ||
); |
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,49 +1,79 @@ | ||
import AnimatedMain from "../../components/AnimatedComps/AnimatedMain"; | ||
import styles from "./ProfilePage.module.css"; | ||
import myImg from "../../assets/pic.jpg"; | ||
import { useParams } from "react-router-dom"; | ||
import { useGetProfile } from "../../hooks/useGetProfile"; | ||
import { TagBlock } from "../../components/TagBlock/TagBlock"; | ||
import { Divider } from "../../components/Divider/Divider"; | ||
import { ProjectItem } from "../../components/ProjectItem"; | ||
|
||
export function ProfilePage() { | ||
const params = useParams<{ id: string }>(); | ||
|
||
const { data: profile, isLoading, error } = useGetProfile(params.id!); | ||
|
||
const UserSection = () => { | ||
return ( | ||
<section> | ||
<div className={styles.userHeader}> | ||
<img src={myImg} className={styles.userImage}/> | ||
<img src={myImg} className={styles.userImage} /> | ||
<div className={styles.userName} style={{ fontSize: '2.5rem' }}> | ||
<h2 >Nazwa użytkownika</h2> | ||
<p style={{ textAlign: 'center', fontSize: '1.25rem' }}>@nazwa_identyfikacyjna</p> | ||
<h2 >{profile?.data?.firstName} {profile?.data?.lastName}</h2> | ||
<p style={{ textAlign: 'center', fontSize: '1.25rem' }}>@{profile?.data?.userName}</p> | ||
</div> | ||
</div> | ||
|
||
<div style={{ fontSize: 24, marginTop: '4rem' }}> | ||
Opis użytkownika: Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum laoreet ligula in porttitor congue. Sed euismod lectus et feugiat porta. | ||
Proin finibus mauris ac mauris rutrum venenatis. Ut gravida condimentum accumsan. | ||
Etiam congue nulla pellentesque lobortis dignissim. Maecenas nec nisi in nisi hendrerit aliquam. | ||
Pellentesque placerat vitae lectus id ullamcorper. | ||
Opis użytkownika: Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Vestibulum laoreet ligula in porttitor congue. Sed euismod lectus et feugiat porta. | ||
Proin finibus mauris ac mauris rutrum venenatis. Ut gravida condimentum accumsan. | ||
Etiam congue nulla pellentesque lobortis dignissim. Maecenas nec nisi in nisi hendrerit aliquam. | ||
Pellentesque placerat vitae lectus id ullamcorper. | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
const Skills = () => { | ||
const SkillsSection = () => { | ||
return ( | ||
<section> | ||
<h3>Umiejętności</h3> | ||
<div> | ||
<span>HTML</span> | ||
<span>CSS</span> | ||
<span>JavaScript</span> | ||
<span>React</span> | ||
<span>Node.js</span> | ||
<h2 style={{ marginBottom: '0.5rem' }}>Umiejętności</h2> | ||
<Divider /> | ||
<div style={{ display: 'flex', justifyContent: 'center', gap: '1rem', marginBlock: '2rem', flexWrap: 'wrap' }}> | ||
{profile?.data?.tags.map(tag => ( | ||
<TagBlock key={tag.id} tag={tag} /> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
) | ||
} | ||
|
||
const ProjectsSection = () => { | ||
return ( | ||
<section> | ||
<div> | ||
<h2 style={{ marginBottom: '0.5rem' }}>Projekty</h2> | ||
<Divider /> | ||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', gap: '1rem', marginBlock: '2rem', flexWrap: 'wrap' }}> | ||
{profile?.data?.projects.map(project => ( | ||
<ProjectItem key={project.title} project={project} /> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
return ( | ||
<AnimatedMain> | ||
<UserSection /> | ||
<Skills /> | ||
<> | ||
{isLoading && <p>Loading...</p>} | ||
<UserSection /> | ||
<SkillsSection /> | ||
<ProjectsSection /> | ||
</> | ||
</AnimatedMain> | ||
) | ||
} |
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
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