Improvements(lists): update defaults, style updates (#1270)

* update defaults, style updates

* update icon color
This commit is contained in:
Ian Lapham 2021-01-18 14:40:42 -05:00 committed by GitHub
parent a1000c6576
commit 8bed3900ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 50 deletions

@ -12,7 +12,7 @@ import {
useUserSingleHopOnly
} from '../../state/user/hooks'
import { TYPE } from '../../theme'
import { ButtonError, ButtonGray } from '../Button'
import { ButtonError } from '../Button'
import { AutoColumn } from '../Column'
import Modal from '../Modal'
import QuestionHelper from '../QuestionHelper'
@ -27,6 +27,10 @@ const StyledMenuIcon = styled(Settings)`
> * {
stroke: ${({ theme }) => theme.text2};
}
:hover {
opacity: 0.7;
}
`
const StyledCloseIcon = styled(X)`
@ -115,11 +119,6 @@ const ModalContentWrapper = styled.div`
border-radius: 20px;
`
const ButtonWrapper = styled(ButtonGray)`
padding: 6px;
border-radius: 8px;
`
export default function SettingsTab() {
const node = useRef<HTMLDivElement>()
const open = useModalOpen(ApplicationModal.SETTINGS)
@ -180,16 +179,14 @@ export default function SettingsTab() {
</ModalContentWrapper>
</Modal>
<StyledMenuButton onClick={toggle} id="open-settings-dialog-button">
<ButtonWrapper width="fit-content">
<StyledMenuIcon />
{expertMode ? (
<EmojiWrapper>
<span role="img" aria-label="wizard-icon">
🧙
</span>
</EmojiWrapper>
) : null}
</ButtonWrapper>
<StyledMenuIcon />
{expertMode ? (
<EmojiWrapper>
<span role="img" aria-label="wizard-icon">
🧙
</span>
</EmojiWrapper>
) : null}
</StyledMenuButton>
{open && (
<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
/**
* @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
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",
"timestamp": "2021-01-11T23:59:53.688Z",
"timestamp": "2021-01-18T18:52:43.076Z",
"version": {
"major": 1,
"minor": 6,
"minor": 7,
"patch": 0
},
"tags": {},
@ -266,6 +266,22 @@
"chainId": 1,
"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",
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",

@ -1,6 +1,6 @@
import { DEFAULT_ACTIVE_LIST_URLS } from './../../constants/lists'
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 { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions'
import reducer, { ListsState } from './reducer'
@ -446,21 +446,12 @@ describe('list reducer', () => {
it('all lists are empty', () => {
const s = store.getState()
Object.keys(s.byUrl).forEach(url => {
if (url === DEFAULT_TOKEN_LIST_URL) {
expect(s.byUrl[url]).toEqual({
error: null,
current: null,
loadingRequestId: null,
pendingUpdate: null
})
} else {
expect(s.byUrl[url]).toEqual({
error: null,
current: null,
loadingRequestId: null,
pendingUpdate: null
})
}
expect(s.byUrl[url]).toEqual({
error: null,
current: null,
loadingRequestId: null,
pendingUpdate: null
})
})
})
it('sets initialized lists', () => {
@ -507,10 +498,6 @@ describe('list reducer', () => {
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', () => {
const byUrl = store.getState().byUrl
// 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', () => {
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
})
})
})
})
})