Improvements(lists): update defaults, style updates (#1270)
* update defaults, style updates * update icon color
This commit is contained in:
parent
a1000c6576
commit
8bed3900ba
@ -12,7 +12,7 @@ import {
|
|||||||
useUserSingleHopOnly
|
useUserSingleHopOnly
|
||||||
} from '../../state/user/hooks'
|
} from '../../state/user/hooks'
|
||||||
import { TYPE } from '../../theme'
|
import { TYPE } from '../../theme'
|
||||||
import { ButtonError, ButtonGray } from '../Button'
|
import { ButtonError } from '../Button'
|
||||||
import { AutoColumn } from '../Column'
|
import { AutoColumn } from '../Column'
|
||||||
import Modal from '../Modal'
|
import Modal from '../Modal'
|
||||||
import QuestionHelper from '../QuestionHelper'
|
import QuestionHelper from '../QuestionHelper'
|
||||||
@ -27,6 +27,10 @@ const StyledMenuIcon = styled(Settings)`
|
|||||||
> * {
|
> * {
|
||||||
stroke: ${({ theme }) => theme.text2};
|
stroke: ${({ theme }) => theme.text2};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:hover {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const StyledCloseIcon = styled(X)`
|
const StyledCloseIcon = styled(X)`
|
||||||
@ -115,11 +119,6 @@ const ModalContentWrapper = styled.div`
|
|||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
`
|
`
|
||||||
|
|
||||||
const ButtonWrapper = styled(ButtonGray)`
|
|
||||||
padding: 6px;
|
|
||||||
border-radius: 8px;
|
|
||||||
`
|
|
||||||
|
|
||||||
export default function SettingsTab() {
|
export default function SettingsTab() {
|
||||||
const node = useRef<HTMLDivElement>()
|
const node = useRef<HTMLDivElement>()
|
||||||
const open = useModalOpen(ApplicationModal.SETTINGS)
|
const open = useModalOpen(ApplicationModal.SETTINGS)
|
||||||
@ -180,7 +179,6 @@ export default function SettingsTab() {
|
|||||||
</ModalContentWrapper>
|
</ModalContentWrapper>
|
||||||
</Modal>
|
</Modal>
|
||||||
<StyledMenuButton onClick={toggle} id="open-settings-dialog-button">
|
<StyledMenuButton onClick={toggle} id="open-settings-dialog-button">
|
||||||
<ButtonWrapper width="fit-content">
|
|
||||||
<StyledMenuIcon />
|
<StyledMenuIcon />
|
||||||
{expertMode ? (
|
{expertMode ? (
|
||||||
<EmojiWrapper>
|
<EmojiWrapper>
|
||||||
@ -189,7 +187,6 @@ export default function SettingsTab() {
|
|||||||
</span>
|
</span>
|
||||||
</EmojiWrapper>
|
</EmojiWrapper>
|
||||||
) : null}
|
) : null}
|
||||||
</ButtonWrapper>
|
|
||||||
</StyledMenuButton>
|
</StyledMenuButton>
|
||||||
{open && (
|
{open && (
|
||||||
<MenuFlyout>
|
<MenuFlyout>
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
// the Uniswap Default token list lives here
|
|
||||||
export const DEFAULT_TOKEN_LIST_URL = 'tokens.uniswap.eth'
|
|
||||||
|
|
||||||
// used to mark unsupported tokens, these are hosted lists of unsupported tokens
|
// used to mark unsupported tokens, these are hosted lists of unsupported tokens
|
||||||
/**
|
/**
|
||||||
* @TODO add list from blockchain association
|
* @TODO add list from blockchain association
|
||||||
@ -38,4 +35,4 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
// default lists to be 'active' aka searched across
|
// default lists to be 'active' aka searched across
|
||||||
export const DEFAULT_ACTIVE_LIST_URLS: string[] = [DEFAULT_TOKEN_LIST_URL]
|
export const DEFAULT_ACTIVE_LIST_URLS: string[] = []
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Uniswap Default List",
|
"name": "Uniswap Default List",
|
||||||
"timestamp": "2021-01-11T23:59:53.688Z",
|
"timestamp": "2021-01-18T18:52:43.076Z",
|
||||||
"version": {
|
"version": {
|
||||||
"major": 1,
|
"major": 1,
|
||||||
"minor": 6,
|
"minor": 7,
|
||||||
"patch": 0
|
"patch": 0
|
||||||
},
|
},
|
||||||
"tags": {},
|
"tags": {},
|
||||||
@ -266,6 +266,22 @@
|
|||||||
"chainId": 1,
|
"chainId": 1,
|
||||||
"logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg"
|
"logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "USDCoin",
|
||||||
|
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
||||||
|
"symbol": "USDC",
|
||||||
|
"decimals": 6,
|
||||||
|
"chainId": 1,
|
||||||
|
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tether USD",
|
||||||
|
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
||||||
|
"symbol": "USDT",
|
||||||
|
"decimals": 6,
|
||||||
|
"chainId": 1,
|
||||||
|
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Wrapped BTC",
|
"name": "Wrapped BTC",
|
||||||
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
|
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { DEFAULT_ACTIVE_LIST_URLS } from './../../constants/lists'
|
import { DEFAULT_ACTIVE_LIST_URLS } from './../../constants/lists'
|
||||||
import { createStore, Store } from 'redux'
|
import { createStore, Store } from 'redux'
|
||||||
import { DEFAULT_LIST_OF_LISTS, DEFAULT_TOKEN_LIST_URL } from '../../constants/lists'
|
import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists'
|
||||||
import { updateVersion } from '../global/actions'
|
import { updateVersion } from '../global/actions'
|
||||||
import { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions'
|
import { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions'
|
||||||
import reducer, { ListsState } from './reducer'
|
import reducer, { ListsState } from './reducer'
|
||||||
@ -446,21 +446,12 @@ describe('list reducer', () => {
|
|||||||
it('all lists are empty', () => {
|
it('all lists are empty', () => {
|
||||||
const s = store.getState()
|
const s = store.getState()
|
||||||
Object.keys(s.byUrl).forEach(url => {
|
Object.keys(s.byUrl).forEach(url => {
|
||||||
if (url === DEFAULT_TOKEN_LIST_URL) {
|
|
||||||
expect(s.byUrl[url]).toEqual({
|
expect(s.byUrl[url]).toEqual({
|
||||||
error: null,
|
error: null,
|
||||||
current: null,
|
current: null,
|
||||||
loadingRequestId: null,
|
loadingRequestId: null,
|
||||||
pendingUpdate: null
|
pendingUpdate: null
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
expect(s.byUrl[url]).toEqual({
|
|
||||||
error: null,
|
|
||||||
current: null,
|
|
||||||
loadingRequestId: null,
|
|
||||||
pendingUpdate: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
it('sets initialized lists', () => {
|
it('sets initialized lists', () => {
|
||||||
@ -507,10 +498,6 @@ describe('list reducer', () => {
|
|||||||
expect(store.getState().byUrl['https://unpkg.com/@uniswap/default-token-list@latest']).toBeUndefined()
|
expect(store.getState().byUrl['https://unpkg.com/@uniswap/default-token-list@latest']).toBeUndefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('adds all the lists in the default list of lists', () => {
|
|
||||||
expect(Object.keys(store.getState().byUrl)).toContain(DEFAULT_TOKEN_LIST_URL)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('each of those initialized lists is empty', () => {
|
it('each of those initialized lists is empty', () => {
|
||||||
const byUrl = store.getState().byUrl
|
const byUrl = store.getState().byUrl
|
||||||
// note we don't expect the uniswap default list to be prepopulated
|
// note we don't expect the uniswap default list to be prepopulated
|
||||||
@ -533,14 +520,6 @@ describe('list reducer', () => {
|
|||||||
it('sets default list to selected list', () => {
|
it('sets default list to selected list', () => {
|
||||||
expect(store.getState().activeListUrls).toEqual(DEFAULT_ACTIVE_LIST_URLS)
|
expect(store.getState().activeListUrls).toEqual(DEFAULT_ACTIVE_LIST_URLS)
|
||||||
})
|
})
|
||||||
it('default list is initialized', () => {
|
|
||||||
expect(store.getState().byUrl[DEFAULT_TOKEN_LIST_URL]).toEqual({
|
|
||||||
error: null,
|
|
||||||
current: null,
|
|
||||||
loadingRequestId: null,
|
|
||||||
pendingUpdate: null
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user