|
| 1 | +import styled from '@emotion/styled' |
| 2 | +import Button from '@mui/material/Button' |
| 3 | +import AddIcon from '@mui/icons-material/Add' |
| 4 | +import Avatar from '@mui/material/Avatar' |
| 5 | +import { blockBorderWidthPx, leftSideWidthPx } from '../../constant' |
| 6 | +import { VerticalLine } from '../../../../shared/ui/Line' |
| 7 | + |
| 8 | +export function Header() { |
| 9 | + return ( |
| 10 | + <TopBlock> |
| 11 | + <HeaderSideBlock> |
| 12 | + <WorkTaskLogo /> |
| 13 | + </HeaderSideBlock> |
| 14 | + <VerticalLine size={blockBorderWidthPx} /> |
| 15 | + <HeaderMainBlock> |
| 16 | + <CreateNewTaskButton /> |
| 17 | + <ProjectName>WorkTask</ProjectName> |
| 18 | + <Spacer /> |
| 19 | + <UserProfile /> |
| 20 | + </HeaderMainBlock> |
| 21 | + </TopBlock> |
| 22 | + ) |
| 23 | +} |
| 24 | + |
| 25 | +// в будущем перенесем скорее всего отсюда |
| 26 | +function WorkTaskLogo() { |
| 27 | + return ( |
| 28 | + <div |
| 29 | + style={{ |
| 30 | + color: 'rgba(98, 0, 255, 1)', |
| 31 | + fontSize: '35px', |
| 32 | + fontWeight: 200, |
| 33 | + }} |
| 34 | + > |
| 35 | + WorkTask |
| 36 | + </div> |
| 37 | + ) |
| 38 | +} |
| 39 | + |
| 40 | +const TopBlock = styled.header` |
| 41 | + height: 120px; |
| 42 | + width: 100%; |
| 43 | + display: flex; |
| 44 | +` |
| 45 | + |
| 46 | +const HeaderSideBlock = styled.div` |
| 47 | + width: ${leftSideWidthPx}; |
| 48 | + flex-shrink: 0; |
| 49 | + display: flex; |
| 50 | + justify-content: center; |
| 51 | + align-items: center; |
| 52 | +
|
| 53 | + background-color: rgba(224, 228, 234, 1); |
| 54 | +` |
| 55 | +const HeaderMainBlock = styled.div` |
| 56 | + flex-grow: 1; |
| 57 | + display: flex; |
| 58 | + align-items: center; |
| 59 | + width: 100%; |
| 60 | + padding-left: 60px; |
| 61 | + padding-right: 20px; |
| 62 | + gap: 16px; |
| 63 | +
|
| 64 | + background-color: rgba(224, 228, 234, 1); |
| 65 | +` |
| 66 | + |
| 67 | +const Spacer = styled.div` |
| 68 | + flex-grow: 1; |
| 69 | +` |
| 70 | +// в будущем перенесем скорее всего отсюда |
| 71 | +function CreateNewTaskButton() { |
| 72 | + return ( |
| 73 | + <PurpleButton variant="contained" startIcon={<AddIcon />}> |
| 74 | + New task |
| 75 | + </PurpleButton> |
| 76 | + ) |
| 77 | +} |
| 78 | + |
| 79 | +const ProjectName = styled.div` |
| 80 | + color: 'rgba(13, 6, 45, 1)'; |
| 81 | + font-size: 35px; |
| 82 | + font-weight: 500; |
| 83 | +` |
| 84 | + |
| 85 | +interface UserProfileProps { |
| 86 | + className?: string |
| 87 | +} |
| 88 | + |
| 89 | +// в будущем перенесем скорее всего отсюда |
| 90 | +function UserProfile({ className }: UserProfileProps) { |
| 91 | + return ( |
| 92 | + <Avatar |
| 93 | + className={className} |
| 94 | + sx={{ bgcolor: 'rgba(98, 0, 255, 1)' }} |
| 95 | + alt="Grigorii Veinin" |
| 96 | + > |
| 97 | + GV |
| 98 | + </Avatar> |
| 99 | + ) |
| 100 | +} |
| 101 | + |
| 102 | +const PurpleButton = styled(Button)({ |
| 103 | + backgroundColor: 'rgba(80, 48, 229, 0.73)', |
| 104 | + borderColor: 'rgba(80, 48, 229, 0.73)', |
| 105 | +}) |
0 commit comments