Fixing mobile styles

This commit is contained in:
James Ketr 2025-07-19 12:12:43 -07:00
parent 7b392409ca
commit 97272d9175
4 changed files with 79 additions and 84 deletions

View File

@ -63,17 +63,18 @@ const JobMatchScore: React.FC<{ score: number; variant?: 'small' | 'normal'; sx?
return theme.palette.error.main; return theme.palette.error.main;
}; };
const suffix = variant === 'small' ? '' : ' Match'; const suffix = variant === 'small' ? '' : ' Match';
return ( return (
<Box <Box
className="JobMatchScore"
sx={{ sx={{
justifyContent: 'center',
m: 0,
p: 0,
width: variant === 'small' ? '8rem' : '10rem', width: variant === 'small' ? '8rem' : '10rem',
ml: 1,
p: 1,
gap: 1,
display: 'flex', display: 'flex',
justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
flexDirection: variant === 'small' ? 'row' : 'column', flexDirection: 'row',
...sx, ...sx,
}} }}
> >
@ -91,40 +92,49 @@ const JobMatchScore: React.FC<{ score: number; variant?: 'small' | 'normal'; sx?
bgcolor: getMatchColor(score), bgcolor: getMatchColor(score),
color: 'white', color: 'white',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: variant === 'small' ? '0.7rem' : '1rem',
}} }}
/> />
<Box {variant !== 'small' && (
sx={{
position: 'relative',
display: 'inline-flex',
}}
>
<CircularProgress
variant="determinate"
value={score}
size={variant === 'small' ? 45 : 60}
thickness={5}
sx={{
color: getMatchColor(score),
}}
/>
<Box <Box
sx={{ sx={{
top: 0, position: 'relative',
left: 0, display: 'inline-flex',
bottom: 0, p: 0,
right: 0, m: 0,
position: 'absolute',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}} }}
> >
<Typography variant="caption" component="div" sx={{ fontWeight: 'bold' }}> <CircularProgress
{`${Math.round(score)}%`} variant="determinate"
</Typography> value={score}
size={60}
thickness={5}
sx={{
color: getMatchColor(score),
}}
/>
<Box
sx={{
top: 0,
left: 0,
bottom: 0,
right: 0,
position: 'absolute',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Typography
variant="caption"
component="div"
sx={{ fontWeight: 'bold', fontSize: '1rem' }}
>
{`${Math.round(score)}%`}
</Typography>
</Box>
</Box> </Box>
</Box> )}
</Box> </Box>
); );
}; };
@ -480,11 +490,12 @@ const JobMatchAnalysis: React.FC<JobAnalysisProps> = (props: JobAnalysisProps) =
return ( return (
<Scrollable <Scrollable
className="JobMatchAnalysis"
sx={{ sx={{
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
m: 0, m: 0,
p: 0, p: 1,
width: '100%', width: '100%',
minHeight: 0, minHeight: 0,
flexGrow: 1, flexGrow: 1,

View File

@ -96,6 +96,7 @@ const ResumeInfo: React.FC<ResumeInfoProps> = (props: ResumeInfoProps) => {
return ( return (
<Box <Box
className="ResumeInfo"
sx={{ sx={{
display: 'flex', display: 'flex',
borderColor: 'transparent', borderColor: 'transparent',

View File

@ -409,7 +409,7 @@ export const ResumePreview: React.FC<ResumePreviewProps> = (props: ResumePreview
if (!resume || !candidate || !job) { if (!resume || !candidate || !job) {
return ( return (
<Box sx={{ p: 2 }}> <Box className="ResumePreview" sx={{ p: 2 }}>
<Typography variant="body1">No resume data available.</Typography> <Typography variant="body1">No resume data available.</Typography>
</Box> </Box>
); );
@ -417,7 +417,7 @@ export const ResumePreview: React.FC<ResumePreviewProps> = (props: ResumePreview
return ( return (
<Box <Box
className="document-container" className="ResumePreview document-container"
sx={{ sx={{
...currentStyle.contentStyle, ...currentStyle.contentStyle,
position: 'relative', position: 'relative',

View File

@ -409,6 +409,7 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
return ( return (
<Box <Box
className="JobAnalysisPage"
sx={{ sx={{
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
@ -432,6 +433,24 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
maxWidth: '100%', maxWidth: '100%',
width: '100%', width: '100%',
flexDirection: 'column', flexDirection: 'column',
'& .MuiAvatar-root': isMobile
? {
width: 32,
height: 32,
}
: {},
'& .MuiStepLabel-label': isMobile
? {
fontSize: '0.9rem',
marginTop: '4px',
}
: {},
'& .MuiSvgIcon-root': isMobile
? {
width: '0.9rem',
height: '0.9rem',
}
: {},
}} }}
> >
<Stepper <Stepper
@ -483,7 +502,7 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
<Box sx={{ mb: 1, justifyContent: 'center' }}> <Box sx={{ mb: 1, justifyContent: 'center' }}>
Candidate{!isMobile && ' Selection'} Candidate{!isMobile && ' Selection'}
</Box> </Box>
{selectedCandidate !== null && !isMobile && ( {selectedCandidate !== null && (
<Box <Box
sx={{ sx={{
justifySelf: 'flex-start', justifySelf: 'flex-start',
@ -508,7 +527,7 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
}} }}
/> />
<Box sx={{ flexDirection: 'column', textAlign: 'left' }}> <Box sx={{ flexDirection: 'column', textAlign: 'left' }}>
<Box>Name</Box> {!isMobile && <Box>Name</Box>}
<Box sx={{ fontWeight: 'normal' }}>{selectedCandidate?.fullName}</Box> <Box sx={{ fontWeight: 'normal' }}>{selectedCandidate?.fullName}</Box>
</Box> </Box>
</Box> </Box>
@ -548,7 +567,7 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
}} }}
> >
<Box sx={{ mb: 1, justifyContent: 'center' }}>Job{!isMobile && ' Selection'}</Box> <Box sx={{ mb: 1, justifyContent: 'center' }}>Job{!isMobile && ' Selection'}</Box>
{selectedJob !== null && !isMobile && ( {selectedJob !== null && (
<Box <Box
sx={{ sx={{
justifySelf: 'flex-start', justifySelf: 'flex-start',
@ -559,11 +578,11 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
}} }}
> >
<Box sx={{ flexDirection: 'column', textAlign: 'left' }}> <Box sx={{ flexDirection: 'column', textAlign: 'left' }}>
<Box>Company</Box> {!isMobile && <Box>Company</Box>}
<Box sx={{ fontWeight: 'normal' }}>{selectedJob.company}</Box> <Box sx={{ fontWeight: 'normal' }}>{selectedJob.company}</Box>
</Box> </Box>
<Box sx={{ flexDirection: 'column', textAlign: 'left' }}> <Box sx={{ flexDirection: 'column', textAlign: 'left' }}>
<Box>Title</Box> {!isMobile && <Box>Title</Box>}
<Box sx={{ fontWeight: 'normal' }}>{selectedJob.title}</Box> <Box sx={{ fontWeight: 'normal' }}>{selectedJob.title}</Box>
</Box> </Box>
</Box> </Box>
@ -600,13 +619,17 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
'& :first-of-type': { '& :first-of-type': {
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
}, },
m: 0,
p: 0,
}} }}
> >
<Box sx={{ mb: 1, justifyContent: 'center' }}>{!isMobile && 'Job '}Analysis</Box> <Box sx={{ mb: 1, justifyContent: 'center' }}>{!isMobile && 'Job '}Analysis</Box>
{analysisState.analysis !== null && ( {analysisState.analysis !== null && (
<Box sx={{ justifyContent: 'center' }}> <JobMatchScore
<JobMatchScore score={analysisState.analysis.score} variant="small" /> sx={{ width: 'min-content', alignSelf: 'center' }}
</Box> score={analysisState.analysis.score}
variant="small"
/>
)} )}
</Box> </Box>
</StepLabel> </StepLabel>
@ -647,46 +670,6 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
</StepLabel> </StepLabel>
</Step> </Step>
</Stepper> </Stepper>
{isMobile && (
<Box
sx={{
mb: 1,
ml: 1,
display: 'flex',
justifySelf: 'flex-start',
flexDirection: 'row',
fontSize: '0.75rem',
gap: 1,
width: '100%',
}}
>
{selectedCandidate !== null && (
<Box sx={{ display: 'flex', flexDirection: 'row', flexGrow: 1 }}>
<Avatar
src={
selectedCandidate.profileImage
? `/api/1.0/candidates/profile/${selectedCandidate.username}`
: ''
}
alt={`${selectedCandidate.fullName}'s profile`}
sx={{
alignSelf: 'flex-start',
width: 32,
height: 32,
border: '2px solid #e0e0e0',
}}
/>
<Box sx={{ fontWeight: 'normal' }}>{selectedCandidate?.fullName}</Box>
</Box>
)}
{selectedJob !== null && (
<Box sx={{ display: 'flex', flexDirection: 'column', flexGrow: 1 }}>
<Box sx={{ fontWeight: 'normal' }}>{selectedJob.title}</Box>
<Box sx={{ fontWeight: 'normal' }}>{selectedJob.company}</Box>
</Box>
)}
</Box>
)}
</Paper> </Paper>
<Box <Box
ref={scrollRef} ref={scrollRef}
@ -707,7 +690,7 @@ const JobAnalysisPage: React.FC<BackstoryPageProps> = () => {
{activeStep === 3 && renderResume()} {activeStep === 3 && renderResume()}
</Box> </Box>
<Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}> <Box sx={{ display: 'flex', flexDirection: 'row', p: 1 }}>
<Button color="inherit" disabled={activeStep === 0} onClick={handleBack} sx={{ mr: 1 }}> <Button color="inherit" disabled={activeStep === 0} onClick={handleBack} sx={{ mr: 1 }}>
Back Back
</Button> </Button>