Skip to content

Commit

Permalink
Merge branch 'main' into handle_firewall_rules_on_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrrnn authored Nov 21, 2024
2 parents c0a88ca + 51a4c0f commit ed0f24c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 49 deletions.
64 changes: 36 additions & 28 deletions src/containers/main/SideBar/components/Wallet/HistoryItem.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ export const Wrapper = styled(m.div)`
font-family:
GTAmerica Standard,
sans-serif;
&:hover {
.hover-target {
opacity: 0.2;
}
}
`;

export const LeftContent = styled.div`
align-items: center;
display: flex;
gap: 10px;
flex-shrink: 0;
transition: opacity 0.2s ease-in;
${Wrapper}:hover & {
opacity: 0.2;
}
`;

export const SquadIconWrapper = styled.div<{ $colour: string; $colour1: string; $colour2: string }>`
Expand Down Expand Up @@ -77,6 +76,10 @@ export const EarningsWrapper = styled.div`
flex-shrink: 0;
font-weight: 600;
font-size: 16px;
transition: opacity 0.2s ease-in;
${Wrapper}:hover & {
opacity: 0.2;
}
`;

export const ListLabel = styled.div`
Expand All @@ -91,18 +94,12 @@ export const HoverWrapper = styled(m.div)`
position: absolute;
inset: 0;
z-index: 4;
transition: background-color 2s ease;
background-color: rgba(255, 255, 255, 0.1);
align-items: center;
display: flex;
flex-direction: row;
justify-content: flex-end;
height: 100%;
gap: 6px;
padding: 0 10px;
transition: background-color 2s ease;
`;

export const ReplayButton = styled(m.button)`
export const ReplayButton = styled.button`
display: flex;
border-radius: 100%;
position: relative;
Expand All @@ -113,22 +110,31 @@ export const ReplayButton = styled(m.button)`
background-color: ${({ theme }) => theme.colors.grey[600]};
color: #fff;
box-sizing: border-box;
transition: opacity 0.2s ease;
&:hover {
svg {
scale: 1.05;
}
opacity: 0.8;
}
svg {
// flex centering wasn't working:(
position: relative;
top: 50%;
transform: translateY(-50%);
transition: scale 0.1s ease;
}
`;

export const FlexButton = styled(m.button)`
export const ButtonWrapper = styled(m.div)`
position: relative;
align-items: center;
display: flex;
flex-direction: row;
padding: 0 10px;
justify-content: flex-end;
height: 100%;
gap: 6px;
`;
export const FlexButton = styled.button`
display: flex;
height: 31px;
padding: 8px 5px 8px 18px;
Expand All @@ -143,10 +149,9 @@ export const FlexButton = styled(m.button)`
color: #000;
font-size: 12px;
font-weight: 600;
line-height: normal;
line-height: 1;
cursor: pointer;
right: 0;
box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0);
&:hover {
box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}
Expand All @@ -155,17 +160,20 @@ export const FlexButton = styled(m.button)`
export const GemPill = styled.div`
border-radius: 60px;
background: #000;
justify-content: center;
display: flex;
height: 20px;
padding: 7px 5px 7px 8px;
padding: 0 5px 0 8px;
align-items: center;
gap: 4px;
color: #fff;
font-size: 10px;
font-weight: 600;
line-height: normal;
span {
color: #fff;
display: flex;
font-size: 10px;
font-weight: 600;
line-height: 1.1;
}
`;

export const GemImage = styled.img`
Expand Down
44 changes: 23 additions & 21 deletions src/containers/main/SideBar/components/Wallet/HistoryItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useBlockchainVisualisationStore } from '@app/store/useBlockchainVisualisationStore';
import {
ButtonWrapper,
EarningsWrapper,
FlexButton,
GemImage,
Expand Down Expand Up @@ -88,31 +89,32 @@ export default function HistoryItem({ item }: HistoryItemProps) {
const showShareButton = sharingEnabled && isLoggedIn;
return (
<Wrapper onMouseEnter={() => setHovering(true)} onMouseLeave={() => setHovering(false)}>
{showShareButton && (
<AnimatePresence>
{hovering && (
<HoverWrapper initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}>
<FlexButton
initial={{ x: 20 }}
animate={{ x: 0 }}
transition={{ delay: 0.1 }}
exit={{ x: 20 }}
onClick={handleShareClick}
>
{t('share.history-item-button')}
<GemPill>
{gemsValue} <GemImage src={gemImage} alt="" />
</GemPill>
</FlexButton>
<AnimatePresence>
{hovering && (
<HoverWrapper initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}>
<ButtonWrapper
initial={{ opacity: 0, y: 5 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 5 }}
>
{showShareButton && (
<FlexButton onClick={handleShareClick}>
{t('share.history-item-button')}
<GemPill>
<span>{gemsValue}</span>
<GemImage src={gemImage} alt="" />
</GemPill>
</FlexButton>
)}
<ReplayButton onClick={handleReplay}>
<ReplaySVG />
</ReplayButton>
</HoverWrapper>
)}
</AnimatePresence>
)}
</ButtonWrapper>
</HoverWrapper>
)}
</AnimatePresence>

<LeftContent className={showShareButton ? 'hover-target' : ''}>
<LeftContent>
<SquadIconWrapper $colour={colour} $colour1={colour1} $colour2={colour2}>
<TariSvg />
</SquadIconWrapper>
Expand Down

0 comments on commit ed0f24c

Please sign in to comment.