Skip to content

Commit

Permalink
fix styles in home and swap pages
Browse files Browse the repository at this point in the history
  • Loading branch information
totop716 committed Jul 20, 2023
1 parent 85b0087 commit a335ec9
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 64 deletions.
2 changes: 1 addition & 1 deletion components/AccountDetails/CopyHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CopyHelper: React.FC<CopyHelperProps> = ({ toCopy }) => {
<Box className={styles.copyIcon} onClick={() => setCopied(toCopy)}>
{isCopied ? (
<>
<CheckCircle size='18' />
<CheckCircle />
<small>{t('copied')}</small>
</>
) : (
Expand Down
2 changes: 1 addition & 1 deletion components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Footer: React.FC = () => {
<Image
src='/assets/images/quickLogo.png'
alt='QUICK'
width={40}
width={130}
height={40}
/>
<Box mt={2} maxWidth='240px'>
Expand Down
2 changes: 1 addition & 1 deletion components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const Header: React.FC = () => {
id: 'bos-page-link',
isExternal: true,
target: '_blank',
externalLink: process?.env?.REACT_APP_BOS_URL || '',
externalLink: process?.env?.NEXT_PUBLIC_BOS_URL || '',
isNew: true,
});
}
Expand Down
1 change: 1 addition & 0 deletions components/Swap/SwapBestTrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ const SwapBestTrade: React.FC<{
)}
<Box width={showApproveFlow ? '48%' : '100%'}>
<Button
variant='contained'
fullWidth
disabled={
(bonusRouteLoading ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ const SwapTokenDetailsHorizontal: React.FC<{
</Grid>
<Grid item xs={3}>
<Box>
<small className='swapTxInfoHeader'>Price</small>
<small className='text-secondary'>Price</small>
{tokenData ? (
<Box>${formatNumber(tokenData.priceUSD)}</Box>
<p className='small'>${formatNumber(tokenData.priceUSD)}</p>
) : (
<Skeleton variant='rectangular' width={80} height={20} />
)}
</Box>
</Grid>
<Grid item xs={2}>
<Box>
<small className='swapTxInfoHeader'>24h</small>
<small className='text-secondary'>24h</small>
{tokenData ? (
<Box className={`${priceUp ? 'text-success' : 'text-error'}`}>
<p className={`small ${priceUp ? 'text-success' : 'text-error'}`}>
{priceUp ? '+' : ''}
{priceUpPercent}%
</Box>
</p>
) : (
<Skeleton variant='rectangular' width={60} height={20} />
)}
Expand Down
3 changes: 2 additions & 1 deletion components/pages/home/DragonLayerInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { formatCompact, useLairDQUICKAPY } from 'utils';
import { Skeleton } from '@mui/lab';
import { StakeQuickModal } from 'components';
import { useTranslation } from 'react-i18next';
import styles from 'styles/pages/Home.module.scss';

interface DragonLayerInfoCardProps {
chainId: any;
Expand Down Expand Up @@ -57,7 +58,7 @@ const DragonLayerInfoCard: React.FC<DragonLayerInfoCardProps> = ({
/>
)}
{(oldLair || newLair) && (
<Box className='tradingSection' pt='20px'>
<Box className={styles.tradingSection} pt='20px'>
{dQUICKAPY ? (
<Box>
<Box display='flex'>
Expand Down
7 changes: 4 additions & 3 deletions components/pages/swap/SwapDefaultMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SwapBuySellMiniWidget } from './BuySellWidget';
import LiquidityPools from './LiquidityPools';
import SwapMain from './SwapMain';
import SwapNewsWidget from './SwapNewWidget';
import styles from 'styles/pages/Swap.module.scss';

const SwapDefaultMode: React.FC<{
token1: any;
Expand Down Expand Up @@ -38,8 +39,8 @@ const SwapDefaultMode: React.FC<{
<Grid item>
<Box
sx={{ display: { xs: 'none', lg: 'block' } }}
className={`btn-swap-widget ${
disabledLeft ? 'btn-swap-widget-disabled' : ''
className={`${styles.btnSwapWidget} ${
disabledLeft ? styles.btnSwapWidgetDisabled : ''
} `}
onClick={() => {
if (disabledLeft) return;
Expand Down Expand Up @@ -105,7 +106,7 @@ const SwapDefaultMode: React.FC<{
)}
<Grid item>
<Box
className='btn-swap-widget'
className={styles.btnSwapWidget}
sx={{ display: { xs: 'none', lg: 'block' } }}
onClick={() => setRightOpen(!rightOpen)}
>
Expand Down
27 changes: 11 additions & 16 deletions components/pages/swap/SwapMain.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, Menu, MenuItem } from '@mui/material';
import { Box, Menu, MenuItem } from '@mui/material';
import { KeyboardArrowDown, Settings } from '@mui/icons-material';
import { SettingsModal, Swap, ToggleSwitch } from 'components';
import { SwapBestTrade } from 'components/Swap';
Expand Down Expand Up @@ -216,23 +216,18 @@ const SwapMain: React.FC = () => {
<Box display='flex' width={1}>
{!isProMode ? (
<>
<Box display='flex' className='tabContainer'>
<Box display='flex' className={styles.tabContainer}>
{dropDownMenuText && (
<Button
<Box
id='swap-button'
aria-controls={open ? 'swap-menu' : undefined}
aria-haspopup='true'
aria-expanded={open ? 'true' : undefined}
variant='text'
disableElevation
onClick={handleClickListItem}
endIcon={<KeyboardArrowDown />}
className={`tab tabMenu ${
selectedIndex !== SWAP_CROSS_CHAIN ? 'activeTab' : ''
className={`${styles.tab} ${styles.tabMenu} ${
selectedIndex !== SWAP_CROSS_CHAIN ? styles.activeTab : ''
}`}
>
{t(dropDownMenuText)}
</Button>
<p>{t(dropDownMenuText)}</p>
<KeyboardArrowDown />
</Box>
)}
<Menu
id='swap-menu'
Expand All @@ -259,16 +254,16 @@ const SwapMain: React.FC = () => {
</Menu>
{showCrossChain && (
<Box
className={`tab ${
selectedIndex === SWAP_CROSS_CHAIN ? 'activeTab' : ''
className={`${styles.tab} ${
selectedIndex === SWAP_CROSS_CHAIN ? styles.activeTab : ''
}`}
onClick={() => {
setSelectedIndex(SWAP_CROSS_CHAIN);
setAnchorEl(null);
redirectWithSwapType(SWAP_CROSS_CHAIN);
}}
>
<p className='trade-btn'>{t('crossChain')}</p>
<p className={styles.tradeBtn}>{t('crossChain')}</p>
</Box>
)}
</Box>
Expand Down
7 changes: 6 additions & 1 deletion components/pages/swap/SwapV3/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,12 @@ const SwapV3Page: React.FC = () => {

<Box className={styles.swapButtonWrapper}>
{!account ? (
<Button fullWidth onClick={toggleWalletModal}>
<Button variant='contained' fullWidth onClick={toggleWalletModal}>
{t('connectWallet')}
</Button>
) : showWrap ? (
<Button
variant='contained'
fullWidth
disabled={
Boolean(wrapInputError) ||
Expand All @@ -702,6 +703,7 @@ const SwapV3Page: React.FC = () => {
</Button>
) : routeNotFound && userHasSpecifiedInputOutput ? (
<Button
variant='contained'
fullWidth
disabled={routeNotFound && userHasSpecifiedInputOutput}
>
Expand All @@ -717,6 +719,7 @@ const SwapV3Page: React.FC = () => {
<>
<Box width='48%'>
<Button
variant='contained'
fullWidth
onClick={handleApprove}
disabled={
Expand Down Expand Up @@ -775,6 +778,7 @@ const SwapV3Page: React.FC = () => {
</Box>
<Box width='48%'>
<Button
variant='contained'
fullWidth
onClick={() => {
if (isExpertMode) {
Expand Down Expand Up @@ -809,6 +813,7 @@ const SwapV3Page: React.FC = () => {
</>
) : (
<Button
variant='contained'
fullWidth
onClick={() => {
if (isExpertMode) {
Expand Down
7 changes: 3 additions & 4 deletions components/v3/CurrencyInputPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ReactNode, useCallback, useMemo, useState } from 'react';
import { LockOutlined } from '@mui/icons-material';

import { useActiveWeb3React } from 'hooks';
import useUSDCPrice from 'hooks/v3/useUSDCPrice';
import { WrappedCurrency } from 'models/types/Currency';
import CurrencyLogo from 'components/CurrencyLogo';
import { useCurrencyBalance } from 'state/wallet/hooks';
Expand Down Expand Up @@ -161,7 +160,7 @@ export default function CurrencyInputPanel({
</Box>
</Box>
<Box className='flex justify-between'>
<Box display='flex'>
<Box display='flex items-center'>
<small className='text-secondary'>
{t('balance')}:{' '}
{(showETH && ethBalance
Expand All @@ -170,12 +169,12 @@ export default function CurrencyInputPanel({
</small>

{account && currency && showHalfButton && (
<Box className='maxWrapper' onClick={onHalf}>
<Box className={styles1.maxWrapper} onClick={onHalf}>
<small>50%</small>
</Box>
)}
{account && currency && showMaxButton && (
<Box className='maxWrapper' onClick={onMax}>
<Box className={styles1.maxWrapper} onClick={onMax}>
<small>{t('max')}</small>
</Box>
)}
Expand Down
2 changes: 0 additions & 2 deletions connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ export const networkInfoMap: NetworkInfoChainMap = {
},
};

const FORMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY;

const [web3Network, web3NetworkHooks] = initializeConnector<Network>(
(actions) =>
new Network({ actions, urlMap: RPC_PROVIDERS, defaultChainId: 137 }),
Expand Down
34 changes: 21 additions & 13 deletions styles/_mui-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ html {
height: 2px;
width: calc(100% - 16px);
padding: 13px 0;

& .MuiSlider-mark {
width: 4px;
height: 4px !important;
Expand All @@ -41,13 +41,13 @@ html {
bottom: 14px;
color: $textPrimary;
font-family: 'DM Sans', sans-serif;
content: "Cheaper gas";
content: 'Cheaper gas';
display: flex;
align-items: center;
margin-left: -50px;
padding: 0.3em 1em;
position: absolute;
z-index: 98
z-index: 98;
}
&::before {
background-color: $bgColor;
Expand All @@ -59,38 +59,40 @@ html {
border-left: transparent;
color: $textPrimary;
font-family: 'DM Sans', sans-serif;
content: "";
content: '';
display: flex;
align-items: center;
margin-left: -4px;
position: absolute;
box-sizing: border-box;
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
z-index: 99
z-index: 99;
}
}
}
}

.MuiSlider-mark {
height: 8px;
background-color: #B4C2D5;
background-color: #b4c2d5;
}

.MuiSlider-thumb {
height: 20px;
width: 20px;
background-color: $primary;
margin-top: -9px;
margin-left: 0;
box-shadow: 0px 2px 5px $grey21;

&:focus, &:hover, &.active {

&:focus,
&:hover,
&.active {
box-shadow: inherit;
}
}

.MuiSlider-valueLabel {
left: calc(-50% - 8px);
top: -18px;
Expand All @@ -102,19 +104,25 @@ html {
color: $textPrimary;
}
}

.MuiSlider-track {
height: 2px;
background: $blue5;
border-radius: 4px;
padding-right: 8px;
}

.MuiSlider-rail {
height: 2px;
border-radius: 4px;
background: $bgPalette;
width: calc(100% + 16px);
}
}

.MuiButton-root {
&.Mui-disabled {
opacity: 0.3;
}
}
}
11 changes: 9 additions & 2 deletions styles/components/AccountDetails.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@
.copyIcon {
display: flex;
cursor: pointer;
&:hover, &:active, &:focus {
&:hover,
&:active,
&:focus {
color: white;
}
& small {
margin-left: 4px;
}
& svg {
width: 18px;
height: 18px;
color: $textSecondary;
}
}

.transactionState {
Expand All @@ -42,4 +49,4 @@
&:hover {
text-decoration: underline;
}
}
}
7 changes: 3 additions & 4 deletions styles/pages/Home.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
color: $textSecondary;
}
& > button {
height: 56px;
height: 48px;
width: 194px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 28px;
margin-top: 20px;
}
}

Expand Down
Loading

0 comments on commit a335ec9

Please sign in to comment.