Skip to content

Commit

Permalink
Add label to advanced images
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmi committed Oct 7, 2023
1 parent a207a6e commit 991b089
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/gameComponents/AdvancedImage/AdvancedImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ const Wrapper = styled.div`
line-height: 0em;
`;

const Label = styled.div`
position: absolute;
top: 1px;
right: 1px;
padding: 0 3px;
background-color: black;
color: white;
border-radius: 0.5em;
opacity: 0.5;
font-size: 0.6em;
line-height: 1.5em;
`;

/*
const layer={
Expand All @@ -59,6 +72,8 @@ const AdvancedImage = ({
unflippedFor,
holdItems,
setState,
text,
backText,
layers,
}) => {
const { register } = useItemInteraction("place");
Expand Down Expand Up @@ -161,6 +176,8 @@ const AdvancedImage = ({
height={height}
useCanvas={true}
/>
{flippedForMe && backText && <Label>{backText}</Label>}
{(!flippedForMe || !backText) && text && <Label>{text}</Label>}
<UnflippedFor>
{unflippedForUsers &&
unflippedForUsers.map(({ color, id }) => {
Expand Down

1 comment on commit 991b089

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.