Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: if textures are not present, it displays none #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ export const TileInfoSectionWrapper = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin: 24px 0;
gap: 5px;
margin: 18px 0px;
`;

export const CenteredContainer = styled.div`
Expand Down
30 changes: 22 additions & 8 deletions src/components/tile-details-panel/texture-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
background-repeat: no-repeat;
cursor: inherit;
`;
const TileInfoTitle = styled(Title)`
flex: 1;
`;
const TileInfoValue = styled(Title)`
flex: 1;
color: ${({ theme }) => theme.colors.mainDimColorInverted};
font-weight: 400;
word-break: break-all;
white-space: pre-wrap;
`;

const SIZE = 149;
const PREVIEW_SIZE = 592;
Expand Down Expand Up @@ -106,14 +116,18 @@
return (
<>
<TileInfoSectionWrapper>
<Title $left={16}>Texture:</Title>
<TextureContainer onClick={onClickHandler}>
<TextureButton
image={`url(${texture})`}
width={size.width}
height={size.height}
></TextureButton>
</TextureContainer>
<TileInfoTitle $left={16}>Texture:</TileInfoTitle>
{texture ?

Check failure on line 120 in src/components/tile-details-panel/texture-section.tsx

View workflow job for this annotation

GitHub Actions / Linter

'?' should be placed at the beginning of the line
<TextureContainer onClick={onClickHandler}>
<TextureButton
image={`url(${texture})`}
width={size.width}
height={size.height}
></TextureButton>
</TextureContainer>
:

Check failure on line 128 in src/components/tile-details-panel/texture-section.tsx

View workflow job for this annotation

GitHub Actions / Linter

Expected indentation of 10 spaces but found 8

Check failure on line 128 in src/components/tile-details-panel/texture-section.tsx

View workflow job for this annotation

GitHub Actions / Linter

Bad line breaking before and after ':'
<TileInfoValue>none</TileInfoValue>
}
</TileInfoSectionWrapper>

{showPreviewTexture && (
Expand Down
Loading