Skip to content

Commit

Permalink
update image input container
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges-GNM committed Dec 11, 2024
1 parent 0c56a14 commit 64cf504
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions fronts-client/src/components/image/ImageInputImageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const smallPortaitStyle = `
const normalPortraitStyle = `
width: ${NORMAL_PORTRAIT_WIDTH}px;
height: ${Math.floor(
NORMAL_PORTRAIT_WIDTH * PORTRAIT_RATIO + TEXTINPUT_HEIGHT,
NORMAL_PORTRAIT_WIDTH * PORTRAIT_RATIO + TEXTINPUT_HEIGHT + 10,
)}px;
`;

Expand All @@ -32,8 +32,6 @@ const normalLandscapeStyle = `
width: 100%;
maxWidth: 180px;
height: 115px;
border-color: red;
border-solid: 1px;
`;

const smallLandscape54Style = `
Expand All @@ -54,20 +52,20 @@ const squareStyle = `
`;

const getVariableImageContainerStyle = ({
portrait = false,
shouldShowPortrait = false,
small = false,
shouldShowLandscape54: shouldShowLandscape54 = false,
showSquare = false,
}: {
small?: boolean;
portrait?: boolean;
shouldShowPortrait?: boolean;
shouldShowLandscape54?: boolean;
showSquare?: boolean;
}) => {
switch (true) {
case showSquare:
return squareStyle;
case portrait:
case shouldShowPortrait:
return small ? smallPortaitStyle : normalPortraitStyle;
case shouldShowLandscape54:
return small ? smallLandscape54Style : normalLandscape54Style;
Expand All @@ -81,7 +79,7 @@ const getVariableImageContainerStyle = ({
// the image container
export const ImageInputImageContainer = styled.div<{
small?: boolean;
portrait?: boolean;
shouldShowPortrait?: boolean;
shouldShowLandscape54?: boolean;
showSquare?: boolean;
}>`
Expand Down
3 changes: 1 addition & 2 deletions fronts-client/src/components/inputs/InputImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,9 @@ class InputImage extends React.Component<ComponentProps, ComponentState> {
>
<ImageContainer
small={small}
portrait={portraitImage}
shouldShowPortrait={shouldShowPortrait}
shouldShowLandscape54={shouldShowLandscape54}
showSquare={showSquare}

>
<ImageComponent
style={{
Expand Down

0 comments on commit 64cf504

Please sign in to comment.