Skip to content

Commit

Permalink
Merge branch 'master' of github.com:QuickSwap/interface-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
sameepsi committed Dec 6, 2021
2 parents b1ab7c4 + 3f812bd commit c94eeb1
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 35 deletions.
23 changes: 15 additions & 8 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import WalletIcon from 'assets/images/WalletIcon.png';

const useStyles = makeStyles(({ palette, breakpoints }) => ({
header: {
padding: '0 40px',
padding: '0 24px',
position: 'relative',
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center',
minHeight: 88,
zIndex: 3,
justifyContent: 'space-between',
Expand Down Expand Up @@ -58,6 +57,9 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
},
},
},
[breakpoints.down('sm')]: {
alignItems: 'center',
},
[breakpoints.down('xs')]: {
padding: '0 16px',
},
Expand Down Expand Up @@ -86,6 +88,7 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
transform: 'translateX(-50%)',
display: 'flex',
alignItems: 'center',
height: '100%',
'& .menuItem': {
borderRadius: 10,
cursor: 'pointer',
Expand Down Expand Up @@ -149,7 +152,7 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
},
},
mobileMenuWrapper: {
background: 'white',
background: '#121319',
position: 'absolute',
top: 80,
left: 0,
Expand All @@ -172,7 +175,7 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
height: 32,
width: '100%',
'& p': {
color: palette.primary.dark,
color: '#ebecf2',
},
'& svg, & img': {
width: 32,
Expand Down Expand Up @@ -321,7 +324,7 @@ const Header: React.FC = () => {
pendingTransactions={pending}
confirmedTransactions={confirmed}
/>
<Link to='/'>
<Link to='/' onClick={() => setMenuOpen(false)}>
<img src={QuickLogo} alt='QuickLogo' />
</Link>
{!mobileWindowSize && (
Expand Down Expand Up @@ -416,9 +419,13 @@ const Header: React.FC = () => {
)}
>
{menuItems.map((val, index) => (
<Box key={index} className={classes.mobileMenuItemWrapper}>
<Box
key={index}
className={classes.mobileMenuItemWrapper}
onClick={() => setMenuOpen(false)}
>
<Link to={val.link} key={index}>
<Typography variant='body2'>{val.text}</Typography>
<Typography variant='body1'>{val.text}</Typography>
</Link>
</Box>
))}
Expand All @@ -428,7 +435,7 @@ const Header: React.FC = () => {
onClick={toggleWalletModal}
>
<img src={WalletIcon} alt='Wallet' />
<Typography variant='body2'>{shortenAddress(account)}</Typography>
<Typography variant='body1'>{shortenAddress(account)}</Typography>
</Box>
) : (
<Button
Expand Down
13 changes: 12 additions & 1 deletion src/components/RewardSlider/RewardSliderItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Box, Typography, Button } from '@material-ui/core';
import { useHistory } from 'react-router-dom';
import { JSBI, TokenAmount } from '@uniswap/sdk';
import { makeStyles } from '@material-ui/core/styles';
import { StakingInfo } from 'state/stake/hooks';
Expand Down Expand Up @@ -65,6 +66,7 @@ interface RewardSliderItemProps {

const RewardSliderItem: React.FC<RewardSliderItemProps> = ({ info }) => {
const classes = useStyles();
const history = useHistory();
const token0 = info.tokens[0];

const baseTokenCurrency = unwrappedToken(info.baseToken);
Expand Down Expand Up @@ -171,7 +173,16 @@ const RewardSliderItem: React.FC<RewardSliderItemProps> = ({ info }) => {
</Typography>
<Typography component='h5'>{apyWithFee}%</Typography>
</Box>
<Button fullWidth color='primary' style={{ marginTop: '30px' }}>
<Button
fullWidth
color='primary'
style={{ marginTop: '30px' }}
onClick={() => {
history.push(
`/pools?currency0=${info.tokens[0].address}&currency1=${info.tokens[1].address}`,
);
}}
>
Invest
</Button>
</Box>
Expand Down
42 changes: 30 additions & 12 deletions src/components/TopMovers/TopMovers.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import React, { useEffect, useMemo } from 'react';
import { Box, Typography } from '@material-ui/core';
import { Box, Typography, useMediaQuery } from '@material-ui/core';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import { ArrowDropUp, ArrowDropDown } from '@material-ui/icons';
import Skeleton from '@material-ui/lab/Skeleton';
import { Token, ChainId } from '@uniswap/sdk';
import { CurrencyLogo } from 'components';
import { getEthPrice, getTopTokens } from 'utils';
import { useTopTokens } from 'state/application/hooks';

const useStyles = makeStyles(({ breakpoints }) => ({
content: {
width: '100%',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
[breakpoints.down('sm')]: {
flexWrap: 'wrap',
justifyContent: 'flex-start',
},
[breakpoints.down('xs')]: {
flexDirection: 'column',
},
},
}));

interface TopMoversProps {
background: string;
hideArrow?: boolean;
Expand All @@ -15,7 +32,10 @@ const TopMovers: React.FC<TopMoversProps> = ({
background,
hideArrow = false,
}) => {
const classes = useStyles();
const theme = useTheme();
const { topTokens, updateTopTokens } = useTopTokens();
const smallWindowSize = useMediaQuery(theme.breakpoints.down('xs'));

const topMoverTokens = useMemo(
() => (topTokens && topTokens.length >= 5 ? topTokens.slice(0, 5) : null),
Expand All @@ -39,9 +59,10 @@ const TopMovers: React.FC<TopMoversProps> = ({
<Box
width='100%'
display='flex'
flexWrap='wrap'
flexDirection='column'
justifyContent='center'
alignItems='flex-start'
alignItems={smallWindowSize ? 'center' : 'flex-start'}
bgcolor={background}
border={`1px solid ${
background === 'transparent' ? '#1b1e29' : 'transparent'
Expand All @@ -52,16 +73,10 @@ const TopMovers: React.FC<TopMoversProps> = ({
<Typography variant='h6' style={{ color: '#696c80' }}>
24h TOP MOVERS
</Typography>
<Box mt={2} width={1}>
<Box width={1}>
{topMoverTokens ? (
<Box
width='100%'
display='flex'
flexDirection='row'
justifyContent='space-between'
alignItems='center'
>
{topMoverTokens.map((token: any) => {
<Box className={classes.content}>
{topMoverTokens.map((token: any, index: number) => {
const currency = new Token(
ChainId.MATIC,
token.id,
Expand All @@ -72,10 +87,13 @@ const TopMovers: React.FC<TopMoversProps> = ({
const priceUpPercent = Number(token.priceChangeUSD).toFixed(2);
return (
<Box
mr={!smallWindowSize && index < topMoverTokens.length ? 2 : 0}
width={smallWindowSize ? 180 : 'unset'}
mt={2}
key={token.id}
display='flex'
flexDirection='row'
justifyContent='center'
justifyContent={smallWindowSize ? 'flex-start' : 'center'}
alignItems='center'
>
<CurrencyLogo currency={currency} size='28px' />
Expand Down
3 changes: 1 addition & 2 deletions src/pages/AnalyticsPage/AnalyticsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import AnalyticsTokenDetails from './AnalyticTokenDetails';

const useStyles = makeStyles(({}) => ({
topTab: {
width: 120,
height: 46,
padding: '0 24px',
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
cursor: 'pointer',
'& p': {
color: '#626680',
Expand Down
22 changes: 12 additions & 10 deletions src/pages/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
width: '100%',
position: 'relative',
zIndex: 2,
justifyContent: 'center',
[breakpoints.down('md')]: {
flexWrap: 'wrap',
},
'& > div': {
background: palette.background.default,
width: 'calc(25% - 24px)',
Expand Down Expand Up @@ -201,6 +205,9 @@ const useStyles = makeStyles(({ palette, breakpoints }) => ({
swapInfo: {
textAlign: 'left',
marginBottom: 60,
[breakpoints.down('sm')]: {
order: -1,
},
'& h3': {
marginBottom: 16,
},
Expand Down Expand Up @@ -412,7 +419,6 @@ const LandingPage: React.FC = () => {
const isnotMatic =
ethereum && ethereum.isMetaMask && Number(ethereum.chainId) !== 137;
const mobileWindowSize = useMediaQuery(theme.breakpoints.down('sm'));
const smallWindowSize = useMediaQuery(theme.breakpoints.down('xs'));
const { initTransak } = useInitTransak();
const allTokens = useAllTokens();
const toggleWalletModal = useWalletModalToggle();
Expand Down Expand Up @@ -549,7 +555,7 @@ const LandingPage: React.FC = () => {
}, [ethPrice, updateEthPrice, updateGlobalData]);

return (
<Box>
<>
{openStakeModal && (
<StakeQuickModal
open={openStakeModal}
Expand Down Expand Up @@ -611,11 +617,7 @@ const LandingPage: React.FC = () => {
</Button>
</Box>
</Box>
<Box
className={classes.tradingInfo}
display='flex'
justifyContent={smallWindowSize ? 'center' : 'space-between'}
>
<Box className={classes.tradingInfo} display='flex'>
<Box>
{globalData ? (
<Typography variant='h3'>
Expand Down Expand Up @@ -714,7 +716,7 @@ const LandingPage: React.FC = () => {
</a>
))}
</Box>
<Box mt={2}>
<Box mt={2} width={1}>
<TopMovers background='transparent' />
</Box>
<Box className={classes.quickInfo}>
Expand Down Expand Up @@ -849,15 +851,15 @@ const LandingPage: React.FC = () => {
<Box className='socialContent'>
{socialicons.map((val, ind) => (
<Box key={ind}>
{val.icon}
<a href={val.link} target='_blank' rel='noreferrer'>
{val.icon}
<Typography>{val.title}</Typography>
</a>
</Box>
))}
</Box>
</Box>
</Box>
</>
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/pages/SwapPage/SwapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const SwapPage: React.FC = () => {
</Box>
</Box>
<Grid container spacing={4}>
<Grid item sm={12} md={5}>
<Grid item xs={12} sm={12} md={5}>
<Box className={classes.wrapper}>
<Box display='flex' justifyContent='space-between'>
<Box display='flex'>
Expand Down Expand Up @@ -338,7 +338,7 @@ const SwapPage: React.FC = () => {
</Box>
</Box>
</Grid>
<Grid item sm={12} md={7}>
<Grid item xs={12} sm={12} md={7}>
<Box display='flex' justifyContent='space-between' width='100%'>
{currencies[Field.INPUT] && (
<Box className={classes.swapTokenDetails}>
Expand Down

0 comments on commit c94eeb1

Please sign in to comment.