Skip to content

Commit

Permalink
fix: Image upload stretch and design settings (#3306)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s authored Jun 20, 2024
1 parent 3e06283 commit fd6112e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const DesignPreview = styled(Box)(({ theme }) => ({
border: `2px solid ${theme.palette.border.input}`,
padding: theme.spacing(2),
boxShadow: "4px 4px 0px rgba(150, 150, 150, 0.5)",
display: "flex",
justifyContent: "center",
}));

export const EXAMPLE_COLOUR = "#007078";
Expand Down
24 changes: 17 additions & 7 deletions editor.planx.uk/src/ui/editor/ImgInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({
marginLeft: theme.spacing(0.5),
}));

const ImageWrapper = styled(Box)(() => ({
width: 50,
height: 50,
display: "flex",
justifyContent: "center",
alignItems: "center",
}));

/** Uploads an image and returns corresponding URL */
export default function ImgInput({
img,
Expand Down Expand Up @@ -86,13 +94,15 @@ export default function ImgInput({
Remove
</MenuItem>
</Menu>
<img
width={50}
height={50}
src={img}
alt="embedded img"
style={{ display: "block", backgroundColor: backgroundColor }}
/>
<ImageWrapper sx={{ backgroundColor: backgroundColor }}>
<img
width={44}
height={44}
src={img}
alt="embedded img"
style={{ display: "block", height: "auto" }}
/>
</ImageWrapper>
</ImageUploadContainer>
) : (
<Tooltip title="Drop file here">
Expand Down

0 comments on commit fd6112e

Please sign in to comment.