mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Use NavLink
This commit is contained in:
1 parent
16623e98e0
commit
a27de26ef0
2 files changed
+5
-5
No files matched your search
+1
-2
@@ -42,7 +42,6 @@ InjectDebugData([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
function Phone() {
|
function Phone() {
|
||||||
const history = useHistory();
|
|
||||||
const quickAccess = useQuickAccess();
|
const quickAccess = useQuickAccess();
|
||||||
useNuiService();
|
useNuiService();
|
||||||
usePhoneService();
|
usePhoneService();
|
||||||
@@ -109,7 +108,7 @@ function Phone() {
|
|||||||
icon: (
|
icon: (
|
||||||
<NotificationIcon
|
<NotificationIcon
|
||||||
icon={qa.notificationIcon}
|
icon={qa.notificationIcon}
|
||||||
onClick={() => history.push(qa.path)}
|
to={qa.path}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}))}
|
}))}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { IconButton } from '@material-ui/core';
|
import { IconButton } from '@material-ui/core';
|
||||||
|
import { NavLink } from 'react-router-dom';
|
||||||
|
|
||||||
interface INotificationIcon {
|
interface INotificationIcon {
|
||||||
icon: JSX.Element;
|
icon: JSX.Element;
|
||||||
onClick(e: any): void;
|
to: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotificationIcon = ({ icon, onClick }: INotificationIcon) => {
|
export const NotificationIcon = ({ icon, to }: INotificationIcon) => {
|
||||||
return (
|
return (
|
||||||
<IconButton size="small" onClick={onClick}>
|
<IconButton component={NavLink} to={to} size="small">
|
||||||
{icon}
|
{icon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user