Skip to content

Commit

Permalink
fix(style): remove useless Grid components in ThumbnailSettings view #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ReidyT committed Oct 11, 2023
1 parent f4c38d1 commit cd75e40
Showing 1 changed file with 29 additions and 34 deletions.
63 changes: 29 additions & 34 deletions src/components/item/settings/ThumbnailSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FormEventHandler, useEffect, useRef, useState } from 'react';

import { Stack } from '@mui/material';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';

import { ItemType } from '@graasp/sdk';
Expand Down Expand Up @@ -124,39 +123,35 @@ const ThumbnailSetting = ({ item }: Props): JSX.Element | null => {
<StatusBar uppy={uppy} handleClose={handleClose} open={openStatusBar} />
)}
<Stack spacing={3} mb={3}>
<Grid item sm={6}>
<Typography variant="h5">
{translateBuilder(BUILDER.SETTINGS_THUMBNAIL_TITLE)}
</Typography>
<Typography variant="body1">
{translateBuilder(BUILDER.SETTINGS_THUMBNAIL_SETTINGS_INFORMATIONS)}
</Typography>
<input
type="file"
accept="image/*"
onInput={onSelectFile}
// onChange is successfully triggered in test
onChange={onSelectFile}
ref={inputRef}
className={THUMBNAIL_SETTING_UPLOAD_BUTTON_CLASSNAME}
/>
</Grid>
<Grid item sm={6} xs={12}>
<Thumbnail
id={itemId}
isLoading={isLoading}
// TODO: fix type
url={
imgUrl ??
(item as EmbeddedLinkItemTypeRecord)?.extra?.[
ItemType.LINK
]?.thumbnails?.first()
}
alt={alt}
maxWidth={THUMBNAIL_SETTING_MAX_WIDTH}
maxHeight={THUMBNAIL_SETTING_MAX_HEIGHT}
/>
</Grid>
<Typography variant="h5">
{translateBuilder(BUILDER.SETTINGS_THUMBNAIL_TITLE)}
</Typography>
<Typography variant="body1">
{translateBuilder(BUILDER.SETTINGS_THUMBNAIL_SETTINGS_INFORMATIONS)}
</Typography>
<input
type="file"
accept="image/*"
onInput={onSelectFile}
// onChange is successfully triggered in test
onChange={onSelectFile}
ref={inputRef}
className={THUMBNAIL_SETTING_UPLOAD_BUTTON_CLASSNAME}
/>
<Thumbnail
id={itemId}
isLoading={isLoading}
// TODO: fix type
url={
imgUrl ??
(item as EmbeddedLinkItemTypeRecord)?.extra?.[
ItemType.LINK
]?.thumbnails?.first()
}
alt={alt}
maxWidth={THUMBNAIL_SETTING_MAX_WIDTH}
maxHeight={THUMBNAIL_SETTING_MAX_HEIGHT}
/>
</Stack>
{fileSource && (
<CropModal
Expand Down

0 comments on commit cd75e40

Please sign in to comment.