Skip to content

Commit

Permalink
[EN-4026] chore(inputs): updated FooterForm 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-bex committed Aug 22, 2023
1 parent 94cf5d6 commit bea60e9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
15 changes: 15 additions & 0 deletions src/components/forms/FormFooter/FormFooter.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import styled from 'styled-components';
import { COLORS } from 'src/constants/styles';

export const StyledFooterForm = styled.div`
display: flex;
flex-direction: column;
.cta-container {
padding-top: 24px;
// max-width: 440px;
Expand All @@ -19,3 +22,15 @@ export const StyledFooterForm = styled.div`
}
}
`;

export const StyledErrorMessage = styled.div`
flex: 1;
color: ${COLORS.darkOrange};
font-size: 14px;
margin-bottom: 16px;
`;

export const StyledCompulsoryMessage = styled.div`
color: ${COLORS.darkGrayFont};
font-size: 12px;
`;
21 changes: 10 additions & 11 deletions src/components/forms/FormFooter/FormFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React, { FormEvent } from 'react';
import { ButtonPost } from 'src/components/backoffice/cv/ButtonPost';
import { Button } from 'src/components/utils/Button';
import { StyledFooterForm } from './FormFooter.styles';
import {
StyledCompulsoryMessage,
StyledErrorMessage,
StyledFooterForm,
} from './FormFooter.styles';

interface FooterFormProps {
error?: string;
Expand All @@ -13,7 +17,6 @@ interface FooterFormProps {
noCompulsory?: boolean;
}

// TODO NEW STYLE
export const FormFooter = ({
error,
onSubmit,
Expand All @@ -24,17 +27,13 @@ export const FormFooter = ({
noCompulsory = false,
}: FooterFormProps) => {
return (
<StyledFooterForm className="uk-flex uk-flex-column uk-flex-left">
{error && (
<div className="uk-flex uk-flex-1">
<span className="uk-text-danger uk-margin-small-bottom">{error}</span>
</div>
)}
<StyledFooterForm>
{error && <StyledErrorMessage>{error}</StyledErrorMessage>}
<div>
{!noCompulsory && (
<div className="uk-width-auto@s uk-margin-small-bottom">
<span className="uk-text-meta">* : Mentions obligatoires</span>
</div>
<StyledCompulsoryMessage>
* : Mentions obligatoires
</StyledCompulsoryMessage>
)}

<div className="cta-container">
Expand Down

0 comments on commit bea60e9

Please sign in to comment.