Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design consistency fixes #1569

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export const TYPE = {

export const Header = styled.h1`
color: ${({ theme }) => theme['text1']};
font-size: 24px;
font-weight: 500;
margin: 0 0 -20px;
font-size: 30px;
font-weight: 700;
margin-right: auto;
`

const slideUp = keyframes`
Expand Down
4 changes: 3 additions & 1 deletion src/components/ComparePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import { ISettings } from '~/contexts/types'
import ReactSelect from '../MultiSelect/ReactSelect'

import { fetchWithErrorLogging } from '~/utils/async'
import { Header } from '~/Theme'
import { PROTOCOLS_API } from '~/constants'


const fetch = fetchWithErrorLogging

const DataWrapper = styled.div`
Expand Down Expand Up @@ -236,7 +238,7 @@ function ComparePage() {
name: 'Open Protocol'
}}
/>
<h2>Compare chains </h2>
<Header>Compare chains </Header>

<ControlsWrapper>
<ReactSelect
Expand Down
34 changes: 17 additions & 17 deletions src/components/Correlations/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { X as XIcon } from 'react-feather'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import React, { useState, useEffect, useRef, useMemo } from 'react'
import { IResponseCGMarketsAPI } from '~/api/types'
import { useQueries, useQuery } from 'react-query'
Expand Down Expand Up @@ -54,21 +54,21 @@ export default function Correlations({ coinsData }) {
() =>
!isLoading
? Object.fromEntries(
coins.map((coin0) => {
const results = coins.map((coin1) => {
if (coin1.id === coin0.id) return null
const chart0 = priceChart[coin0.id]?.slice(-period)
const chart1 = priceChart[coin1.id]?.slice(-period)
const shortChartLength = chart0.length > chart1?.length ? chart1?.length : chart0?.length
const corr = pearsonCorrelationCoefficient(
chart0.slice(0, shortChartLength),
chart1.slice(0, shortChartLength)
)
return corr
})
return [coin0.id, results]
coins.map((coin0) => {
const results = coins.map((coin1) => {
if (coin1.id === coin0.id) return null
const chart0 = priceChart[coin0.id]?.slice(-period)
const chart1 = priceChart[coin1.id]?.slice(-period)
const shortChartLength = chart0.length > chart1?.length ? chart1?.length : chart0?.length
const corr = pearsonCorrelationCoefficient(
chart0.slice(0, shortChartLength),
chart1.slice(0, shortChartLength)
)
return corr
})
)
return [coin0.id, results]
})
)
: [],
[isLoading, period, queryCoins]
)
Expand All @@ -81,7 +81,7 @@ export default function Correlations({ coinsData }) {
(search === ''
? true
: coin?.symbol?.toLowerCase().includes(search.toLowerCase()) ||
coin?.name?.toLowerCase().includes(search.toLowerCase())) && !selectedCoins[coin.id]
coin?.name?.toLowerCase().includes(search.toLowerCase())) && !selectedCoins[coin.id]
)
)
}, [search, selectedCoins, queryCoins])
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function Correlations({ coinsData }) {

return (
<>
<TYPE.largeHeader>Correlations Matrix</TYPE.largeHeader>
<Header>Correlations Matrix</Header>

<ToggleWrapper>
<Switch onClick={() => setPeriod(7)} active={period === 7}>
Expand Down
9 changes: 4 additions & 5 deletions src/components/Filters/raises/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { DropdownsWrapper, Header, Wrapper } from '../v2Base'
import { DropdownsWrapper, Wrapper } from '../v2Base'
import { useMedia } from '~/hooks'
import { SlidingMenu } from '~/components/SlidingMenu'
import { RaisesFilterDropdowns } from './Dropdowns'
import { IDropdownMenusProps } from './types'
import { RaisesSearch } from '~/components/Search'
import { Header } from '~/Theme'

export function RaisesFilters(props: IDropdownMenusProps) {
const isSmall = useMedia(`(max-width: 30rem)`)

return (
<div>
<Header>
<h1>{props.header}</h1>
</Header>
<Wrapper>
<Header>{props.header}</Header>
<Wrapper style={{ marginTop: '1rem' }}>
<RaisesSearch list={props.investors || []} />

<DropdownsWrapper>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Nav/Desktop/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,17 @@ const Details = styled.details`
background: #ebebeb;
font-size: 0.625rem;
border-radius: 4px;
padding: 3px;
padding: 2px 5px;
color: black;
position: relative;
left: -4px;
font-weight: 600;
letter-spacing: 0.5px;
}

:hover {
background-color: ${({ theme }) =>
theme.mode === 'dark' ? 'rgba(246, 246, 246, 0.1)' : 'rgba(246, 246, 246, 1)'};
theme.mode === 'dark' ? 'rgba(246, 246, 246, 0.1)' : 'rgba(246, 246, 246, 1)'};
}
}

Expand Down
11 changes: 7 additions & 4 deletions src/components/Nav/Desktop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,26 @@ const Nav = styled.nav`
background: #ebebeb;
font-size: 0.625rem;
border-radius: 4px;
padding: 3px;
padding: 2px 5px;
color: black;
position: relative;
left: -4px;
top: 2px;
font-weight: 600;
top: 1px;
letter-spacing: 0.5px;
}

:hover,
:focus-visible {
opacity: 1;
background-color: ${({ theme }) =>
theme.mode === 'dark' ? 'rgba(246, 246, 246, 0.1)' : 'rgba(246, 246, 246, 1)'};
theme.mode === 'dark' ? 'rgba(246, 246, 246, 0.1)' : 'rgba(246, 246, 246, 1)'};
}

&[data-linkactive='true'] {
background-color: #2172e5;
background: linear-gradient(135deg, #2172e5, hsl(215 79% 36% / 1));
color: white;
font-weight:500;
opacity: 1;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/RecentProtocols/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FiltersByChain, HideForkedProtocols, TVLRange } from '~/components/Filt
import { useCalcStakePool2Tvl } from '~/hooks/data'
import { getPercentChange } from '~/utils'
import { IFormattedProtocol } from '~/api/types'
import { Header } from '~/Theme'

function getSelectedChainFilters(chainQueryParam, allChains) {
if (chainQueryParam) {
Expand Down Expand Up @@ -141,7 +142,7 @@ export function RecentProtocols({ title, name, header, protocols, chainList, for
<ProtocolsChainsSearch step={{ category: 'Home', name: name }} />

<TableFilters>
<TableHeader>{header}</TableHeader>
<Header>{header}</Header>

<Dropdowns>
<FiltersByChain chainList={chainList} selectedChains={selectedChains} pathname={pathname} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/Base/Desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const OptionsWrapper = styled.div`
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
background-color: ${({ theme }) => (theme.mode === 'dark' ? 'rgba(0, 0, 0, 0.6)' : 'rgba(246, 246, 246, 0.6)')};
--step-color: ${({ theme }) => (theme.mode === 'dark' ? '#7e96ff' : '#475590')};
--step-color: ${({ theme }) => (theme.mode === 'dark' ? '#629ff4' : '#475590')};

& > p {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import styled from 'styled-components'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { Divider, Panel } from '~/components'
import { RowBetween } from '~/components/Row'
Expand All @@ -22,7 +22,7 @@ function AboutPage() {
return (
<Layout title="DefiLlama - DeFi Dashboard" defaultSEO>
<RowBetween>
<TYPE.largeHeader>About</TYPE.largeHeader>
<Header>About</Header>
</RowBetween>
<Panel style={{ marginTop: '6px' }}>
<DashGrid style={{ height: 'fit-content', padding: '0 0 1rem 0' }}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/chatgptplugin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import styled from 'styled-components'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { Divider, Panel } from '~/components'
import { RowBetween } from '~/components/Row'
Expand All @@ -22,7 +22,7 @@ function PluginPage() {
return (
<Layout title="DefiLlama - ChatGPT Plugin" defaultSEO>
<RowBetween>
<TYPE.largeHeader>DefiLlama ChatGPT Plugin</TYPE.largeHeader>
<Header>DefiLlama ChatGPT Plugin</Header>
</RowBetween>
<Panel style={{ marginTop: '6px' }}>
<DashGrid style={{ height: 'fit-content', padding: '0 0 1rem 0' }}>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/donations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import styled from 'styled-components'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { Divider, Panel } from '~/components'
import { RowBetween } from '~/components/Row'
Expand All @@ -14,7 +14,7 @@ import { withPerformanceLogging } from '~/utils/perf'
function Section({ title, children }) {
return (
<>
<TYPE.largeHeader>{title}</TYPE.largeHeader>
<Header>{title}</Header>
<TYPE.main>{children}</TYPE.main>
</>
)
Expand All @@ -40,7 +40,7 @@ function PressPage({ protocols }) {
return (
<Layout title="Donations - DefiLlama" defaultSEO>
<RowBetween>
<TYPE.largeHeader>Donations</TYPE.largeHeader>
<Header>Donations</Header>
</RowBetween>
<Panel style={{ marginTop: '6px' }}>
<DashGrid style={{ height: 'fit-content', padding: '0 0 1rem 0' }}>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/expenses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Layout from '~/layout'
import { withPerformanceLogging } from '~/utils/perf'

import { fetchWithErrorLogging } from '~/utils/async'
import { Header } from '~/Theme'

const fetch = fetchWithErrorLogging

Expand Down Expand Up @@ -43,6 +44,7 @@ export const getStaticProps = withPerformanceLogging('expenses', async () => {
export default function Protocols(props) {
return (
<Layout title={`Protocol Expenses - DefiLlama`} defaultSEO>
<Header>Protocol Expenses</Header>
<TableWithSearch
data={props.expenses}
columns={expensesColumns}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/press.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import styled from 'styled-components'
import { Box } from 'rebass'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { Divider, Panel } from '~/components'
import { RowBetween } from '~/components/Row'
Expand Down Expand Up @@ -76,7 +76,7 @@ function PressPage() {
return (
<Layout title="Press - DefiLlama" defaultSEO>
<RowBetween>
<TYPE.largeHeader>Press & Media</TYPE.largeHeader>
<Header>Press & Media</Header>
</RowBetween>
<Panel style={{ marginTop: '6px' }}>
<DashGrid style={{ height: 'fit-content', padding: '0 0 1rem 0' }}>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/top-gainers-and-losers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import styled from 'styled-components'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { splitArrayByFalsyValues } from '~/components/Table/utils'
import { useCalcStakePool2Tvl } from '~/hooks/data'
Expand Down Expand Up @@ -43,7 +43,3 @@ export default function TopGainersLosers({ protocols }) {
</Layout>
)
}

const Header = styled(TYPE.largeHeader)`
margin: 12px 0 -12px !important;
`
4 changes: 2 additions & 2 deletions src/pages/top-protocols.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import styled from 'styled-components'
import { TYPE } from '~/Theme'
import { Header, TYPE } from '~/Theme'
import Layout from '~/layout'
import { CustomLink } from '~/components/Link'
import TokenLogo from '~/components/TokenLogo'
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function Chains({ data, columns }) {

return (
<Layout title="TVL Rankings - DefiLlama" defaultSEO>
<TYPE.largeHeader style={{ marginTop: '8px' }}>Top Protocols</TYPE.largeHeader>
<Header style={{ marginTop: '8px' }}>Top Protocols</Header>
<Table instance={instance} skipVirtualization />
</Layout>
)
Expand Down