Skip to content

Commit

Permalink
feat: style enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaYahya committed Jul 29, 2024
1 parent c069aaf commit 10ef7e8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { debounce } from '@/utils';
const Container = styled('div')(() => ({
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
alignItems: 'baseline',
width: '100%',
height: '100%',
position: 'absolute',
Expand Down Expand Up @@ -78,6 +78,7 @@ const ImageFrame = (): JSX.Element | null => {
objectFit: 'cover',
pointerEvents: 'auto',
cursor: 'cell',
width: '100%',
}}
/>
</Container>
Expand Down
32 changes: 17 additions & 15 deletions src/modules/builder/configuration/PreviewStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ const PreviewStep = ({

const { t } = useAppTranslation();
return (
<Stack spacing={2} padding={2}>
<>
<Alert severity="success">{t(APP.PREVIEW_NOTE)}</Alert>
<Box>
<Typography variant="h5" fontWeight="bold">
{appContext?.item.name}
</Typography>
<Typography variant="body1">
{appSettings?.[0].data.description}
</Typography>
</Box>
<PlayerFrame />
<Stack direction="row" gap={1} width="100%" justifyContent="flex-end">
<Button size="large" onClick={moveToPrevStep}>
{t(APP.BACK)}
</Button>
<Stack spacing={2} padding={2}>
<Box>
<Typography variant="h5" fontWeight="bold">
{appContext?.item.name}
</Typography>
<Typography variant="body1">
{appSettings?.[0].data.description}
</Typography>
</Box>
<PlayerFrame />
<Stack direction="row" gap={1} width="100%" justifyContent="flex-end">
<Button size="large" onClick={moveToPrevStep}>
{t(APP.BACK)}
</Button>
</Stack>
</Stack>
</Stack>
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/modules/common/DraggableFrameWithLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DraggableFrameWithLabels = ({
};

return (
<Box sx={{ position: 'relative', width: '100%' }}>
<Box sx={{ width: '100%' }}>
<TransformContainer
initialScale={1}
panning={{ disabled: isDragging }}
Expand Down
5 changes: 3 additions & 2 deletions src/modules/common/ImageFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = {
const Container = styled('div')(() => ({
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
alignItems: 'baseline',
width: '100%',
height: '100%',
position: 'absolute',
Expand All @@ -27,10 +27,11 @@ const ImageFrame = ({ appSettingId }: Props): JSX.Element | null => {
src={URL.createObjectURL(dataFile)}
alt="frame"
style={{
maxWidth: '100%',
width: '100%',
objectFit: 'cover',
pointerEvents: 'auto',
cursor: 'cell',
maxHeight: '100%',
}}
/>
</Container>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/common/PlayerFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const PlayerFrame = (): JSX.Element => {
ind: index + 1,
choices: [],
x: `${(l.x / imageDimension.width) * 100}%`,
y: `${(l.y / ADD_LABEL_FRAME_HEIGHT) * 100}%`,
y: `${((l.y - 0) / ADD_LABEL_FRAME_HEIGHT) * 100}%`,
}));

const allChoices = appLabels.map(({ id, content }) => ({
Expand Down Expand Up @@ -104,7 +104,7 @@ const PlayerFrame = (): JSX.Element => {
};

return (
<Box>
<Box sx={{ width: '100%' }}>
<Typography variant="body1" fontWeight={500}>
{t(APP.DRAG_DROP_EXERCISE_TITLE)}
</Typography>
Expand Down

0 comments on commit 10ef7e8

Please sign in to comment.