Skip to content

Commit

Permalink
[Uni Merge] Style fixes pt. 1 (#380)
Browse files Browse the repository at this point in the history
* fix header button

* fix button width

* fix token list padding

* fix network selector styles

* network selector alignment

* mod and fix arrow wrapper on expert mode

* "recipient" consistency

* fix MouseoverTooltip wrapping

* identicon size

* fix craco sentry config

* header balance background revert

* update lock

* wrap fees discount

* mod proper file

* fix margin error

* fix small screen wallet centergin
  • Loading branch information
W3stside authored Apr 14, 2022
1 parent 747a97b commit c2e3b84
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 40 deletions.
8 changes: 4 additions & 4 deletions src/components/Header/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export const ActiveRowLinkList = styled.div`
padding: 0 8px;
& > a {
align-items: center;
color: ${({ theme }) => theme.text2};
color: ${({ theme }) => theme.text1};
display: flex;
flex-direction: row;
font-size: 14px;
font-weight: 500;
justify-content: space-between;
padding: 8px 0 4px;
padding: 8px 0 4px 6px;
text-decoration: none;
}
& > a:first-child {
Expand All @@ -43,11 +43,11 @@ export const ActiveRowWrapper = styled.div`
background-color: ${({ theme }) => theme.bg1};
border-radius: 8px;
cursor: pointer;
padding: 8px;
width: 100%;
padding: 8px;
`
export const FlyoutHeader = styled.div`
color: ${({ theme }) => theme.text2};
color: ${({ theme }) => theme.text1};
font-weight: 400;
`
const FlyoutMenu = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Web3Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Web3StatusGeneric = styled(ButtonSecondary)`
width: 100%;
align-items: center;
padding: 0.5rem;
border-radius: 14px;
border-radius: 12px;
cursor: pointer;
user-select: none;
height: 36px;
Expand Down
1 change: 0 additions & 1 deletion src/components/swap/styleds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const ArrowWrapper = styled.div<{ clickable: boolean }>`
left: calc(50% - 16px);
/* transform: rotate(90deg); */
background-color: ${({ theme }) => theme.bg1};
border: 4px solid ${({ theme }) => theme.bg0};
z-index: 2;
${({ clickable }) =>
clickable
Expand Down
2 changes: 1 addition & 1 deletion src/custom/components/Header/HeaderMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export const AccountElement = styled.div<{ active: boolean }>`
display: flex;
flex-direction: row;
align-items: center;
background-color: ${({ theme, active }) => (!active ? theme.bg1 : theme.bg3)};
border-radius: 12px;
background-color: ${({ theme, active }) => (!active ? theme.bg1 : theme.bg3)};
white-space: nowrap;
width: 100%;
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
LinkOutCircle,
} from '@src/components/Header/NetworkSelector'
import useChangeNetworks from 'hooks/useChangeNetworks'
import { transparentize } from 'polished'

