Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate to notifications page on "New/Open" IconButton click #310

Merged
Merged
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion JeMPI_Apps/JeMPI_UI/src/components/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Box,
Container,
Grid,
IconButton,
Stack,
Tab,
Tabs,
Expand All @@ -21,6 +22,7 @@ import ConfusionMatrix from './widgets/ConfusionMatrixWidget'
import { useState } from 'react'
import { ImportProcessWidget } from './widgets/ImportProcessWidget'
import { useDashboardData } from 'hooks/useDashboardData'
import { useNavigate } from 'react-router-dom'
interface TabPanelProps {
children?: React.ReactNode
index: number
Expand Down Expand Up @@ -53,6 +55,8 @@ const tabProps = (index: number) => {
const Dashboard = () => {
const dashboardData = useDashboardData()
const [currentTabIndex, setCurrentTabIndex] = useState(0)

const navigate = useNavigate()
const handleChangeTab = (event: React.SyntheticEvent, newValue: number) => {
setCurrentTabIndex(newValue)
}
Expand Down Expand Up @@ -146,7 +150,19 @@ const Dashboard = () => {
: 0
}
icon={
<NotificationAdd sx={{ fontSize: '3.5rem' }} />
<IconButton
onClick={() => {
navigate('/notifications')
}}
sx={{
backgroundColor: '#76ff03',
'&:hover': {
backgroundColor: '#64dd17'
}
}}
>
<NotificationAdd sx={{ fontSize: '3.5rem' }} />
</IconButton>
MatthewErispe marked this conversation as resolved.
Show resolved Hide resolved
}
iconBackgroundColor={'#76ff03'}
/>
Expand Down
Loading