This repository has been archived by the owner on Jan 7, 2025. 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.
Merge branch 'dev' into feature/permission-service
- Loading branch information
Showing
77 changed files
with
610 additions
and
430 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
src/components/common/layout/admin-panel-layout/AdminPanelLayout.styles.ts
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 @@ | ||
import { SxProps, Theme } from '@mui/material/styles'; | ||
|
||
export const layoutWrapper: SxProps<Theme> = { | ||
width: '100%', | ||
}; | ||
|
||
export const mainContent: SxProps<Theme> = { | ||
marginLeft: '240px', | ||
}; |
23 changes: 23 additions & 0 deletions
23
src/components/common/layout/admin-panel-layout/AdminPanelLayout.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,23 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { Box } from '@mui/material'; | ||
|
||
import AdminPanel from '@/components/common/layout/admin-panel/AdminPanel'; | ||
|
||
import * as styles from './AdminPanelLayout.styles'; | ||
|
||
interface AdminPanelLayoutProps { | ||
children?: ReactNode; | ||
} | ||
|
||
const AdminPanelLayout: React.FC<AdminPanelLayoutProps> = ({ | ||
children, | ||
}: AdminPanelLayoutProps) => { | ||
return ( | ||
<Box sx={styles.layoutWrapper}> | ||
<AdminPanel /> | ||
<Box sx={styles.mainContent}>{children}</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default AdminPanelLayout; |
53 changes: 53 additions & 0 deletions
53
src/components/common/layout/admin-panel/AdminPanel.styles.ts
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,53 @@ | ||
import { SxProps, Theme } from '@mui/material/styles'; | ||
import { alpha } from '@mui/system'; | ||
|
||
import { BASE_URL } from '@/components/common/layout/admin-panel/constants'; | ||
import theme from '@/styles/theme'; | ||
|
||
export const drawer: SxProps<Theme> = { | ||
'& .MuiDrawer-paper': { | ||
width: '240px', | ||
border: 'none', | ||
backgroundColor: alpha(theme.palette.grey[50], 0.62), | ||
}, | ||
}; | ||
|
||
export const tabList: SxProps<Theme> = { | ||
color: 'grey.800', | ||
padding: '8px 16px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '6px', | ||
}; | ||
|
||
export const tab = ( | ||
index: number, | ||
link: string, | ||
currentPath: string, | ||
): SxProps<Theme> => ({ | ||
width: index === 10 || index === 11 ? '194px' : '208px', | ||
marginLeft: index === 10 || index === 11 ? '14px' : 0, | ||
backgroundColor: | ||
link === currentPath ? 'backgroundDark.200' : 'backgroundDark.100', | ||
height: '40px', | ||
padding: '8px 16px', | ||
display: 'flex', | ||
gap: '8px', | ||
borderRadius: '4px', | ||
'&:hover': { | ||
backgroundColor: 'backgroundDark.200', | ||
}, | ||
}); | ||
|
||
export const tabIcon: SxProps<Theme> = { | ||
width: '24px', | ||
}; | ||
|
||
export const tabText: SxProps<Theme> = { | ||
typography: 'body2Medium', | ||
}; | ||
|
||
export const pollPartHeader: SxProps<Theme> = { | ||
typography: 'body2Medium', | ||
padding: '4px 0 0', | ||
}; |
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,43 @@ | ||
import { Box, Drawer, Typography } from '@mui/material'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import { useRouter } from 'next/router'; | ||
|
||
import * as styles from './AdminPanel.styles'; | ||
import { adminPanelTabs } from './constants'; | ||
|
||
const AdminPanel = () => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<Drawer anchor="left" variant="permanent" sx={styles.drawer}> | ||
<Link href="/"> | ||
<Image | ||
src={'/icons/logo.svg'} | ||
alt="FA logo" | ||
width={197} | ||
height={28} | ||
style={{ | ||
margin: '16px 21px', | ||
}} | ||
/> | ||
</Link> | ||
<Box sx={styles.tabList}> | ||
{adminPanelTabs.map((tab, index) => { | ||
return typeof tab !== 'string' ? ( | ||
<Link href={tab.link}> | ||
<Box sx={styles.tab(index, tab.link, router.pathname)}> | ||
<Box sx={styles.tabIcon}>{tab.icon}</Box> | ||
<Typography sx={styles.tabText}>{tab.text}</Typography> | ||
</Box> | ||
</Link> | ||
) : ( | ||
<Typography sx={styles.pollPartHeader}>{tab}</Typography> | ||
); | ||
})} | ||
</Box> | ||
</Drawer> | ||
); | ||
}; | ||
|
||
export default AdminPanel; |
82 changes: 82 additions & 0 deletions
82
src/components/common/layout/admin-panel/constants/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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { | ||
AcademicCapIcon, | ||
BriefcaseIcon, | ||
BuildingLibraryIcon, | ||
CalendarIcon, | ||
ClipboardDocumentListIcon, | ||
HomeIcon, | ||
IdentificationIcon, | ||
NewspaperIcon, | ||
PencilSquareIcon, | ||
UserCircleIcon, | ||
UserGroupIcon, | ||
} from '@heroicons/react/24/outline'; | ||
|
||
import { Captain } from '@/components/common/icons/Captain'; | ||
|
||
export const BASE_URL = '/admin'; | ||
|
||
export const adminPanelTabs = [ | ||
{ | ||
link: BASE_URL + '/roles', | ||
text: 'Ролі', | ||
icon: <Captain />, | ||
}, | ||
|
||
{ | ||
link: BASE_URL + '/users', | ||
text: 'Користувачі', | ||
icon: <UserCircleIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/students', | ||
text: 'Студенти', | ||
icon: <IdentificationIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/groups', | ||
text: 'Групи', | ||
icon: <UserGroupIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/departments', | ||
text: 'Кафедри', | ||
icon: <BuildingLibraryIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/teachers', | ||
text: 'Викладачі', | ||
icon: <BriefcaseIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/disciplines', | ||
text: 'Дисципліни', | ||
icon: <NewspaperIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/subjects', | ||
text: 'Предмети', | ||
icon: <AcademicCapIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/', | ||
text: 'Розклад', | ||
icon: <CalendarIcon />, | ||
}, | ||
'Опитування', | ||
{ | ||
link: BASE_URL + '/', | ||
text: 'База питань', | ||
icon: <PencilSquareIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/', | ||
text: 'База відповідей', | ||
icon: <ClipboardDocumentListIcon />, | ||
}, | ||
{ | ||
link: BASE_URL + '/', | ||
text: 'Головна сторінка', | ||
icon: <HomeIcon />, | ||
}, | ||
]; |
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
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
Oops, something went wrong.