forked from module-federation/module-federation-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRTLNavbarLinks.js
More file actions
162 lines (157 loc) · 5.35 KB
/
RTLNavbarLinks.js
File metadata and controls
162 lines (157 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import React from "react";
import classNames from "classnames";
// @material-ui/core components
import { makeStyles } from "@material-ui/core/styles";
import MenuItem from "@material-ui/core/MenuItem";
import MenuList from "@material-ui/core/MenuList";
import Grow from "@material-ui/core/Grow";
import Paper from "@material-ui/core/Paper";
import ClickAwayListener from "@material-ui/core/ClickAwayListener";
import Hidden from "@material-ui/core/Hidden";
import Poppers from "@material-ui/core/Popper";
// @material-ui/icons
import Person from "@material-ui/icons/Person";
import Notifications from "@material-ui/icons/Notifications";
import Dashboard from "@material-ui/icons/Dashboard";
import Search from "@material-ui/icons/Search";
// core components
import CustomInput from "components/CustomInput/CustomInput.js";
import Button from "components/CustomButtons/Button.js";
import styles from "../../assets/jss/material-dashboard-react/components/rtlHeaderLinksStyle.js";
const useStyles = makeStyles(styles);
export default function RTLNavbarLinks() {
const classes = useStyles();
const [open, setOpen] = React.useState(null);
const handleToggle = (event) => {
if (open && open.contains(event.target)) {
setOpen(null);
} else {
setOpen(event.currentTarget);
}
};
const handleClose = () => {
setOpen(null);
};
return (
<div>
<div className={classes.searchWrapper}>
<CustomInput
formControlProps={{
className: classes.margin + " " + classes.search,
}}
inputProps={{
placeholder: "جستجو...",
inputProps: {
"aria-label": "Search",
},
}}
/>
<Button color="white" aria-label="edit" justIcon round>
<Search />
</Button>
</div>
<Button
color={window.innerWidth > 959 ? "transparent" : "white"}
justIcon={window.innerWidth > 959}
simple={!(window.innerWidth > 959)}
aria-label="Dashboard"
className={classes.buttonLink}
>
<Dashboard className={classes.icons} />
<Hidden mdUp implementation="css">
<p className={classes.linkText}>آمارها</p>
</Hidden>
</Button>
<div className={classes.manager}>
<Button
color={window.innerWidth > 959 ? "transparent" : "white"}
justIcon={window.innerWidth > 959}
simple={!(window.innerWidth > 959)}
aria-owns={open ? "menu-list-grow" : null}
aria-haspopup="true"
onClick={handleToggle}
className={classes.buttonLink}
>
<Notifications className={classes.icons} />
<span className={classes.notifications}>۵</span>
<Hidden mdUp implementation="css">
<p onClick={handleToggle} className={classes.linkText}>
اعلانها
</p>
</Hidden>
</Button>
<Poppers
open={Boolean(open)}
anchorEl={open}
transition
disablePortal
className={
classNames({ [classes.popperClose]: !open }) +
" " +
classes.popperNav
}
>
{({ TransitionProps, placement }) => (
<Grow
{...TransitionProps}
id="menu-list-grow"
style={{
transformOrigin:
placement === "bottom" ? "center top" : "center bottom",
}}
>
<Paper>
<ClickAwayListener onClickAway={handleClose}>
<MenuList role="menu">
<MenuItem
onClick={handleClose}
className={classes.dropdownItem}
>
محمدرضا به ایمیل شما پاسخ داد
</MenuItem>
<MenuItem
onClick={handleClose}
className={classes.dropdownItem}
>
شما ۵ وظیفه جدید دارید
</MenuItem>
<MenuItem
onClick={handleClose}
className={classes.dropdownItem}
>
از حالا شما با علیرضا دوست هستید
</MenuItem>
<MenuItem
onClick={handleClose}
className={classes.dropdownItem}
>
اعلان دیگر
</MenuItem>
<MenuItem
onClick={handleClose}
className={classes.dropdownItem}
>
اعلان دیگر
</MenuItem>
</MenuList>
</ClickAwayListener>
</Paper>
</Grow>
)}
</Poppers>
</div>
<Button
color={window.innerWidth > 959 ? "transparent" : "white"}
justIcon={window.innerWidth > 959}
simple={!(window.innerWidth > 959)}
aria-label="Person"
className={classes.buttonLink}
>
<Person className={classes.icons} />
<Hidden mdUp implementation="css">
<p className={classes.linkText}>حساب کاربری</p>
</Hidden>
</Button>
</div>
);
}