Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
retroboydev committed Sep 22, 2023
1 parent d0756cb commit 1926522
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 67 deletions.
88 changes: 50 additions & 38 deletions src/Theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,16 @@ export const Link = styled.a.attrs({
cursor: pointer;
color: ${({ theme }) => theme.primary1};
font-weight: 500;
:hover {
text-decoration: underline;
}
:focus {
outline: none;
text-decoration: underline;
}
:active {
text-decoration: none;
}
Expand All @@ -159,11 +162,17 @@ export const ThemedBackground = styled.div`

export const GlobalStyle = createGlobalStyle`
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500&display=swap');
html { font-family: 'DM Sans', sans-serif; }
html {
font-family: 'DM Sans', sans-serif;
}
@supports (font-variation-settings: normal) {
html { font-family: 'DM Sans', sans-serif; }
html {
font-family: 'DM Sans', sans-serif;
}
}
html,
body {
margin: 0;
Expand All @@ -173,7 +182,7 @@ export const GlobalStyle = createGlobalStyle`
font-size: 14px;
background-color: ${({ theme }) => theme.bg6};
}
* {
box-sizing: border-box;
}
Expand All @@ -186,47 +195,50 @@ export const GlobalStyle = createGlobalStyle`
}
}
.three-line-legend {
width: 100%;
height: 70px;
position: absolute;
padding: 8px;
font-size: 12px;
color: #20262E;
background-color: rgba(255, 255, 255, 0.23);
text-align: left;
z-index: 10;
pointer-events: none;
}
.three-line-legend-dark {
width: 100%;
height: 70px;
position: absolute;
padding: 8px;
font-size: 12px;
color: white;
background-color: rgba(255, 255, 255, 0.23);
text-align: left;
z-index: 10;
pointer-events: none;
}
button {
font-family: 'DM Sans', sans-serif;
}
@media screen and (max-width: 800px) {
.three-line-legend {
display: none !important;
width: 100%;
height: 70px;
position: absolute;
padding: 8px;
font-size: 12px;
color: #20262E;
background-color: rgba(255, 255, 255, 0.23);
text-align: left;
z-index: 10;
pointer-events: none;
}
}
.tv-lightweight-charts{
width: 100% !important;
.three-line-legend-dark {
width: 100%;
height: 70px;
position: absolute;
padding: 8px;
font-size: 12px;
color: white;
background-color: rgba(255, 255, 255, 0.23);
text-align: left;
z-index: 10;
pointer-events: none;
}
& > * {
@media screen and (max-width: 800px) {
.three-line-legend {
display: none !important;
}
}
.tv-lightweight-charts {
width: 100% !important;
& > * {
width: 100% !important;
}
}
}
html {
Expand Down
6 changes: 4 additions & 2 deletions src/components/FAQ/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import styled, { css } from 'styled-components'
import styled from 'styled-components'
import { Accordion as AccordionWrapper, AccordionItem as Item } from '@szhsin/react-accordion'
import { ChevronDown } from 'react-feather'

Expand All @@ -16,7 +16,9 @@ const ItemWithChevron = ({ header, ...rest }) => (
<span className={'chevron-wrapper'}>
<ChevronDown />
</span>
{header}
<TYPE.main fontWeight={700} fontSize={16}>
{header}
</TYPE.main>
</>
}
/>
Expand Down
3 changes: 0 additions & 3 deletions src/components/PositionList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ const SORT_FIELD = {
}

function PositionList({ positions }) {
const below500 = useMedia('(max-width: 500px)')
const below740 = useMedia('(max-width: 740px)')

// pagination
Expand All @@ -135,8 +134,6 @@ function PositionList({ positions }) {
}
}, [positions])

const [ethPrice] = useEthPrice()

const ListItem = ({ position, index }) => {
const poolOwnership = position.liquidityTokenBalance / position.pair.totalSupply
const valueUSD = poolOwnership * position.pair.reserveUSD
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useMedia } from 'react-use'
import { transparentize } from 'polished'
import { TYPE } from '../../Theme'
import { withRouter } from 'react-router-dom'
import { TrendingUp, List, PieChart, Disc, Flag } from 'react-feather'
import { TrendingUp, List, PieChart, Disc } from 'react-feather'
import Link from '../Link'
import { useSessionStart } from '../../contexts/Application'

Expand Down
2 changes: 1 addition & 1 deletion src/components/VolumeContestSearchWallet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function VolumeContestSearchWalletPanel({ history }) {
}
history.push('/volume-contest/' + checkAccountQuery)
},
[isCheckAccountAddressValid, checkAccountQuery]
[isCheckAccountAddressValid, checkAccountQuery, history]
)

