Djordje Mitrovic преди 3 години
родител
ревизия
a13eb545c4
променени са 25 файла, в които са добавени 167 реда и са изтрити 55 реда
  1. 3
    3
      src/components/Buttons/IconButton/IconButton.js
  2. 1
    1
      src/components/Buttons/IconButton/IconButton.styled.js
  3. 3
    3
      src/components/Buttons/LoginButton/LoginButton.js
  4. 1
    1
      src/components/Buttons/LoginButton/LoginButton.styled.js
  5. 3
    3
      src/components/Buttons/PrimaryButton/PrimaryButton.js
  6. 6
    5
      src/components/Buttons/PrimaryButton/PrimaryButton.styled.js
  7. 3
    3
      src/components/Buttons/PrimaryButtonWithIcon/PrimaryButtonWithIcon.js
  8. 1
    1
      src/components/Buttons/PrimaryButtonWithIcon/PrimaryButtonWithIcon.styled.js
  9. 5
    6
      src/components/CheckBox/CheckBox.js
  10. 1
    1
      src/components/CheckBox/CheckBox.styled.js
  11. 3
    3
      src/components/CheckBox/Label.js
  12. 1
    1
      src/components/CheckBox/Label.styled.js
  13. 3
    3
      src/components/Dropdown/DropdownItem/DropdownItem.js
  14. 1
    1
      src/components/Dropdown/DropdownItem/DropdownItem.styled.js
  15. 3
    3
      src/components/Dropdown/DropdownList/DropdownList.js
  16. 4
    4
      src/components/Dropdown/DropdownList/DropdownList.styled.js
  17. 3
    3
      src/components/Icon/Icon.js
  18. 1
    1
      src/components/Icon/Icon.styled.js
  19. 3
    3
      src/components/TextFields/TextField/TextField.js
  20. 1
    1
      src/components/TextFields/TextField/TextField.styled.js
  21. 3
    3
      src/components/TextFields/TextFieldWithIcon/TextFieldWithIcon.js
  22. 1
    1
      src/components/TextFields/TextFieldWithIcon/TextFieldWithIcon.styled.js
  23. 89
    1
      src/pages/LoginPage/LoginPageMUI.js
  24. 14
    0
      src/themes/index.js
  25. 10
    0
      src/themes/primaryTheme/primaryThemeColors.js

+ 3
- 3
src/components/Buttons/IconButton/IconButton.js Целия файл

@@ -1,13 +1,13 @@
import React from 'react'
import { ComponentContainer, IconButtonStyled } from "./IconButton.styled"
import { IconButtonContainer, IconButtonStyled } from "./IconButton.styled"
import PropTypes from "prop-types";

export const IconButton = (props) => {
return <ComponentContainer style={props.containerStyle} className={props.className}>
return <IconButtonContainer style={props.containerStyle} className={props.className}>
<IconButtonStyled onClick={props.onClick} sx={props.style}>
{props.children}
</IconButtonStyled>
</ComponentContainer>
</IconButtonContainer>
}

