Skip to content

Commit

Permalink
fix: center button and toolbar text with relevant icons (#264)
Browse files Browse the repository at this point in the history
* center button and toolbar text with relevant icons

* pr feedback
  • Loading branch information
JFrankfurt authored Oct 13, 2022
1 parent 08931ec commit f00cd08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/Swap/Toolbar/Caption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ function Caption({ icon: Icon = AlertTriangle, caption }: CaptionProps) {
return (
<>
<Icon color="secondary" />
<ThemedText.Caption color="secondary">{caption}</ThemedText.Caption>
<ThemedText.Caption color="secondary" lineHeight="14px">
{caption}
</ThemedText.Caption>
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Swap/Toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default memo(function Toolbar() {
])

return (
<ToolbarRow justify="flex-start" data-testid="toolbar" gap={3 / 8}>
<ToolbarRow flex justify="flex-start" data-testid="toolbar" gap={3 / 8} align="flex-end">
{caption}
</ToolbarRow>
)
Expand Down
10 changes: 6 additions & 4 deletions src/components/TokenSelect/TokenButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StyledTokenButton = styled(Button)`
`

const TokenButtonRow = styled(Row)<{ empty: boolean }>`
float: right;
flex-direction: row;
height: 1.2em;
max-width: 12em;
overflow: hidden;
Expand Down Expand Up @@ -73,17 +73,19 @@ export default function TokenButton({ value, disabled, onClick }: TokenButtonPro
>
<ThemedText.ButtonLarge color={contentColor}>
<TokenButtonRow
gap={0.4}
align="flex-end"
empty={!value}
flex
gap={0.4}
// ref is used to set an absolute width, so it must be reset for each value passed.
// To force this, value?.symbol is passed as a key.
ref={setRow}
key={value?.symbol}
key={value?.wrapped.address}
>
{value ? (
<>
<TokenImg token={value} size={1.2} />
{value.symbol}
<span>{value.symbol}</span>
</>
) : (
<Trans>Select a token</Trans>
Expand Down

1 comment on commit f00cd08

@vercel
Copy link

@vercel vercel bot commented on f00cd08 Oct 13, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

widgets – ./

widgets-git-main-uniswap.vercel.app
widgets-seven-tau.vercel.app
widgets-uniswap.vercel.app

Please sign in to comment.