Skip to content

Commit

Permalink
fix/cv
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulEntourage committed Sep 22, 2023
1 parent 5a06136 commit cbea19f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 31 deletions.
18 changes: 18 additions & 0 deletions src/components/backoffice/cv/CVEditPage/CVEditPage.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,22 @@ export const StyledCVEditButtonsContainer = styled.div`
flex-direction: row;
align-items: center;
column-gap: 20px;
row-gap: 20px;
flex-wrap: wrap;
&.mobile {
width: 100%;
flex-direction: column;
align-items: flex-start;
margin-top: 20px;
}
`;

export const StyledCVEditStatusVersion = styled.div``;

export const StyledCVNav = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
flex-wrap: wrap;
`;
24 changes: 15 additions & 9 deletions src/components/backoffice/cv/CVEditPage/CVEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Api } from 'src/api';
import { CV, User } from 'src/api/types';
import { openModal } from 'src/components/modals/Modal';
import { ModalConfirm } from 'src/components/modals/Modal/ModalGeneric/ModalConfirm';
import { Button, ButtonIcon, Grid } from 'src/components/utils';
import { Button, ButtonIcon } from 'src/components/utils';
import { ButtonPost } from 'src/components/utils/Button/ButtonPost';
import { CV_STATUS, SOCKETS } from 'src/constants';
import { GA_TAGS } from 'src/constants/tags';
Expand All @@ -15,12 +15,16 @@ import {
COACH_USER_ROLES,
USER_ROLES,
} from 'src/constants/users';
import { usePrevious } from 'src/hooks/utils';
import { useIsDesktop, usePrevious } from 'src/hooks/utils';
import { gaEvent } from 'src/lib/gtag';
import { UserContext } from 'src/store/UserProvider';
import { isRoleIncluded } from 'src/utils/Finding';
import { ButtonDownload } from './ButtonDownload';
import { StyledCVEditButtonsContainer } from './CVEditPage.styles';
import {
StyledCVEditButtonsContainer,
StyledCVEditStatusVersion,
StyledCVNav,
} from './CVEditPage.styles';
import { CVFicheEdition } from './CVFicheEdition';
import { CVModalPreview } from './CVModalPreview';
import { NoCV } from './NoCV';
Expand All @@ -42,6 +46,8 @@ export const CVEditPage = ({ candidateId, cv, setCV }: CVEditPageProps) => {
const [previewGenerating, setPreviewGenerating] = useState(false);
const [pdfGenerating, setPdfGenerating] = useState(false);

const isDesktop = useIsDesktop();

const { user } = useContext<{ user: User }>(UserContext);

const prevCV = usePrevious(cv);
Expand Down Expand Up @@ -289,8 +295,8 @@ export const CVEditPage = ({ candidateId, cv, setCV }: CVEditPageProps) => {
// affichage du CV
return (
<div>
<Grid between middle>
<Grid column gap="collapse">
<StyledCVNav className={isDesktop ? '' : 'mobile'}>
<StyledCVEditStatusVersion>
<div>
Statut&nbsp;:{' '}
<span className={`uk-text-${cvStatus.style}`}>
Expand All @@ -303,8 +309,8 @@ export const CVEditPage = ({ candidateId, cv, setCV }: CVEditPageProps) => {
{cvVersion}
</div>
)}
</Grid>
<StyledCVEditButtonsContainer>
</StyledCVEditStatusVersion>
<StyledCVEditButtonsContainer className={isDesktop ? '' : 'mobile'}>
<ButtonDownload
pdfGenerating={pdfGenerating}
candidateId={cv.UserId}
Expand Down Expand Up @@ -344,7 +350,7 @@ export const CVEditPage = ({ candidateId, cv, setCV }: CVEditPageProps) => {
text="Publier"
/>
)}
{user.role === USER_ROLES.ADMIN && (
{user.role !== USER_ROLES.ADMIN && (
<ButtonIcon
name="question"
href={process.env.TUTORIAL_CV}
Expand All @@ -355,7 +361,7 @@ export const CVEditPage = ({ candidateId, cv, setCV }: CVEditPageProps) => {
/>
)}
</StyledCVEditButtonsContainer>
</Grid>
</StyledCVNav>
<CVFicheEdition
email={cv.user?.candidat.email}
phone={cv.user?.candidat.phone}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
import styled from 'styled-components';

export const StyledEditPicture = styled.div`
box-sizing: border-box;
width: 100%;
flex: auto;
background-size: contain;
background-position: 50% 50%;
background-repeat: no-repeat;
export const StyledEditPictureContainer = styled.div`
height: 400px;
display: flex;
flex-direction: column;
align-items: center;
background-color: black;
position: relative;
transition: box-shadow 0.1s ease-in-out;
border-radius: 5px;
overflow: hidden;
color: #363636;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
&.mobile {
height: 270px;
}
`;

export const StyledEditPicture = styled.div`
height: 400px;
width: 270px !important;
border-radius: 859px 909px 729px 909px;
background-position: 66% 39%;
background-size: cover;
&.mobile {
width: 190px !important;
height: 270px;
}
`;

export const StyledPictureMask = styled.div`
display: none;
position: absolute;
left: 39%;
left: calc(50% - 135px);
top: 0;
width: 200px;
width: 270px;
height: 100%;
box-shadow: 0 0 0 99999px rgba(0, 0, 0, 0.8);
border-radius: 859px 909px 729px 909px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addPrefix } from 'src/utils';
import {
StyledEditPicture,
StyledEditPictureButton,
StyledPictureMask,
StyledEditPictureContainer,
} from './CVEdit.styles';

interface CVEditPictureProps {
Expand Down Expand Up @@ -52,12 +52,12 @@ export const CVEditPicture = ({
);
});
};

return (
<StyledEditPicture
style={{ backgroundImage: `url(${addPrefix(url)})`, minHeight: '300px' }}
>
<StyledPictureMask className={!isDesktop ? 'mobile' : ''} />
<StyledEditPictureContainer className={!isDesktop ? 'mobile' : ''}>
<StyledEditPicture
className={!isDesktop ? 'mobile' : ''}
style={{ backgroundImage: `url(${addPrefix(url)})` }}
/>
{!disablePicture && (
<StyledEditPictureButton>
{imageUploading ? (
Expand Down Expand Up @@ -99,6 +99,6 @@ export const CVEditPicture = ({
)}
</StyledEditPictureButton>
)}
</StyledEditPicture>
</StyledEditPictureContainer>
);
};
2 changes: 1 addition & 1 deletion src/components/partials/LandingPagePartial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const LandingPagePartial = () => {
return (
<Background
blend={{ mode: 'soft-light', colorHex: 'rgba(0,0,0,0.4)' }}
src="/static/img/Linked-Out-VA--052_extended.jpg"
src="/static/img/cover-linkedout.jpg"
position="top-center"
>
<div
Expand Down

0 comments on commit cbea19f

Please sign in to comment.