IconButton.propTypes = {

+ 1
- 1
src/components/Buttons/IconButton/IconButton.styled.js Целия файл

@@ -1,7 +1,7 @@
import { Box, IconButton } from "@mui/material";
import styled from "styled-components";

export const ComponentContainer = styled(Box)`
export const IconButtonContainer = styled(Box)`
`

export const IconButtonStyled = styled(IconButton)`

+ 3
- 3
src/components/Buttons/LoginButton/LoginButton.js Целия файл

@@ -1,16 +1,16 @@
import React from "react";
import { ComponentContainer, LoginButtonStyled } from "./LoginButton.styled";
import { LoginButtonContainer, LoginButtonStyled } from "./LoginButton.styled";
import PropTypes from "prop-types";


//Currently not in use
export const LoginButton = (props) => {
return (
<ComponentContainer style={props.containerStyle}>
<LoginButtonContainer style={props.containerStyle}>
<LoginButtonStyled {...props} sx={props.style} variant="contained">
Dugme
</LoginButtonStyled>
</ComponentContainer>
</LoginButtonContainer>
);
};


+ 1
- 1
src/components/Buttons/LoginButton/LoginButton.styled.js Целия файл

@@ -2,7 +2,7 @@ import { Box, Button } from "@mui/material";
import styled from "styled-components";


export const ComponentContainer = styled(Box)`
export const LoginButtonContainer = styled(Box)`
`

export const LoginButtonStyled = styled(Button)`

+ 3
- 3
src/components/Buttons/PrimaryButton/PrimaryButton.js Целия файл

@@ -1,18 +1,18 @@
import React from "react";
import PropTypes from "prop-types";
import {
ComponentContainer,
PrimaryButtonContainer,
PrimaryButtonStyled,
} from "./PrimaryButton.styled";

export const PrimaryButton = (props) => {
return (
<ComponentContainer style={props.containerStyle} className={props.className}>
<PrimaryButtonContainer style={props.containerStyle} className={props.className}>
<PrimaryButtonStyled {...props} sx={props.style}>
{props.children}
</PrimaryButtonStyled>
</ComponentContainer>
</PrimaryButtonContainer>
);
};


+ 6
- 5
src/components/Buttons/PrimaryButton/PrimaryButton.styled.js Целия файл

@@ -1,15 +1,15 @@
import { Box, Button } from "@mui/material";
import styled from "styled-components";
import { PRIMARY_PURPLE_DISABLED, PRIMARY_TEXT_DISABLED_COLOR } from "../../../constants/stylesConstants";
import selectedTheme from "../../../themes";

export const ComponentContainer = styled(Box)``;
export const PrimaryButtonContainer = styled(Box)``;

export const PrimaryButtonStyled = styled(Button)`
background-color: ${(props) => props.disabled ? PRIMARY_PURPLE_DISABLED : (
background-color: ${(props) => props.disabled ? selectedTheme.primaryPurpleDisabled: (
props.variant === "contained" ? props.buttoncolor : "transparent")} !important;
border-color: ${(props) =>
props.variant === "outlined" ? props.buttoncolor : "transparent"};
color: ${(props) => props.disabled ? PRIMARY_TEXT_DISABLED_COLOR : (
color: ${(props) => props.disabled ? selectedTheme.primaryTextDisabled : (
props.textcolor)} !important;
box-shadow: 0 0 0 0;
font-size: 12px;
@@ -25,6 +25,7 @@ export const PrimaryButtonStyled = styled(Button)`
box-shadow: 0 0 0 0;
}
&:disabled {
background-color: ${PRIMARY_PURPLE_DISABLED};
background-color: ${selectedTheme.primaryPurpleDisabled};
color: ${(props) => props.textcolor};
}
`;

+ 3
- 3
src/components/Buttons/PrimaryButtonWithIcon/PrimaryButtonWithIcon.js Целия файл

@@ -1,14 +1,14 @@
import React from "react";
import PropTypes from "prop-types";
import {
ComponentContainer,
PrimaryButtonWithIconContainer,
IconStyled,
PrimaryButtonWithIconStyled,
} from "./PrimaryButtonWithIcon.styled";

const PrimaryButtonWithIcon = (props) => {
return (
<ComponentContainer
<PrimaryButtonWithIconContainer
style={props.containerStyle}
className={props.className}
>
@@ -16,7 +16,7 @@ const PrimaryButtonWithIcon = (props) => {
<IconStyled style={props.iconStyle}>{props.icon}</IconStyled>
{props.children}
</PrimaryButtonWithIconStyled>
</ComponentContainer>
</PrimaryButtonWithIconContainer>
);
};


+ 1
- 1
src/components/Buttons/PrimaryButtonWithIcon/PrimaryButtonWithIcon.styled.js Целия файл

@@ -3,7 +3,7 @@ import styled from "styled-components";
import { Icon } from "../../Icon/Icon";
import { PrimaryButton } from "../PrimaryButton/PrimaryButton";

export const ComponentContainer = styled(Box)``;
export const PrimaryButtonWithIconContainer = styled(Box)``;

export const PrimaryButtonWithIconStyled = styled(PrimaryButton)`
position: relative;

+ 5
- 6
src/components/CheckBox/CheckBox.js Целия файл

@@ -1,13 +1,12 @@
import React, { useState } from "react";
import {
CheckBoxStyled,
ComponentContainer,
CheckBoxContainer,
FormControlLabelStyled,
} from "./CheckBox.styled";
import PropTypes from "prop-types";
import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants";
// import { FormControlLabel } from "@mui/material";
import { Label } from "./Label";
import selectedTheme from "../../themes";

export const CheckBox = (props) => {
const [checked, setChecked] = useState(false);
@@ -18,7 +17,7 @@ export const CheckBox = (props) => {
};

return (
<ComponentContainer
<CheckBoxContainer
style={props.containerStyle}
fullWidth={props.fullWidth}
className={props.className}
@@ -43,7 +42,7 @@ export const CheckBox = (props) => {
/>
}
/>
</ComponentContainer>
</CheckBoxContainer>
);
};

@@ -63,5 +62,5 @@ CheckBox.propTypes = {
};

CheckBox.defaultProps = {
color: PRIMARY_PURPLE_COLOR,
color: selectedTheme.primaryPurple,
};

+ 1
- 1
src/components/CheckBox/CheckBox.styled.js Целия файл

@@ -1,7 +1,7 @@
import { Box, Checkbox, FormControlLabel } from "@mui/material";
import styled from "styled-components";

export const ComponentContainer = styled(Box)`
export const CheckBoxContainer = styled(Box)`
${props => props.fullWidth && (`
width: 100%;
display: flex;

+ 3
- 3
src/components/CheckBox/Label.js Целия файл

@@ -1,13 +1,13 @@
import React from "react";
import { ComponentContainer, LeftLabel, RightLabel } from "./Label.styled";
import { LabelContainer, LeftLabel, RightLabel } from "./Label.styled";
import PropTypes from "prop-types";

export const Label = (props) => {
return (
<ComponentContainer onClick={props.onClick} maxWidth={props.maxWidth}>
<LabelContainer onClick={props.onClick} maxWidth={props.maxWidth}>
<LeftLabel>{props.leftText}</LeftLabel>
{props.rightText && <RightLabel>{props.rightText}</RightLabel>}
</ComponentContainer>
</LabelContainer>
);
};


+ 1
- 1
src/components/CheckBox/Label.styled.js Целия файл

@@ -1,7 +1,7 @@
import { Box, FormLabel } from "@mui/material";
import styled from "styled-components";

export const ComponentContainer = styled(Box)`
export const LabelContainer = styled(Box)`
display: flex;
flex: 1;
justify-content: space-between;

+ 3
- 3
src/components/Dropdown/DropdownItem/DropdownItem.js Целия файл

@@ -1,14 +1,14 @@
import React from 'react'
import PropTypes from 'prop-types'
import { ComponentContainer, DropdownItemStyled } from './DropdownItem.styled'
import { DropdownItemContainer, DropdownItemStyled } from './DropdownItem.styled'

const DropdownItem = (props) => {
return (
<ComponentContainer onClick={props.onClick}>
<DropdownItemContainer onClick={props.onClick}>
<DropdownItemStyled>
{props.children}
</DropdownItemStyled>
</ComponentContainer>
</DropdownItemContainer>
)
}


+ 1
- 1
src/components/Dropdown/DropdownItem/DropdownItem.styled.js Целия файл

@@ -1,7 +1,7 @@
import { Box } from "@mui/material";
import styled from "styled-components";

export const ComponentContainer = styled(Box)`
export const DropdownItemContainer = styled(Box)`
`

export const DropdownItemStyled = styled(Box)`

+ 3
- 3
src/components/Dropdown/DropdownList/DropdownList.js Целия файл

@@ -1,6 +1,6 @@
import React, { useState } from "react";
import {
ComponentContainer,
DropdownListContainer,
DropdownHeader,
DropdownIcon,
DropdownTitle,
@@ -13,7 +13,7 @@ import PropTypes from "prop-types";
const DropdownList = (props) => {
const [listShown, setListShown] = useState(props.defaultOpen);
return (
<ComponentContainer fullWidth={props.fullWidth}>
<DropdownListContainer fullWidth={props.fullWidth}>
<DropdownHeader>
{props.dropdownIcon && (
<DropdownIcon>{props.dropdownIcon}</DropdownIcon>
@@ -37,7 +37,7 @@ const DropdownList = (props) => {
</DropdownHeader>

<ListContainer shouldShow={listShown}>{props.children}</ListContainer>
</ComponentContainer>
</DropdownListContainer>
);
};


+ 4
- 4
src/components/Dropdown/DropdownList/DropdownList.styled.js Целия файл

@@ -1,9 +1,9 @@
import { Box, Typography } from "@mui/material";
import styled from "styled-components";
import { PRIMARY_PURPLE_COLOR } from "../../../constants/stylesConstants";
import selectedTheme from "../../../themes";
import { Icon } from "../../Icon/Icon";

export const ComponentContainer = styled(Box)`
export const DropdownListContainer = styled(Box)`

width: ${props => props.fullWidth ? '100%' : (props.width ? props.width : '250px')};
padding: 8px;
@@ -21,12 +21,12 @@ export const DropdownTitle = styled(Typography)`

export const ToggleIconOpened = styled(Icon)`
cursor: pointer;
color: ${PRIMARY_PURPLE_COLOR};
color: ${selectedTheme.primaryPurple};
`

export const ToggleIconClosed = styled(Icon)`
cursor: pointer;
color: ${PRIMARY_PURPLE_COLOR};
color: ${selectedTheme.primaryPurple};
`

export const DropdownIcon = styled(Icon)`

+ 3
- 3
src/components/Icon/Icon.js Целия файл

@@ -1,15 +1,15 @@
import React from 'react';
import { ComponentContainer, IconStyled } from './Icon.styled';
import { IconContainer, IconStyled } from './Icon.styled';
import PropTypes from "prop-types";


export const Icon = (props) => {
return (
<ComponentContainer style={props.containerStyle} className={props.className} onClick={props.onClick}>
<IconContainer style={props.containerStyle} className={props.className} onClick={props.onClick}>
<IconStyled sx={props.style} color={props.color} size={props.size} fontSize={props.iconsize}>
{props.children}
</IconStyled>
</ComponentContainer>
</IconContainer>
)
}


+ 1
- 1
src/components/Icon/Icon.styled.js Целия файл

@@ -1,7 +1,7 @@
import { Box, Icon } from "@mui/material";
import styled from "styled-components";

export const ComponentContainer = styled(Box)`
export const IconContainer = styled(Box)`
`

export const IconStyled = styled(Icon)`

+ 3
- 3
src/components/TextFields/TextField/TextField.js Целия файл

@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { ComponentContainer, TextFieldStyled } from "./TextField.styled";
import { TextFieldContainer, TextFieldStyled } from "./TextField.styled";
import PropTypes from "prop-types";

export const TextField = (props) => {
@@ -15,7 +15,7 @@ export const TextField = (props) => {
}, [props.value]);

return (
<ComponentContainer style={props.containerStyle} className={props.className}>
<TextFieldContainer style={props.containerStyle} className={props.className}>
<TextFieldStyled
placeholder={props.placeholder}
width={props.width}
@@ -37,7 +37,7 @@ export const TextField = (props) => {
>
{props.children}
</TextFieldStyled>
</ComponentContainer>
</TextFieldContainer>
);
};


+ 1
- 1
src/components/TextFields/TextField/TextField.styled.js Целия файл

@@ -2,7 +2,7 @@ import { Box, TextField } from "@mui/material";
import styled from "styled-components";
import { PRIMARY_BACKGROUND_COLOR } from "../../../constants/stylesConstants";

export const ComponentContainer = styled(Box)`
export const TextFieldContainer = styled(Box)`
width: 100%;
height: 48px;
box-sizing: border-box;

+ 3
- 3
src/components/TextFields/TextFieldWithIcon/TextFieldWithIcon.js Целия файл

@@ -1,18 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ComponentContainer, IconStyled, TextFieldStyled } from './TextFieldWithIcon.styled';
import { TextFieldWithIconContainer, IconStyled, TextFieldStyled } from './TextFieldWithIcon.styled';
import { Visibility } from '@mui/icons-material';

const TextFieldWithIcon = (props) => {
return (
<ComponentContainer>
<TextFieldWithIconContainer>
<TextFieldStyled {...props.textFieldProps}>
<IconStyled color="green">
<Visibility color="green"/>
</IconStyled>
{props.children}
</TextFieldStyled>
</ComponentContainer>
</TextFieldWithIconContainer>
)
}


+ 1
- 1
src/components/TextFields/TextFieldWithIcon/TextFieldWithIcon.styled.js Целия файл

@@ -3,7 +3,7 @@ import styled from "styled-components";
import { Icon } from "../../Icon/Icon";
import { TextField } from "../TextField/TextField";

export const ComponentContainer = styled(Box)`
export const TextFieldWithIconContainer = styled(Box)`
`

export const TextFieldStyled = styled(TextField)`

+ 89
- 1
src/pages/LoginPage/LoginPageMUI.js Целия файл

@@ -19,8 +19,8 @@ import { selectIsLoadingByActionType } from "../../store/selectors/loadingSelect
import { LOGIN_USER_LOADING } from "../../store/actions/login/loginActionConstants";
import { TextField } from "../../components/TextFields/TextField/TextField";
import { PrimaryButton } from "../../components/Buttons/PrimaryButton/PrimaryButton";
import { PRIMARY_PURPLE_COLOR } from "../../constants/stylesConstants";
import { IconButton } from "../../components/Buttons/IconButton/IconButton";
<<<<<<< HEAD
import Link from "../../components/Link/Link";
import { ReactComponent as Logo } from "../../assets/images/svg/logo-vertical.svg";
import {
@@ -31,6 +31,15 @@ import {
RegisterAltText,
RegisterTextContainer,
} from "./Login.styled";
=======
import { Icon } from "../../components/Icon/Icon";
import PrimaryButtonWithIcon from "../../components/Buttons/PrimaryButtonWithIcon/PrimaryButtonWithIcon";
import TextFieldWithIcon from "../../components/TextFields/TextFieldWithIcon/TextFieldWithIcon";
import DropdownList from "../../components/Dropdown/DropdownList/DropdownList";
import DropdownItem from "../../components/Dropdown/DropdownItem/DropdownItem";
import { CheckBox } from "../../components/CheckBox/CheckBox";
import selectedTheme from "../../themes";
>>>>>>> 0ab484f415ede89d54c28a177d12f746fce4da4c

const LoginPage = ({ history }) => {
const dispatch = useDispatch();
@@ -148,6 +157,7 @@ const LoginPage = ({ history }) => {
align="right"
style={{ marginTop: "18px", marginBottom: "18px" }}
>
<<<<<<< HEAD
{t("login.forgotYourPassword")}
</Link>

@@ -177,6 +187,84 @@ const LoginPage = ({ history }) => {
component={NavLink}
underline="hover"
align="center"
=======
<Backdrop position="absolute" isLoading={isLoading} />
<TextField
name="username"
placeholder={t("common.labelUsername")}
margin="normal"
value={formik.values.username}
onChange={formik.handleChange}
error={formik.touched.username && Boolean(formik.errors.username)}
helperText={formik.touched.username && formik.errors.username}
autoFocus
fullWidth
/>
<TextField
name="password"
placeholder={t("common.labelPassword")}
margin="normal"
type={showPassword ? "text" : "password"}
value={formik.values.password}
onChange={formik.handleChange}
error={formik.touched.password && Boolean(formik.errors.password)}
helperText={formik.touched.password && formik.errors.password}
fullWidth
InputProps={{
endAdornment: (
<IconButton
onClick={handleClickShowPassword}
onMouseDown={handleMouseDownPassword}
>
{showPassword ? <Visibility /> : <VisibilityOff />}
</IconButton>
),
}}
/>

<DropdownList
title="Naslov"
toggleIconOpened={<Visibility />}
toggleIconClosed={<VisibilityOff />}
dropdownIcon={<LocationOnOutlined />}
fullWidth
defaultOpen={false}
>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
<DropdownItem>
<CheckBox fullWidth leftText="Kategorija" rightText="124" />
</DropdownItem>
</DropdownList>

<PrimaryButtonWithIcon
icon={<Visibility />}
sx={{ mt: 3, mb: 2 }}
buttonProps={{
type: "submit",
variant: "contained",
height: "40px",
fullWidth: true,
buttoncolor: selectedTheme.primaryPurple,
textcolor: "white",
}}
>>>>>>> 0ab484f415ede89d54c28a177d12f746fce4da4c
>
{t("login.signUp")}
</Link>

+ 14
- 0
src/themes/index.js Целия файл

@@ -0,0 +1,14 @@
import { primaryThemeColors } from "./primaryTheme/primaryThemeColors";

let selectedThemeNumber = 0;

const getTheme = () => {
if (selectedThemeNumber === 0) {
return {...primaryThemeColors}
}
}

const selectedTheme = getTheme();

export default selectedTheme;


+ 10
- 0
src/themes/primaryTheme/primaryThemeColors.js Целия файл

@@ -0,0 +1,10 @@
export const primaryThemeColors = {
primaryPurple: "#5A3984",
primaryYellow: "#f7b126",
primaryPurpleDisabled: "#4D4D4D",
primaryBackgroundColor: "#F1F1F1",
primaryTextDisabled: "#F1F1F1",
primaryText: "#4D4D4D",
primaryGrayText: "#818181",
primaryDarkGrayText: "#DCDCDC"
}

Loading…
Отказ
Запис