Skip to content

Commit

Permalink
chore: rfq footer style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SHolleworth committed Dec 3, 2024
1 parent 0b301af commit 94a084a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const LiveFooterContent = ({
}) => (
<>
<CreditRfqTimer start={start} end={end} isSellSideView={false} />
<Button variant="primary" size="sm" onClick={() => onCancelRfq(rfqId)}>
<Button variant="primary" size="xxs" onClick={() => onCancelRfq(rfqId)}>
Cancel
</Button>
</>
Expand Down Expand Up @@ -82,7 +82,12 @@ export const TerminatedFooterContent = ({
}) => (
<CloseRfqButton onClick={() => removeRfqs([rfqId])}>
<BinIcon />
<Typography variant="Text xxs/Regular">{rfqStateToLabel(state)}</Typography>
<Typography
variant="Text xxs/Regular"
color="Colors/Text/text-secondary (700)"
>
{rfqStateToLabel(state)}
</Typography>
</CloseRfqButton>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ export const ViewTradeButton = styled(FooterButton)`
export const CloseRfqButton = styled(FooterButton)`
display: flex;
align-items: center;
padding: ${({ theme }) => theme.newTheme.spacing.xs}
${({ theme }) => theme.newTheme.spacing.md};
border-radius: ${({ theme }) => theme.newTheme.radius.xs};
svg {
fill: ${({ theme }) =>
theme.newTheme.color["Colors/Text/text-brand-primary (900)"]};
theme.newTheme.color["Colors/Text/text-brand-tertiary (600)"]};
margin-right: ${({ theme }) => theme.newTheme.spacing.md};
}
`
29 changes: 14 additions & 15 deletions packages/client/src/client/App/Credit/common/CreditRfqTimer.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { memo, useEffect, useLayoutEffect, useRef, useState } from "react"
import styled, { css, keyframes } from "styled-components"

import { Typography } from "@/client/components/Typography"

export const TimerWrapper = styled.div`
display: flex;
align-items: center;
flex: 0 0 16px;
padding: 0 16px;
`

export const TimeLeft = styled.div<{ margin: "left" | "right" }>`
export const TimeLeft = styled.div`
color: ${({ theme }) => theme.textColor};
font-size: 10px;
opacity: 0.6;
white-space: nowrap;
${({ margin }) =>
margin === "left" ? "margin-left: 0.5rem" : "margin-right: 0.5rem"};
`

export const ProgressBarWrapper = styled.div`
background-color: ${({ theme }) => theme.core.darkBackground};
margin: 0 ${({ theme }) => theme.newTheme.spacing.sm};
height: 6px;
width: 100%;
border-radius: 3px;
Expand Down Expand Up @@ -46,7 +46,8 @@ export const ProgressBar = memo(styled.div<{
end: number
transitionTime: number
}>`
background-color: ${({ theme }) => theme.accents.primary.base};
background-color: ${({ theme }) =>
theme.newTheme.color["Colors/Foreground/fg-brand-primary (600)"]};
border-radius: 3px;
height: 100%;
animation: ${progressAnimation};
Expand All @@ -67,12 +68,7 @@ const TimeProgress = ({ start, end }: { start: number; end: number }) => {
)
}

const CountWrapper = styled.span<{ grid?: boolean }>`
color: ${({ grid, theme }) =>
grid ? theme.accents.primary.base : "inherit"};
`

export const SecsTimer = ({ end, grid }: { end: number; grid?: boolean }) => {
export const SecsTimer = ({ end }: { end: number }) => {
const [timeLeft, setTimeLeft] = useState(() =>
Math.round((end - Date.now()) / 1000),
)
Expand All @@ -90,9 +86,12 @@ export const SecsTimer = ({ end, grid }: { end: number; grid?: boolean }) => {
const timeLeftSecs = timeLeft % 60

return (
<CountWrapper grid={grid}>
<Typography
variant="Text xs/Regular"
color="Colors/Text/text-primary (900)"
>
{timeLeftMins}m {timeLeftSecs}s
</CountWrapper>
</Typography>
)
}

Expand Down Expand Up @@ -121,15 +120,15 @@ export const CreditRfqTimer = ({
return timerEnded ? null : (
<>
{!isSellSideView && (
<TimeLeft margin={"right"}>
<TimeLeft>
<SecsTimer end={end} />
</TimeLeft>
)}
<ProgressBarWrapper>
<TimeProgress start={start} end={end} />
</ProgressBarWrapper>
{isSellSideView && (
<TimeLeft margin={"left"}>
<TimeLeft>
<SecsTimer end={end} />
</TimeLeft>
)}
Expand Down

0 comments on commit 94a084a

Please sign in to comment.