| "react-scripts": "5.0.1", | "react-scripts": "5.0.1", | ||||
| "react-toastify": "^9.1.2", | "react-toastify": "^9.1.2", | ||||
| "redux-persist": "^6.0.0", | "redux-persist": "^6.0.0", | ||||
| "styled-components": "^5.3.11", | |||||
| "web-vitals": "^2.1.4", | "web-vitals": "^2.1.4", | ||||
| "yup": "^1.1.1" | "yup": "^1.1.1" | ||||
| }, | }, |
| import { StyledEngineProvider } from "@mui/material"; | import { StyledEngineProvider } from "@mui/material"; | ||||
| import { authScopeStringGetHelper } from "util/authScopeHelpers"; | import { authScopeStringGetHelper } from "util/authScopeHelpers"; | ||||
| import { LANGUAGE } from "constants/localStorage"; | import { LANGUAGE } from "constants/localStorage"; | ||||
| import Header from "components/Header/Header"; | |||||
| // import { HOME_PAGE } from "constants/pages"; | // import { HOME_PAGE } from "constants/pages"; | ||||
| // import { useSelector } from "react-redux"; | // import { useSelector } from "react-redux"; | ||||
| // import { selectCurrentToken } from "features/auth/authSlice"; | // import { selectCurrentToken } from "features/auth/authSlice"; | ||||
| </Helmet> | </Helmet> | ||||
| <StyledEngineProvider injectFirst> | <StyledEngineProvider injectFirst> | ||||
| <ToastContainer bodyClassName="ToastBody" /> | <ToastContainer bodyClassName="ToastBody" /> | ||||
| <Header /> | |||||
| <AppRoutes /> | <AppRoutes /> | ||||
| </StyledEngineProvider> | </StyledEngineProvider> | ||||
| </> | </> |
| import React from "react"; | |||||
| import PropTypes from "prop-types"; | |||||
| import { HeaderContainer } from "./Header.styled"; | |||||
| const Header = () => { | |||||
| return ( | |||||
| <HeaderContainer> | |||||
| <div>nesto</div> | |||||
| <div>brate</div> | |||||
| </HeaderContainer> | |||||
| ); | |||||
| }; | |||||
| Header.propTypes = { | |||||
| children: PropTypes.node, | |||||
| }; | |||||
| export default Header; |
| import { Box } from "@mui/material"; | |||||
| import styled from "styled-components"; | |||||
| import selectedTheme from "themes"; | |||||
| export const HeaderContainer = styled(Box)` | |||||
| display: flex; | |||||
| justify-content: space-between; | |||||
| align-items: center; | |||||
| padding: 0 148px; | |||||
| width: 100vw; | |||||
| height: 72px; | |||||
| background-color: ${selectedTheme.colors.primaryLight}; | |||||
| `; |
| import { Box } from "@mui/material"; | |||||
| import styled from "styled-components"; | |||||
| export const HeaderNavigationContainer = styled(Box)` | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| align-items: center; | |||||
| gap: 16px; | |||||
| ` |
| import React from "react"; | |||||
| import PropTypes from "prop-types"; | |||||
| import { | |||||
| HeaderNavigationItemContainer, | |||||
| HeaderNavigationItemIconContainer, | |||||
| HeaderNavigationItemIconTitle, | |||||
| } from "./HeaderNavigationItem.styled"; | |||||
| const HeaderNavigationItem = (props) => { | |||||
| return ( | |||||
| <HeaderNavigationItemContainer> | |||||
| {props?.route?.icon && ( | |||||
| <HeaderNavigationItemIconContainer> | |||||
| {props?.route?.icon} | |||||
| </HeaderNavigationItemIconContainer> | |||||
| )} | |||||
| <HeaderNavigationItemIconTitle> | |||||
| {props?.route?.title} | |||||
| </HeaderNavigationItemIconTitle> | |||||
| </HeaderNavigationItemContainer> | |||||
| ); | |||||
| }; | |||||
| HeaderNavigationItem.propTypes = { | |||||
| route: PropTypes.shape({ | |||||
| icon: PropTypes.oneOfType([PropTypes.node, PropTypes.element]), | |||||
| title: PropTypes.string, | |||||
| subroutes: PropTypes.array, | |||||
| }), | |||||
| }; | |||||
| export default HeaderNavigationItem; |
| import { Box } from "@mui/material"; | |||||
| import styled from "styled-components"; | |||||
| export const HeaderNavigationItemContainer = styled(Box)` | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| width: fit-content; | |||||
| padding: 2px 6px; | |||||
| `; | |||||
| export const HeaderNavigationItemIconContainer = styled(Box)``; | |||||
| export const HeaderNavigationItemIconTitle = styled(Box)` | |||||
| font-size: 14px; | |||||
| line-height: 20px; | |||||
| font-weight: ${(props) => props?.$isActive && 600}; | |||||
| `; |
| import i18n from "i18n"; | |||||
| export const BASE_PAGE = "/"; | export const BASE_PAGE = "/"; | ||||
| export const LOGIN_PAGE = "/login"; | export const LOGIN_PAGE = "/login"; | ||||
| export const REGISTER_PAGE = "/register"; | export const REGISTER_PAGE = "/register"; | ||||
| export const ERROR_PAGE = "/error-page"; | export const ERROR_PAGE = "/error-page"; | ||||
| export const NOT_FOUND_PAGE = "/not-found"; | export const NOT_FOUND_PAGE = "/not-found"; | ||||
| export const AUTH_CALLBACK_PAGE = "/api/auth/:provider/callback"; | export const AUTH_CALLBACK_PAGE = "/api/auth/:provider/callback"; | ||||
| export default [ | |||||
| { title: i18n.t("pages.home"), route: BASE_PAGE }, | |||||
| { title: i18n.t("pages.login"), route: LOGIN_PAGE }, | |||||
| { title: i18n.t("pages.register"), route: REGISTER_PAGE }, | |||||
| { title: i18n.t("pages.forgotPassword"), route: FORGOT_PASSWORD_PAGE }, | |||||
| { title: i18n.t("pages.home"), route: HOME_PAGE }, | |||||
| { title: i18n.t("pages.error"), route: ERROR_PAGE }, | |||||
| { title: i18n.t("pages.notFound"), route: NOT_FOUND_PAGE }, | |||||
| ]; |
| range: "{{start}} to {{end}}", | range: "{{start}} to {{end}}", | ||||
| }, | }, | ||||
| }, | }, | ||||
| pages: { | |||||
| home: "Početna", | |||||
| login: "Login", | |||||
| register: "Register", | |||||
| forgotPassword: "Zaboravljena lozinka", | |||||
| error: "Pogrešna stranica", | |||||
| notFound: "Nije pronađena stranica" | |||||
| }, | |||||
| register: { | register: { | ||||
| registerTitle: "Register", | registerTitle: "Register", | ||||
| usernameRequired: "Username is required.", | usernameRequired: "Username is required.", |