return (
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/LpContestData.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function useLpContestNftRanksData() {
if (!(ranks && Object.keys(ranks).length)) {
fetchData()
}
}, [ranks])
}, [ranks, updateNftRanksData])

return ranks
}
3 changes: 1 addition & 2 deletions src/contexts/User.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { createContext, useContext, useReducer, useMemo, useCallback, useEffect, useState } from 'react'
import { isEmpty } from 'lodash'
import { usePairData } from './PairData'
import { jediSwapClient } from '../apollo/client'
import {
Expand Down Expand Up @@ -347,7 +346,7 @@ export function useUserVolumeCampaignTransactions({ account, timestampGte, times
if (!transactions && account) {
fetchData(account)
}
}, [account, transactions, updateVolumeContestTransactions])
}, [account, transactions, updateVolumeContestTransactions, timestampGte, timestampLte])

return transactions || {}
}
Expand Down
4 changes: 0 additions & 4 deletions src/pages/AccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ function AccountPage({ account }) {

const dynamicPositions = activePosition ? [activePosition] : positions

const aggregateFees = dynamicPositions?.reduce(function (total, position) {
return total + position.fees.sum
}, 0)

const positionValue = useMemo(() => {
return dynamicPositions
? dynamicPositions.reduce((total, position) => {
Expand Down
1 change: 0 additions & 1 deletion src/pages/LpContestLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useMemo } from 'react'
import 'feather-icons'
import { withRouter } from 'react-router-dom'
import dayjs from 'dayjs'
import Countdown from 'react-countdown'

import { TYPE } from '../Theme'
import { PageWrapper, FullWrapper } from '../components'
Expand Down
10 changes: 0 additions & 10 deletions src/pages/LpContestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { BasicLink } from '../components/Link'

import eligibilityBadgeIcon from '../../src/assets/starBadge.svg'

import LpContestUserChart from '../components/LpContestUserChart'
import { useLpContestNftRanksData } from '../contexts/LpContestData'
import { isEmpty, isObject } from 'lodash'

Expand All @@ -26,15 +25,6 @@ const EligibilityBadgeWrapper = styled.a`
cursor: help;
`

const PanelWrapper = styled.div`
grid-template-columns: 1fr;
grid-template-rows: max-content;
gap: 6px;
display: inline-grid;
width: 100%;
align-items: start;
`

const Header = styled.div``

const DashboardWrapper = styled.div`
Expand Down
1 change: 0 additions & 1 deletion src/pages/PairPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ function PairPage({ pairAddress, history }) {

const [savedPairs, addPair] = useSavedPairs()

const listedTokens = useListedTokens()
const whitelistedTokens = useWhitelistedTokens()
const isTokenWhitelisted = !!(whitelistedTokens[token0?.id] && whitelistedTokens[token1?.id])

Expand Down
6 changes: 3 additions & 3 deletions src/pages/VolumeContestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function VolumeContestAccountPage({ account }) {
const totalContestScore = userData?.totalContestScore

let isUserEligible = useMemo(() => {
return (typeof userNftLevel == 'number' && userNftLevel) > 0 || false
}, [userData])
return (typeof userNftLevel == 'number' && userNftLevel > 0 && userNftLevel <= 5) || false
}, [userData, userNftLevel])

const getEligibleNftForUserScore = useCallback(() => {
const loadingResultStub = '...'
Expand All @@ -173,7 +173,7 @@ function VolumeContestAccountPage({ account }) {
if (!isAllDataAvailable) {
return loadingResultStub
}
const currentWeek = userData.weeks.filter(findCurrentWeek).unshift()
const currentWeek = userData.weeks.filter(findCurrentWeek).shift()
return currentWeek?.score ?? 0
}, [userData])

Expand Down

0 comments on commit 1926522

Please sign in to comment.