| import i18next from 'i18next'; | import i18next from 'i18next'; | ||||
| import history from './store/utils/history'; | import history from './store/utils/history'; | ||||
| import AppRoutes from './AppRoutes'; | import AppRoutes from './AppRoutes'; | ||||
| import Header from './components/Header/Header'; | |||||
| const App = () => ( | const App = () => ( | ||||
| <> | <> | ||||
| {i18next.t('app.title')} | {i18next.t('app.title')} | ||||
| </title> | </title> | ||||
| </Helmet> | </Helmet> | ||||
| <Header/> | |||||
| <main className="l-page"> | <main className="l-page"> | ||||
| <AppRoutes /> | <AppRoutes /> | ||||
| </main> | </main> |
| import React, { useState, useMemo } from "react"; | import React, { useState, useMemo } from "react"; | ||||
| import { SearchInput } from "./NavbarComponent.styled"; | |||||
| import { HeaderContainer, SearchInput } from "./Header.styled"; | |||||
| import { | import { | ||||
| AppBar, | AppBar, | ||||
| Badge, | Badge, | ||||
| import Autorenew from "@mui/icons-material/Autorenew"; | import Autorenew from "@mui/icons-material/Autorenew"; | ||||
| import AccountCircle from "@mui/icons-material/PersonOutlineOutlined"; | import AccountCircle from "@mui/icons-material/PersonOutlineOutlined"; | ||||
| import SearchIcon from "@mui/icons-material/Search"; | import SearchIcon from "@mui/icons-material/Search"; | ||||
| import Drawer from "./DrawerComponent"; | |||||
| import Drawer from "../MUI/DrawerComponent"; | |||||
| import { PrimaryButton } from "../Buttons/PrimaryButton/PrimaryButton"; | import { PrimaryButton } from "../Buttons/PrimaryButton/PrimaryButton"; | ||||
| import { PRIMARY_YELLOW_COLOR } from "../../constants/stylesConstants"; | import { PRIMARY_YELLOW_COLOR } from "../../constants/stylesConstants"; | ||||
| import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants"; | import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants"; | ||||
| import { MyMessages } from "../Popovers/MyMessages/MyMessages"; | import { MyMessages } from "../Popovers/MyMessages/MyMessages"; | ||||
| import { MyProfile } from "../Popovers/MyProfile/MyProfile"; | import { MyProfile } from "../Popovers/MyProfile/MyProfile"; | ||||
| const NavbarComponent = () => { | |||||
| const Header = () => { | |||||
| const [openDrawer, setOpenDrawer] = useState(false); | const [openDrawer, setOpenDrawer] = useState(false); | ||||
| const theme = useTheme(); | const theme = useTheme(); | ||||
| const matches = useMediaQuery(theme.breakpoints.down("md")); | const matches = useMediaQuery(theme.breakpoints.down("md")); | ||||
| const drawerContent = useMemo( | const drawerContent = useMemo( | ||||
| () => ( | () => ( | ||||
| <Box | |||||
| sx={{ | |||||
| display: "flex", | |||||
| flexDirection: "column", | |||||
| justifyContent: "center", | |||||
| alignItems: "center", | |||||
| mt: 4, | |||||
| }} | |||||
| > | |||||
| <HeaderContainer> | |||||
| <PrimaryButton | <PrimaryButton | ||||
| type="submit" | type="submit" | ||||
| variant="contained" | variant="contained" | ||||
| <Typography sx={{ ml: 2 }}>Moj profil</Typography> | <Typography sx={{ ml: 2 }}>Moj profil</Typography> | ||||
| </IconButton> | </IconButton> | ||||
| </Box> | </Box> | ||||
| </Box> | |||||
| </HeaderContainer> | |||||
| ), | ), | ||||
| [handleToggleDrawer] | [handleToggleDrawer] | ||||
| ); | ); | ||||
| ); | ); | ||||
| }; | }; | ||||
| export default NavbarComponent; | |||||
| export default Header; |
| import { Box, TextField } from "@mui/material"; | |||||
| import styled from "styled-components"; | |||||
| export const SearchInput = styled(TextField)` | |||||
| margin-left: 3.8rem; | |||||
| background-color: #f4f4f4; | |||||
| width: 45%; | |||||
| max-width: 100%; | |||||
| @media (max-width: 1100px) { | |||||
| width: 36%; | |||||
| } | |||||
| @media (max-width: 900px) { | |||||
| width: 54%; | |||||
| } | |||||
| @media (max-width: 600px) { | |||||
| width: 36%; | |||||
| } | |||||
| `; | |||||
| export const HeaderContainer = styled(Box)` | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| `; |
| import React, { useState } from 'react'; | |||||
| import { Button, Divider, Paper, Typography } from '@mui/material'; | |||||
| import DialogComponent from '../DialogComponent'; | |||||
| import DrawerComponent from '../DrawerComponent'; | |||||
| import PopoverComponent from '../PopoverComponent'; | |||||
| import React from 'react'; | |||||
| // import { Button, Divider, Paper, Typography } from '@mui/material'; | |||||
| // import DialogComponent from '../DialogComponent'; | |||||
| // import DrawerComponent from '../DrawerComponent'; | |||||
| // import PopoverComponent from '../PopoverComponent'; | |||||
| const Modals = () => { | const Modals = () => { | ||||
| const [dialogOpen, setDialogOpen] = useState(false); | |||||
| const [drawerOpen, setDrawerOpen] = useState(false); | |||||
| const [popoverOpen, setPopoverOpen] = useState(false); | |||||
| const [anchorEl, setAnchorEl] = useState(null); | |||||
| // const [dialogOpen, setDialogOpen] = useState(false); | |||||
| // const [drawerOpen, setDrawerOpen] = useState(false); | |||||
| // const [popoverOpen, setPopoverOpen] = useState(false); | |||||
| // const [anchorEl, setAnchorEl] = useState(null); | |||||
| return ( | |||||
| <Paper | |||||
| sx={{ | |||||
| p: 2, | |||||
| display: 'flex', | |||||
| flexDirection: 'column', | |||||
| }} | |||||
| elevation={5} | |||||
| > | |||||
| <Typography variant="h4" gutterBottom align="center"> | |||||
| Modals Example | |||||
| </Typography> | |||||
| <Divider /> | |||||
| <Button onClick={() => setDialogOpen(true)}>Open Dialog</Button> | |||||
| <Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button> | |||||
| <Button | |||||
| onClick={(e) => { | |||||
| setPopoverOpen(true); | |||||
| setAnchorEl(e.currentTarget); | |||||
| }} | |||||
| > | |||||
| Open Popover | |||||
| </Button> | |||||
| <DialogComponent | |||||
| title="Dialog Title" | |||||
| content={<Typography>Dialog Content</Typography>} | |||||
| open={dialogOpen} | |||||
| onClose={() => setDialogOpen(false)} | |||||
| maxWidth="md" | |||||
| fullWidth | |||||
| responsive | |||||
| /> | |||||
| <DrawerComponent | |||||
| anchor="left" | |||||
| content={<Typography sx={{ p: 2 }}>Drawer Content</Typography>} | |||||
| open={drawerOpen} | |||||
| toggleOpen={() => setDrawerOpen(!drawerOpen)} | |||||
| /> | |||||
| <PopoverComponent | |||||
| anchorEl={anchorEl} | |||||
| open={popoverOpen} | |||||
| onClose={() => { | |||||
| setPopoverOpen(false); | |||||
| setAnchorEl(null); | |||||
| }} | |||||
| content={<Typography sx={{ p: 2 }}>Popover Content</Typography>} | |||||
| /> | |||||
| </Paper> | |||||
| return (<></> | |||||
| // <Paper | |||||
| // sx={{ | |||||
| // p: 2, | |||||
| // display: 'flex', | |||||
| // flexDirection: 'column', | |||||
| // }} | |||||
| // elevation={5} | |||||
| // > | |||||
| // <Typography variant="h4" gutterBottom align="center"> | |||||
| // Modals Example | |||||
| // </Typography> | |||||
| // <Divider /> | |||||
| // <Button onClick={() => setDialogOpen(true)}>Open Dialog</Button> | |||||
| // <Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button> | |||||
| // <Button | |||||
| // onClick={(e) => { | |||||
| // setPopoverOpen(true); | |||||
| // setAnchorEl(e.currentTarget); | |||||
| // }} | |||||
| // > | |||||
| // Open Popover | |||||
| // </Button> | |||||
| // <DialogComponent | |||||
| // title="Dialog Title" | |||||
| // content={<Typography>Dialog Content</Typography>} | |||||
| // open={dialogOpen} | |||||
| // onClose={() => setDialogOpen(false)} | |||||
| // maxWidth="md" | |||||
| // fullWidth | |||||
| // responsive | |||||
| // /> | |||||
| // <DrawerComponent | |||||
| // anchor="left" | |||||
| // content={<Typography sx={{ p: 2 }}>Drawer Content</Typography>} | |||||
| // open={drawerOpen} | |||||
| // toggleOpen={() => setDrawerOpen(!drawerOpen)} | |||||
| // /> | |||||
| // <PopoverComponent | |||||
| // anchorEl={anchorEl} | |||||
| // open={popoverOpen} | |||||
| // onClose={() => { | |||||
| // setPopoverOpen(false); | |||||
| // setAnchorEl(null); | |||||
| // }} | |||||
| // content={<Typography sx={{ p: 2 }}>Popover Content</Typography>} | |||||
| // /> | |||||
| // </Paper> | |||||
| ); | ); | ||||
| }; | }; | ||||
| import { TextField } from "@mui/material"; | |||||
| import styled from "styled-components"; | |||||
| export const SearchInput = styled(TextField)` | |||||
| margin-left: 3.8rem; | |||||
| background-color: #F4F4F4; | |||||
| width: 45%; | |||||
| max-width: 100%; | |||||
| @media (max-width: 1100px) { | |||||
| width: 36%; | |||||
| } | |||||
| @media (max-width: 900px) { | |||||
| width: 54%; | |||||
| } | |||||
| @media (max-width: 600px) { | |||||
| width: 36%; | |||||
| } | |||||
| ` |
| import React from 'react'; | import React from 'react'; | ||||
| import { Box } from '@mui/material'; | import { Box } from '@mui/material'; | ||||
| import Navbar from '../../components/MUI/NavbarComponent'; | |||||
| import Modals from '../../components/MUI/Examples/ModalsExample'; | import Modals from '../../components/MUI/Examples/ModalsExample'; | ||||
| import DataGrid from '../../components/MUI/Examples/DataGridExample'; | import DataGrid from '../../components/MUI/Examples/DataGridExample'; | ||||
| import PagingSortingFiltering from '../../components/MUI/Examples/PagingSortingFilteringExample'; | import PagingSortingFiltering from '../../components/MUI/Examples/PagingSortingFilteringExample'; | ||||
| const HomePage = () => { | const HomePage = () => { | ||||
| return ( | return ( | ||||
| <> | <> | ||||
| <Navbar /> | |||||
| <Box sx={{ backgroundColor: '#f4f4f4', pt: 14, px: 4 }}> | <Box sx={{ backgroundColor: '#f4f4f4', pt: 14, px: 4 }}> | ||||
| <GridStyled container spacing={2} justifyContent="center"> | <GridStyled container spacing={2} justifyContent="center"> | ||||
| <GridStyled item xs={12} md={3}> | <GridStyled item xs={12} md={3}> |