This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
-
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.
feat: мобильная версия страницы проектов (#30)
Co-authored-by: Ruslan Kutliakhmetov <[email protected]>
- Loading branch information
1 parent
a109158
commit 6129db9
Showing
16 changed files
with
116 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Avatar, AvatarGroup } from '@chakra-ui/react'; | ||
|
||
interface Avatar { | ||
firstName: string; | ||
lastName: string; | ||
img: string; | ||
} | ||
|
||
interface AvatarProps { | ||
avatars: Avatar[]; | ||
} | ||
|
||
export const AvatarsGroup = ({ avatars }: AvatarProps) => { | ||
return ( | ||
<AvatarGroup spacing={'-2'} size={'sm'} max={3}> | ||
{avatars.map(({ firstName, lastName, img }) => ( | ||
<Avatar key={firstName} name={`${firstName} ${lastName}`} w={7} h={7} src={img} /> | ||
))} | ||
</AvatarGroup> | ||
); | ||
}; |
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 @@ | ||
export * from './AvatarsGroup'; |
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 +1,2 @@ | ||
export * from './card'; | ||
export * from './avatars-group'; |
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,17 @@ | ||
import { Icon, IconButton } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
import { BsPlusCircleFill } from 'react-icons/bs'; | ||
|
||
export const AddProject = () => { | ||
return ( | ||
<IconButton | ||
variant="flat" | ||
aria-label="add-project" | ||
icon={ | ||
<> | ||
<Icon as={BsPlusCircleFill} /> | ||
</> | ||
} | ||
/> | ||
); | ||
}; |
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 @@ | ||
export * from './AddProject'; |
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 * from './filter-project'; | ||
export * from './search-project'; | ||
export * from './add-project'; | ||
export * from './status'; |
File renamed without changes.
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 @@ | ||
export * from './ui'; |
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,45 @@ | ||
import { Flex } from '@chakra-ui/react'; | ||
|
||
import { data } from '~/pages/data'; | ||
|
||
import { ProjectCard } from '~/widgets/project-card'; | ||
|
||
import { AddProject } from '~/features/project'; | ||
|
||
import { AvatarsGroup } from '~/entities/project'; | ||
|
||
import { STag } from '~/shared/ui/STag'; | ||
import { SText } from '~/shared/ui/SText'; | ||
|
||
export const ProjectPage = () => { | ||
const dummyAvatars = [ | ||
{ firstName: 'Alex', lastName: 'Gordon', img: 'https://bit.ly/ryan-florence' }, | ||
{ firstName: 'Игорь', lastName: 'Крутой', img: 'https://bit.ly/sage-adebayo' }, | ||
{ firstName: 'Джек', lastName: 'Воробей', img: 'https://bit.ly/kent-c-dodds' }, | ||
{ firstName: 'Кларк', lastName: 'Кент', img: 'https://bit.ly/prosper-baba' }, | ||
{ firstName: 'Джеймс', lastName: 'Бонд', img: 'https://bit.ly/code-beast' }, | ||
{ firstName: 'Бернд', lastName: 'Шнайдер', img: 'https://bit.ly/dan-abramov' }, | ||
]; | ||
return ( | ||
<> | ||
<Flex alignContent="center" flexDirection="column" justifyContent="space-between"> | ||
<Flex justifyContent="space-between" alignItems="center" mb={6}> | ||
<SText variant="h1">Проекты</SText> | ||
<Flex gap={4} alignItems="baseline"> | ||
<AddProject /> | ||
</Flex> | ||
</Flex> | ||
{data.map((project) => { | ||
return ( | ||
<ProjectCard key={project.id} {...project}> | ||
<Flex justifyContent="space-between" alignItems="center"> | ||
<STag mainTags={['Организатор']} /> | ||
<AvatarsGroup avatars={dummyAvatars} /> | ||
</Flex> | ||
</ProjectCard> | ||
); | ||
})} | ||
</Flex> | ||
</> | ||
); | ||
}; |
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 @@ | ||
export * from './ProjectPage'; |
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