Skip to content

Commit

Permalink
feat: link to each page
Browse files Browse the repository at this point in the history
  • Loading branch information
healim01 committed Jan 9, 2024
1 parent 5fe4037 commit 6bd1657
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/layouts/dashboard/dept-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default function DeptHeaderButton() {
</Avatar>
{option.deptName}

{option.deptMemberResponse[0].deptRole === 'Admin' ? (
{option.deptMemberResponse[0].deptRole === 'ADMIN' ? (
<Avatar
alt="A"
color="primary.pale"
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/dashboard/nav-vertical.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function NavVertical({ openNav, onCloseNav }: Props) {
<Box style={{ height: '10px' }} />

{typeof userDeptInfo === 'object' &&
userDeptInfo.deptMemberResponse[0].deptRole === 'Admin' ? (
userDeptInfo.deptMemberResponse[0].deptRole === 'ADMIN' ? (
<NavSectionVertical
data={navData}
config={{
Expand Down
19 changes: 12 additions & 7 deletions src/sections/dashboard/admin-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { useState } from 'react';
import { Link } from 'react-router-dom';
import { paths } from 'src/routes/paths';
import styled from 'styled-components';
import { userDeptState } from 'src/utils/atom';
import { useRecoilValue } from 'recoil';
import AnalyticsWidgetSummary from './analytics-widget-summary';
import { UserCalendarView } from './calendar/view';
// import AdminCalendarView from './calendar/view/admin-calendar-view';
Expand All @@ -30,6 +32,12 @@ export default function AdminDashboardView() {
const settings = useSettingsContext();
const theme = useTheme();

const userDeptInfo = useRecoilValue(userDeptState);
let url = '';
if (typeof userDeptInfo === 'object') {
url = userDeptInfo.link ?? '';
}

const rangeCalendarPicker = useDateRangePicker(new Date(), null);
const [value, setValue] = useState<Date | null>(new Date());

Expand Down Expand Up @@ -57,7 +65,7 @@ export default function AdminDashboardView() {
{/* 분석 카드 4개 */}
<Grid container spacing={3}>
<Grid xs={12} sm={6} md={3}>
<StyledLink to={paths.dept.reservelist('CSEE')}>
<StyledLink to={paths.dept.reservelist(url)}>
<AnalyticsWidgetSummary
title="미승인 예약"
total={210}
Expand All @@ -68,7 +76,7 @@ export default function AdminDashboardView() {
</Grid>

<Grid xs={12} sm={6} md={3}>
<StyledLink to={paths.dept.reservelist('CSEE')}>
<StyledLink to={paths.dept.management.manageUser(url)}>
<AnalyticsWidgetSummary
title="미승인 대기 유저"
total={13}
Expand All @@ -79,7 +87,7 @@ export default function AdminDashboardView() {
</Grid>

<Grid xs={12} sm={6} md={3}>
<StyledLink to={paths.dept.reservelist('CSEE')}>
<StyledLink to={paths.dept.reservelist(url)}>
<AnalyticsWidgetSummary
title="오늘 예정된 예약"
total={17}
Expand All @@ -90,7 +98,7 @@ export default function AdminDashboardView() {
</Grid>

<Grid xs={12} sm={6} md={3}>
<StyledLink to={paths.dept.reservelist('CSEE')}>
<StyledLink to={paths.dept.reservelist(url)}>
<AnalyticsWidgetSummary
title="전체 예약"
total={234}
Expand All @@ -106,9 +114,6 @@ export default function AdminDashboardView() {
{/* <AdminCalendarView /> */}
</Grid>
</Grid>

{/* </DemoItem> */}
{/* </Box> */}
</Container>
);
}

0 comments on commit 6bd1657

Please sign in to comment.