/* const ActiveRowLinkList = styled.div`
display: flex;
Expand Down Expand Up @@ -68,6 +69,10 @@ const FlyoutMenu = styled.div`
@media screen and (min-width: ${MEDIA_WIDTHS.upToSmall}px) {
top: 38px;
}
${({ theme }) => theme.mediaWidth.upToExtraSmall`
right: 20%;
`}
`
// mod: actually, this is closer to original version but I haven't yet pulled latest from uniswap
const FlyoutMenuContents = styled.div`
Expand All @@ -81,11 +86,15 @@ const FlyoutMenuContents = styled.div`
flex-direction: column;
font-size: 16px;
overflow: auto;
padding: 0.3rem;
padding: 10px 12px;
//position: absolute;
//top: 54px;
min-width: 175px;
z-index: 99;
// mod
${ActiveRowWrapper} {
background-color: ${({ theme }) => transparentize(0.4, theme.bg4)};
}
& > *:not(:last-child) {
margin-bottom: 5px;
}
Expand Down
3 changes: 1 addition & 2 deletions src/custom/components/Identicon/IdenticonMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Identicon({ account: customAccount, size = 16 }: Identic
const { avatar } = useENSAvatar(account ?? undefined, false)
const [fetchable, setFetchable] = useState(true)

const icon = useMemo(() => account && jazzicon(16, parseInt(account.slice(2, 10), 16)), [account])
const icon = useMemo(() => account && jazzicon(size, parseInt(account.slice(2, 10), 16)), [size, account])
const iconRef = useRef<HTMLDivElement>(null)
useLayoutEffect(() => {
const current = iconRef.current
Expand All @@ -46,7 +46,6 @@ export default function Identicon({ account: customAccount, size = 16 }: Identic
return
}, [icon, iconRef])

console.log(`identicon`, chainAccount, customAccount, account, avatar, fetchable)
return (
<StyledIdenticon>
{avatar && fetchable ? (
Expand Down
1 change: 1 addition & 0 deletions src/custom/components/SearchModal/ManageLists/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Wrapper = styled.div`
${ListContainer} {
${({ theme }) => theme.neumorphism.boxShadow}
padding: 1rem;
}
`

Expand Down
3 changes: 2 additions & 1 deletion src/custom/components/SwapWarnings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const HighFeeWarning = (props: WarningProps) => {
<MouseoverTooltipContent
bgColor={theme.bg1}
color={theme.text1}
wrap
content={<HighFeeWarningMessage feePercentage={feePercentage} />}
>
<ErrorStyledInfo />
Expand Down Expand Up @@ -175,7 +176,7 @@ export const NoImpactWarning = (props: WarningProps) => {
<div>
Price impact <strong>unknown</strong> - trade carefully
</div>{' '}
<MouseoverTooltipContent bgColor={theme.bg1} color={theme.text1} content={NoImpactWarningMessage}>
<MouseoverTooltipContent bgColor={theme.bg1} color={theme.text1} content={NoImpactWarningMessage} wrap>
<ErrorStyledInfo />
</MouseoverTooltipContent>
{acceptWarningCb && (
Expand Down
25 changes: 8 additions & 17 deletions src/custom/components/Web3Status/Web3StatusMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { RowBetween } from 'components/Row'

// MOD imports
import { EnhancedTransactionDetails } from 'state/enhancedTransactions/reducer'
import { Web3StatusGeneric, Web3StatusError, Web3StatusConnect, WrappedStatusIcon } from '@src/components/Web3Status'
import { Web3StatusGeneric as Web3StatusGenericUni, WrappedStatusIcon } from '@src/components/Web3Status'

/* const IconWrapper = styled.div<{ size?: number }>`
${({ theme }) => theme.flexColumnNoWrap};
Expand All @@ -33,23 +33,14 @@ import { Web3StatusGeneric, Web3StatusError, Web3StatusConnect, WrappedStatusIco
height: ${({ size }) => (size ? size + 'px' : '32px')};
width: ${({ size }) => (size ? size + 'px' : '32px')};
}
`
`*/

const Web3StatusGeneric = styled(ButtonSecondary)`
${({ theme }) => theme.flexRowNoWrap}
width: 100%;
align-items: center;
padding: 0.5rem;
border-radius: 14px;
cursor: pointer;
user-select: none;
height: 36px;
margin-right: 2px;
margin-left: 1px;
:focus {
outline: none;
}
// mod
export const Web3StatusGeneric = styled(Web3StatusGenericUni)`
margin-left: 0px;
margin-right: 0px;
`

const Web3StatusError = styled(Web3StatusGeneric)`
background-color: ${({ theme }) => theme.red1};
border: 1px solid ${({ theme }) => theme.red1};
Expand Down Expand Up @@ -87,7 +78,7 @@ const Web3StatusConnect = styled(Web3StatusGeneric)<{ faded?: boolean }>`
color: ${({ theme }) => darken(0.05, theme.primaryText1)};
}
`}
` */
`

