feat: favicon and title modified
This commit is contained in:
parent
bed59eb1b6
commit
f6b693aa4f
3 changed files with 20 additions and 3 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>campaign</title>
|
<title>وینسو</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 2 KiB |
|
|
@ -1,9 +1,16 @@
|
||||||
import { ReactNode } from 'react'
|
import { ReactNode, useEffect } from 'react'
|
||||||
import { Navigate } from 'react-router-dom'
|
import { Navigate } from 'react-router-dom'
|
||||||
import { getUserRole, UserRole } from '../utils/role'
|
import { getUserRole, UserRole } from '../utils/role'
|
||||||
|
|
||||||
export default function RequireRole({ role, children }: { role: UserRole; children: ReactNode }) {
|
export default function RequireRole({ role, children }: { role: UserRole; children: ReactNode }) {
|
||||||
const userRole = getUserRole()
|
const userRole = getUserRole()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = role === "customer"
|
||||||
|
? "پنل رزرو"
|
||||||
|
: "پنل میزبان";
|
||||||
|
}, [role]);
|
||||||
|
|
||||||
if (userRole !== role) {
|
if (userRole !== role) {
|
||||||
return <Navigate to={userRole === 'cafe_owner' ? '/cafe/login' : '/login'} replace />
|
return <Navigate to={userRole === 'cafe_owner' ? '/cafe/login' : '/login'} replace />
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue