Parcourir la source

Finished feature 694

feature/694
djordjemitrovic00 il y a 3 ans
Parent
révision
08390b3b34

+ 1
- 4
src/AppRoutes.js Voir le fichier

<AdminRoute path={ADMIN_HOME_PAGE} component={AdminHomePage} /> <AdminRoute path={ADMIN_HOME_PAGE} component={AdminHomePage} />
<Route path={NOT_FOUND_PAGE} component={NotFoundPage} /> <Route path={NOT_FOUND_PAGE} component={NotFoundPage} />
<Route path={ERROR_PAGE} component={ErrorPage} /> <Route path={ERROR_PAGE} component={ErrorPage} />
<AuthRoute
path={REGISTER_SUCCESSFUL_PAGE}
component={RegisterSuccessful}
/>
<Route path={REGISTER_SUCCESSFUL_PAGE} component={RegisterSuccessful} />
<AuthRoute path={REGISTER_PAGE} component={Register} /> <AuthRoute path={REGISTER_PAGE} component={Register} />
<AuthRoute path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} /> <AuthRoute path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} />
<AuthRoute path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} /> <AuthRoute path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} />

+ 3
- 3
src/components/Cards/ProfileCard/SkeletonProfileCard/SkeletonProfileCard.styled.js Voir le fichier

import { Box } from "@mui/material"; import { Box } from "@mui/material";
import styled, { keyframes } from "styled-components"; import styled, { keyframes } from "styled-components";
import selectedTheme from "../../../../themes"; import selectedTheme from "../../../../themes";
const skeletonBackgroundAnimation = keyframes`
const skeletonAnimation = keyframes`
0% { 0% {
opacity: 1; opacity: 1;
} }


export const SkeletonItemBackgroundColor = styled(Box)` export const SkeletonItemBackgroundColor = styled(Box)`
background-color: ${selectedTheme.colors.filterSkeletonItems}; background-color: ${selectedTheme.colors.filterSkeletonItems};
animation: ${skeletonBackgroundAnimation} 1.2s infinite;
animation: ${skeletonAnimation} 1.2s infinite;
`; `;
export const SkeletonBackgroundColor = styled(Box)` export const SkeletonBackgroundColor = styled(Box)`
background-color: ${selectedTheme.colors.filterSkeletonBackground}; background-color: ${selectedTheme.colors.filterSkeletonBackground};
animation: ${skeletonBackgroundAnimation} 1.2s infinite;
animation: ${skeletonAnimation} 1.2s infinite;
`; `;


export const SkeletonProfileCardContainer = styled(Box)` export const SkeletonProfileCardContainer = styled(Box)`

+ 22
- 0
src/components/Styles/globalStyleComponents.js Voir le fichier

background-color: ${selectedTheme.colors.filterSkeletonItems}; background-color: ${selectedTheme.colors.filterSkeletonItems};
} }
`; `;
export const ButtonLoadingAnimation = keyframes`
0% {
background-color: ${selectedTheme.colors.primaryPurple};
}
50% {
background-color: ${selectedTheme.colors.primaryPurpleAnimation};
}
100% {
background-color: ${selectedTheme.colors.primaryPurple};
}
`
export const ButtonLoadingEllipseAnimation = keyframes`
0% {
left: -24px;
}
50% {
left: calc(100% + 24px);
}
100% {
left: -48px;
}
`


export const BackgroundTransition = styled(Box)` export const BackgroundTransition = styled(Box)`
border-radius: 4px; border-radius: 4px;

+ 5
- 1
src/pages/RegisterPages/Register/Register.js Voir le fichier

import FirstPartOfRegistration from "./FirstPart/FirstPartOfRegistration"; import FirstPartOfRegistration from "./FirstPart/FirstPartOfRegistration";
import SecondPartOfRegistration from "./SecondPart/SecondPartOfRegistration"; import SecondPartOfRegistration from "./SecondPart/SecondPartOfRegistration";
import ThirdPartOfRegistration from "./ThirdPart/ThirdPartOfRegistration"; import ThirdPartOfRegistration from "./ThirdPart/ThirdPartOfRegistration";
import { useDispatch } from "react-redux";
import { useDispatch, useSelector } from "react-redux";
import { fetchRegisterUser } from "../../../store/actions/register/registerActions"; import { fetchRegisterUser } from "../../../store/actions/register/registerActions";
import { makeErrorToastMessage } from "../../../store/utils/makeToastMessage"; import { makeErrorToastMessage } from "../../../store/utils/makeToastMessage";
import { selectIsLoadingByActionType } from "../../../store/selectors/loadingSelectors";
import { REGISTER_USER_SCOPE } from "../../../store/actions/register/registerActionConstants";


const Register = () => { const Register = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const [PIBError, setPIBError] = useState(""); // Wrong PIB typed const [PIBError, setPIBError] = useState(""); // Wrong PIB typed
const [PIBErrorMessage, setPIBErrorMessage] = useState(""); // Error message caused by typing wrong PIB const [PIBErrorMessage, setPIBErrorMessage] = useState(""); // Error message caused by typing wrong PIB
const [imageError, setImageError] = useState(false); // Not picked image const [imageError, setImageError] = useState(false); // Not picked image
const isLoadingRegister = useSelector(selectIsLoadingByActionType(REGISTER_USER_SCOPE));


const handleResponseSuccess = () => { const handleResponseSuccess = () => {
history.push(REGISTER_SUCCESSFUL_PAGE); history.push(REGISTER_SUCCESSFUL_PAGE);
<ThirdPartOfRegistration <ThirdPartOfRegistration
handleSubmit={handleSubmit} handleSubmit={handleSubmit}
informations={informations} informations={informations}
isLoading={isLoadingRegister}
/> />
)} )}



+ 5
- 5
src/pages/RegisterPages/Register/ThirdPart/ThirdPartOfRegistration.js Voir le fichier

import React, { useEffect } from "react"; import React, { useEffect } from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { import {
FinishRegistrationButton,
FormContainer, FormContainer,
RegisterDescription, RegisterDescription,
} from "./ThirdPartOfRegistration.styled"; } from "./ThirdPartOfRegistration.styled";
import { useFormik } from "formik"; import { useFormik } from "formik";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { TextField } from "../../../../components/TextFields/TextField/TextField"; import { TextField } from "../../../../components/TextFields/TextField/TextField";
import { PrimaryButton } from "../../../../components/Buttons/PrimaryButton/PrimaryButton";
import selectedTheme from "../../../../themes";
import AutoSuggestTextField from "../../../../components/TextFields/AutoSuggestTextField/AutoSuggestTextField"; import AutoSuggestTextField from "../../../../components/TextFields/AutoSuggestTextField/AutoSuggestTextField";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { selectLocations } from "../../../../store/selectors/locationsSelectors"; import { selectLocations } from "../../../../store/selectors/locationsSelectors";


<ErrorMessage formik={formik} /> <ErrorMessage formik={formik} />


<PrimaryButton
<FinishRegistrationButton
type="submit" type="submit"
variant="contained" variant="contained"
height="48px" height="48px"
fullWidth fullWidth
buttoncolor={selectedTheme.colors.primaryPurple}
textcolor="white" textcolor="white"
isLoading={props.isLoading}
> >
{t("common.continue")} {t("common.continue")}
</PrimaryButton>
</FinishRegistrationButton>
</FormContainer> </FormContainer>
); );
}; };
children: PropTypes.node, children: PropTypes.node,
handleSubmit: PropTypes.func, handleSubmit: PropTypes.func,
informations: PropTypes.any, informations: PropTypes.any,
isLoading: PropTypes.bool,
}; };


export default ThirdPartOfRegistration; export default ThirdPartOfRegistration;

+ 36
- 2
src/pages/RegisterPages/Register/ThirdPart/ThirdPartOfRegistration.styled.js Voir le fichier

import { Typography } from "@mui/material";
import styled from "styled-components";
import { Typography } from "@mui/material";
import styled, { css } from "styled-components";
import { PrimaryButton } from "../../../../components/Buttons/PrimaryButton/PrimaryButton";
import {
ButtonLoadingAnimation,
ButtonLoadingEllipseAnimation,
} from "../../../../components/Styles/globalStyleComponents";
import selectedTheme from "../../../../themes"; import selectedTheme from "../../../../themes";


export const FormContainer = styled.form` export const FormContainer = styled.form`
margin-top: 14px; margin-top: 14px;
} }
`; `;
export const FinishRegistrationButton = styled(PrimaryButton)`
${props => props.isLoading && css`
cursor: default;
`}
& button {
position: relative;
/* background-color: green !important; */
animation: ${(props) =>
props.isLoading
? css`
${ButtonLoadingAnimation} 2.2s infinite;
`
: ""};
/* animation: ${ButtonLoadingAnimation} 2s infinite; */
}
${props => props.isLoading && css`
& button::after {
content: "";
width: 47px;
height: 96px;
background-color: green;
position: absolute;
top: -24px;
background-color: ${selectedTheme.colors.borderSponsoredColor};
filter: blur(45px);
animation: ${ButtonLoadingEllipseAnimation} 2.2s infinite;
}
`}
`;

+ 6
- 2
src/pages/RegisterPages/RegisterSuccessful.js/RegisterSuccessful.js Voir le fichier

import React, { useEffect } from "react";
import React from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { import {
RegisterSuccessfulContainer, RegisterSuccessfulContainer,
import { HOME_PAGE } from "../../../constants/pages"; import { HOME_PAGE } from "../../../constants/pages";
import RegisterRiv from "../../../assets/animations/register.riv"; import RegisterRiv from "../../../assets/animations/register.riv";
import { useRive } from "rive-react"; import { useRive } from "rive-react";
import { useEffect } from "react";


const RegisterSuccessful = () => { const RegisterSuccessful = () => {
const { t } = useTranslation(); const { t } = useTranslation();


return ( return (
<RegisterSuccessfulContainer> <RegisterSuccessfulContainer>
<RiveComponent />
<RiveComponent style={{
width: "500px",
height: "500px"
}}/>


<RegisterTitle component="h1" variant="h5"> <RegisterTitle component="h1" variant="h5">
{t("register.success")} {t("register.success")}

+ 1
- 1
src/pages/RegisterPages/RegisterSuccessful.js/RegisterSuccessful.styled.js Voir le fichier

import selectedTheme from "../../../themes"; import selectedTheme from "../../../themes";


export const RegisterSuccessfulContainer = styled(Container)` export const RegisterSuccessfulContainer = styled(Container)`
margin-top: 300px;
margin-top: 150px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

+ 1
- 1
src/store/actions/register/registerActionConstants.js Voir le fichier

createSuccessType, createSuccessType,
} from "../actionHelpers"; } from "../actionHelpers";


const REGISTER_USER_SCOPE = "REGISTER_USER";
export const REGISTER_USER_SCOPE = "REGISTER_USER";
export const REGISTER_USER_FETCH = createFetchType(REGISTER_USER_SCOPE); export const REGISTER_USER_FETCH = createFetchType(REGISTER_USER_SCOPE);
export const REGISTER_USER_FETCH_ERROR = createErrorType(REGISTER_USER_SCOPE); export const REGISTER_USER_FETCH_ERROR = createErrorType(REGISTER_USER_SCOPE);
export const REGISTER_USER_FETCH_SUCCESS = export const REGISTER_USER_FETCH_SUCCESS =

+ 1
- 0
src/themes/primaryTheme/primaryThemeColors.js Voir le fichier

export const primaryThemeColors = { export const primaryThemeColors = {
primaryPurple: "#5A3984", primaryPurple: "#5A3984",
primaryPurpleAnimation: "#4B2C73",
primaryYellow: "#f7b126", primaryYellow: "#f7b126",
primaryPurpleDisabled: "#4D4D4D", primaryPurpleDisabled: "#4D4D4D",
primaryBackgroundColor: "#F1F1F1", primaryBackgroundColor: "#F1F1F1",

Chargement…
Annuler
Enregistrer