export const Web3StatusConnected = styled(Web3StatusGeneric)<{ pending?: boolean; clickDisabled?: boolean }>`
background-color: ${({ pending, theme }) => (pending ? theme.primary1 : theme.bg2)};
Expand Down
3 changes: 1 addition & 2 deletions src/custom/components/Web3Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AbstractConnector } from '@web3-react/abstract-connector'
import { getStatusIcon } from 'components/AccountDetails'
import useRecentActivity, { TransactionAndOrder } from 'hooks/useRecentActivity'
import { useWalletInfo } from 'hooks/useWalletInfo'
import { ButtonSecondary } from 'components/Button'
import { OrderStatus } from '@src/custom/state/orders/actions'
import { STORAGE_KEY_LAST_PROVIDER } from 'constants/index'

Expand All @@ -16,7 +15,7 @@ export const Wrapper = styled.div`
display: flex;
justify-content: center;
${ButtonSecondary} {
button {
height: 38px;
max-width: 180px;
${({ theme }) => theme.mediaWidth.upToVerySmall`
Expand Down
2 changes: 1 addition & 1 deletion src/custom/components/swap/TradeSummary/RowFee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function RowFee({
Fees {includeGasMessage}
</ThemedText.Black>
{showHelpers && (
<MouseoverTooltipContent content={tooltip} bgColor={theme.bg1} color={theme.text1}>
<MouseoverTooltipContent content={tooltip} bgColor={theme.bg1} color={theme.text1} wrap>
<StyledInfo />
</MouseoverTooltipContent>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function RowReceivedAfterSlippage({
content={getMinimumReceivedTooltip(allowedSlippage, isExactIn)}
bgColor={theme.bg1}
color={theme.text1}
wrap
>
<StyledInfo />
</MouseoverTooltipContent>
Expand Down
1 change: 1 addition & 0 deletions src/custom/components/swap/TradeSummary/RowSlippage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function RowSlippage({
<MouseoverTooltipContent
bgColor={theme.bg3}
color={theme.text1}
wrap
content={
<Trans>
<p>Your slippage is MEV protected: all orders are submitted with tight spread (0.1%) on-chain.</p>
Expand Down
8 changes: 8 additions & 0 deletions src/custom/components/swap/styleds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from 'styled-components/macro'
import { ArrowWrapper as ArrowWrapperUni } from '@src/components/swap/styleds'

export * from '@src/components/swap/styleds'

export const ArrowWrapper = styled(ArrowWrapperUni)`
left: 16px;
`
20 changes: 13 additions & 7 deletions src/custom/pages/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default function Profile() {
<i>Total vCOW balance</i>
<b>
<span title={`${vCowBalanceMax} vCOW`}>{vCowBalance} vCOW</span>{' '}
<MouseoverTooltipContent content={tooltipText.balanceBreakdown}>
<MouseoverTooltipContent content={tooltipText.balanceBreakdown} wrap>
<HelpCircle size={14} />
</MouseoverTooltipContent>
</b>
Expand All @@ -191,7 +191,7 @@ export default function Profile() {
<BalanceDisplay titleSize={18} altColor={true}>
<i>
Vested{' '}
<MouseoverTooltipContent content={tooltipText.vested}>
<MouseoverTooltipContent content={tooltipText.vested} wrap>
<HelpCircle size={14} />
</MouseoverTooltipContent>
</i>
Expand Down Expand Up @@ -270,15 +270,15 @@ export default function Profile() {
&nbsp;&nbsp;
<Txt secondary>
Last updated
<MouseoverTooltipContent content="Data is updated on the background periodically.">
<MouseoverTooltipContent content="Data is updated on the background periodically." wrap>
<HelpCircle size={14} />
</MouseoverTooltipContent>
:&nbsp;
</Txt>
{!lastUpdated ? (
'-'
) : (
<MouseoverTooltipContent content={<TimeFormatted date={profileData?.lastUpdated} />}>
<MouseoverTooltipContent content={<TimeFormatted date={profileData?.lastUpdated} />} wrap>
<strong>{lastUpdated}</strong>
</MouseoverTooltipContent>
)}
Expand Down Expand Up @@ -317,7 +317,7 @@ export default function Profile() {
<ChildWrapper>
<ItemTitle>
Trades&nbsp;
<MouseoverTooltipContent content="Statistics regarding your own trades.">
<MouseoverTooltipContent content="Statistics regarding your own trades." wrap>
<HelpCircle size={14} />
</MouseoverTooltipContent>
</ItemTitle>
Expand All @@ -333,7 +333,10 @@ export default function Profile() {
<span>
Total trades
{isTradesTooltipVisible && (
<MouseoverTooltipContent content="You may see more trades here than what you see in the activity list. To understand why, check out the FAQ.">
<MouseoverTooltipContent
content="You may see more trades here than what you see in the activity list. To understand why, check out the FAQ."
wrap
>
<HelpCircle size={14} />
</MouseoverTooltipContent>
)}
Expand All @@ -356,7 +359,10 @@ export default function Profile() {
<ChildWrapper>
<ItemTitle>
Referrals&nbsp;
<MouseoverTooltipContent content="Statistics regarding trades by people who used your referral link.">
<MouseoverTooltipContent
content="Statistics regarding trades by people who used your referral link."
wrap
>
<HelpCircle size={14} />
</MouseoverTooltipContent>
</ItemTitle>
Expand Down
4 changes: 2 additions & 2 deletions src/custom/pages/Swap/SwapMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,12 @@ export default function Swap({
>
<AutoRow
justify={isExpertMode || recipientToggleVisible ? 'space-between' : 'center'}
// style={{ padding: '0 1rem' }}
style={{ padding: '0 1rem' }}
>
<ArrowWrapperLoader onSwitchTokens={onSwitchTokens} setApprovalSubmitted={setApprovalSubmitted} />
{recipient === null && !showWrap && (isExpertMode || recipientToggleVisible) ? (
<LinkStyledButton id="add-recipient-button" onClick={() => onChangeRecipient('')}>
<Trans>+ Add a send (optional)</Trans>
<Trans>+ Add a recipient (optional)</Trans>
</LinkStyledButton>
) : null}
</AutoRow>
Expand Down
1 change: 1 addition & 0 deletions src/custom/pages/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const FeesDiscount: React.FC<FeesDiscountProps> = ({ onClick, theme, ...b
content={SUBSIDY_INFO_MESSAGE + '. Click on the discount button on the right for more info.'}
bgColor={theme.bg1}
color={theme.text1}
wrap
>
<StyledInfo />
</MouseoverTooltipContent>
Expand Down

0 comments on commit c2e3b84

Please sign in to comment.