Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Develop #149

Merged
merged 44 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9160fd6
fix: πŸš‘ ci (#102)
velenyx Sep 24, 2023
4487510
feature: ✨ storybook pallete icons docs (#106)
velenyx Sep 24, 2023
a946bd3
feat: ✨ shared flex icon wrapper (#107)
velenyx Sep 24, 2023
de7fec8
docs: :memo: add .md doc for how to use storybook (#108)
velenyx Sep 24, 2023
db4e68c
feature: ✨ add util - get-elapsed-time (#111)
velenyx Sep 25, 2023
d04a207
feat: ✨ add useGetScreenWidth hook (#112)
velenyx Sep 25, 2023
e84ea2d
test: βœ… init jest, and add 1 test, add to ci (#113)
velenyx Sep 25, 2023
e056736
feat: ✨ add skeleton (#117)
velenyx Sep 25, 2023
21b1fc0
fix: shared components
nmashchenko Oct 5, 2023
8ebf67f
docs: updated skeleton
nmashchenko Oct 5, 2023
80db214
feat: added teameights-types
nmashchenko Oct 5, 2023
9eb15c9
feat: added loader
nmashchenko Oct 6, 2023
abe8162
feat: added drawer, sonner
nmashchenko Oct 10, 2023
3e3f4c9
feat: settings are added (#123)
dmtrack Oct 11, 2023
bbb652e
feat: added select-autocomplete & debounce
nmashchenko Oct 12, 2023
13d2116
feat: new badge component and updated iconwrapper (#125)
dmtrack Oct 15, 2023
53c80c4
refactor: added new backend (#101)
nmashchenko Oct 16, 2023
4ef91bf
fix: port for server
nmashchenko Oct 16, 2023
15578e2
feat: updated auth based on new design
nmashchenko Oct 18, 2023
6fcc6ec
fix: design issues
nmashchenko Oct 19, 2023
aa17772
feat: updated experience type
nmashchenko Oct 19, 2023
54e60fc
feat: added @teameights/types
nmashchenko Oct 19, 2023
ea96a69
feature: reusable modals (#121)
LanselonX Oct 25, 2023
4f3a262
fix: add events for flex component (#128)
merankori Oct 27, 2023
3afa747
fix: πŸ› flex (#130)
merankori Oct 27, 2023
dbc86d8
refactor(mocks): ✨ enhance user mock data generation with notificatfi…
velenyx Nov 3, 2023
639523f
feat: new search bar (#133) 🀟🏻
merankori Nov 13, 2023
37ad0de
feat: added new icons/skills (#132)
nmashchenko Nov 29, 2023
bfee5d5
feat: transfer old react-query hooks (#109)
nmashchenko Nov 30, 2023
569aec6
docs: update pull_request_template.md
nmashchenko Dec 3, 2023
b6ef6db
fix: server cleanup (#136)
nmashchenko Dec 3, 2023
605e614
feat: added base layout for registration; refactored and added some s…
mikhail2404 Dec 6, 2023
a3134f9
fix: icons cleanup (#137)
LanselonX Dec 8, 2023
c00d1fe
feature: transfer user card functionality (#110)
nmashchenko Dec 9, 2023
e257df5
feat: mobile search (#139)
merankori Dec 16, 2023
5379a69
feat: added server notifications (#140)
nmashchenko Dec 18, 2023
7a573aa
feat: ✨ create sidebar (#114)
velenyx Dec 22, 2023
da6b243
feat: added main page and connected everything (#141)
nmashchenko Dec 24, 2023
65160d4
feat: added multi-step signup (#138)
LanselonX Dec 31, 2023
f1c5928
fix: heroku procfile
nmashchenko Dec 31, 2023
e384b9c
fix: disable npm for heroku
nmashchenko Dec 31, 2023
ceb0887
Feature/friends (#143)
Ivan-Sai Mar 9, 2024
a19255b
Fix/search bar (#144)
merankori Mar 9, 2024
0b42bd2
Merge remote-tracking branch 'origin/master' into develop
nmashchenko Mar 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions client/.husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions client/.husky/pre-commit

This file was deleted.

4 changes: 0 additions & 4 deletions client/.husky/pre-push

This file was deleted.

55 changes: 55 additions & 0 deletions client/src/app/(main)/[username]/profile/layout.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

.container {
display: flex;
width: 100%;
height: 100%;
position: relative;
@media (max-width: 790px) {
position: unset;
}
.body {
width: 100%;
}
}

.back {
position: absolute;

left: 0;
display: flex;
align-items: center;
gap: 6px;
&:hover {
opacity: .7;
transition: .3s;
}

@media (max-width: 790px) {
top: 46px;
right: 15px;
left: unset;
}
}

.profile_row {
@media (max-width: 1045px) {
flex-direction: column;
width: 100%;
& > div {
width: 100%;
}
}
}

.sm_card {
width: 40%;
}

.lg_card {
width: 60%;
}

.list_card {
width: 40%;
gap: 18px;
}
24 changes: 24 additions & 0 deletions client/src/app/(main)/[username]/profile/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';
import styles from './layout.module.scss';
import { Flex, Typography } from '@/shared/ui';
import { ArrowLeftIcon, LogoBig } from '@/shared/assets';
import { useRouter } from 'next/navigation';

export default function Layout({ children }: { children: React.ReactNode }) {
const router = useRouter();

return (
<div className={styles.container}>
<Flex direction={'column'} width={'100%'} gap={'30px'}>
<button onClick={router.back} className={styles.back}>
<ArrowLeftIcon />
<Typography>Back</Typography>
</button>
<Flex justify='center'>
<LogoBig />
</Flex>
{children}
</Flex>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createContext } from 'react';

export const ProfileContext = createContext(false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useGetUsers } from '@/entities/session';
import { IUserResponse } from '@teameights/types';

export const useGetUserByName = (username: string): { data: IUserResponse | undefined } => {
const users = useGetUsers(JSON.stringify({ username: username }));

return { data: users?.data?.pages[0]?.data[0] };
};
46 changes: 46 additions & 0 deletions client/src/app/(main)/[username]/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use client';
import styles from './layout.module.scss';
import { useGetMe } from '@/entities/session';
import { Header } from './ui/header/header';
import { CardSkeleton, Flex } from '@/shared/ui';
import { List } from './ui/list/list';
import { About } from './ui/about/about';
import { useParams } from 'next/navigation';
import { Friends } from './ui/friends/friends';
import { Fields } from './ui/fields/fields';
import { useGetUserByName } from './lib/useGetUserByName';
import { ProfileContext } from './lib/profile-context';

export default function Page() {
const { data: me } = useGetMe();
const { username } = useParams();
const { data: user } = useGetUserByName(username as string);
const isMyProf = me?.username === username;

let body = (
<Flex direction='column' gap='30px'>
<CardSkeleton borderRadius={15} width={'100%'} height={'227px'} />
<CardSkeleton borderRadius={15} width={'100%'} height={'227px'} />
</Flex>
);

if (user) {
body = (
<>
<Header />
<Flex padding='0 0 48px 0' direction='column' gap='30px'>
<Flex className={styles.profile_row} gap='30px'>
<List />
<About />
</Flex>
<Flex className={styles.profile_row} gap='30px'>
<Friends />
<Fields />
</Flex>
</Flex>
</>
);
}

return <ProfileContext.Provider value={isMyProf}> {body} </ProfileContext.Provider>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.container {

}
58 changes: 58 additions & 0 deletions client/src/app/(main)/[username]/profile/ui/about/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Card } from '../card/card';
import { Flex, Typography } from '@/shared/ui';
import { GithubIcon } from '@/shared/assets/icons/github-icon';
import { BehanceIcon } from '@/shared/assets/icons/behance';
import { TelegramIcon } from '@/shared/assets/icons/telegram';
import { LinkedinIcon } from '@/shared/assets/icons/linkedin';
import { useParams } from 'next/navigation';
import { useGetUserByName } from '../../lib/useGetUserByName';
import styles from '../../layout.module.scss';

export const About = () => {
const { username } = useParams();
const { data: user } = useGetUserByName(username as string);

const linksPresent = user?.links && Object.keys(user.links).length;
const descPresent = typeof user?.description === 'string';
return (
<Card className={styles.lg_card}>
<Flex direction='column' gap='24px' height='100%'>
<Typography size={'heading_s'} color={'greenBright'}>
About
</Typography>
{!descPresent && (
<Typography size={'body_s'} color={'greyNormal'}>
No description added.
</Typography>
)}
<Flex flex={1}>
{descPresent && <Typography size={'body_s'}>{user?.description}</Typography>}
</Flex>
{linksPresent && (
<Flex align={'center'} gap={24}>
{user?.links?.github && (
<a target='_blank' href={user.links.github}>
<GithubIcon width={28} />
</a>
)}
{user?.links?.behance && (
<a target='_blank' href={user.links.behance}>
<BehanceIcon width={28} />
</a>
)}
{user?.links?.telegram && (
<a target='_blank' href={user.links.telegram}>
<TelegramIcon width={28} />
</a>
)}
{user?.links?.linkedIn && (
<a target='_blank' href={user.links.linkedIn}>
<LinkedinIcon width={28} />
</a>
)}
</Flex>
)}
</Flex>
</Card>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.card {
background: rgba(26, 28, 34, 1);
border-radius: 15px;
overflow: hidden;
padding: 32px;
}
14 changes: 14 additions & 0 deletions client/src/app/(main)/[username]/profile/ui/card/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ReactNode } from 'react';
import styles from './card.module.scss';
import clsx from 'clsx';

interface CardProps {
children: ReactNode;
className?: string;
borderRadius?: string;
}

export const Card = ({ children, className }: CardProps) => {
const cls = clsx(styles.card, className);
return <div className={cls}>{children}</div>;
};
35 changes: 35 additions & 0 deletions client/src/app/(main)/[username]/profile/ui/fields/education.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Flex, Typography } from '@/shared/ui';
import { useParams } from 'next/navigation';
import { useGetUserByName } from '../../lib/useGetUserByName';

export const Education = () => {
const { username } = useParams();
const { data: user } = useGetUserByName(username as string);
const universities = user?.universities;
if (!universities) return <Typography>No information</Typography>;
return (
<Flex gap='24px' direction='column'>
{universities.map((education, i) => {
const start = new Date(education.admissionDate).getFullYear();
const end = education.graduationDate
? new Date(education.graduationDate).getFullYear()
: 'Present';
return (
<Flex key={i} width={'100%'} justify={'space-between'}>
<Flex gap={'8px'} direction={'column'}>
<Typography size={'body_m'}>
{education.name ?? (education as unknown as { university: string }).university}
</Typography>
<Typography color={'greyNormal'} size={'body_s'}>
{education.degree} in {education.major}
</Typography>
</Flex>
<Typography>
{start} - {end}
</Typography>
</Flex>
);
})}
</Flex>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.selected {
border-bottom: 1px solid #5bd424;
}

.field_text {
transition: 0.3s;
transition-property: color;
}

.fields_container {
min-height: 150px;
}

.nav_bar {
overflow-x: auto;
}
46 changes: 46 additions & 0 deletions client/src/app/(main)/[username]/profile/ui/fields/fields.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Card } from '../card/card';
import { Flex, Typography } from '@/shared/ui';
import { useState } from 'react';
import styles from './fields.module.scss';
import { Skills } from './skills';
import { WorkExperience } from './work-experience';
import { Education } from './education';
import layoutStyles from '../../layout.module.scss';
export const Fields = () => {
const [field, setField] = useState<keyof typeof fields>('Skills');

const fields = {
Skills: <Skills />,
Projects: null,
'Work experience': <WorkExperience />,
Education: <Education />,
Tournaments: null,
};

return (
<Card className={layoutStyles.lg_card}>
<Flex direction='column' gap='24px' className={styles.fields_container}>
<Flex className={styles.nav_bar} gap='16px'>
{Object.keys(fields).map(key => {
const classProps = field === key ? { className: styles.selected } : {};
return (
<button
onClick={() => setField(key as keyof typeof fields)}
{...classProps}
key={key}
>
<Typography
className={styles.field_text}
color={field === key ? 'greenBright' : 'greyNormal'}
>
{key}
</Typography>
</button>
);
})}
</Flex>
{fields[field]}
</Flex>
</Card>
);
};
36 changes: 36 additions & 0 deletions client/src/app/(main)/[username]/profile/ui/fields/skills.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { BadgeText, Flex, Typography } from '@/shared/ui';
import { useGetUserByName } from '../../lib/useGetUserByName';
import { useParams } from 'next/navigation';
import { BadgeIcon } from '@/shared/ui';

export const Skills = () => {
const { username } = useParams();
const { data: user } = useGetUserByName(username as string);
const skills = {
coreTools: {
badge: ({ data }: { data: string }) => <BadgeIcon data={data} isActive={true} />,
title: 'Core Tools',
},
additionalTools: {
badge: BadgeText,
title: 'Additional Tools',
},
};
return (
<Flex gap='24px' direction='column'>
{user!.skills &&
Object.entries(skills).map(skill => {
const skillName = skill[0] as keyof typeof skills;
const Badge = skills[skillName].badge;
return (
<Flex key={skillName} direction='column' gap='8px'>
<Typography>{skills[skillName].title}</Typography>
<Flex wrap='wrap' gap='8px'>
{user?.skills![skillName]?.map((lang: string) => <Badge key={lang} data={lang} />)}
</Flex>
</Flex>
);
})}
</Flex>
);
};
Loading
Loading