SafeList types

This commit is contained in:
nicosampler 2020-08-03 12:35:40 -03:00
parent 7b2d7fd35d
commit 1bd028b97a
3 changed files with 18 additions and 3 deletions

View File

@ -5,6 +5,9 @@ import { AddressInfo, Icon, Text, ButtonLink } from '@gnosis.pm/safe-react-compo
import * as React from 'react'
import styled from 'styled-components'
import { SafeRecord } from 'src/routes/safe/store/models/safe'
import { DefaultSafe } from 'src/routes/safe/store/reducer/types/safe'
import { SetDefaultSafe } from 'src/routes/safe/store/actions/setDefaultSafe'
import { getNetwork } from 'src/config'
import DefaultBadge from './DefaultBadge'
import Hairline from 'src/components/layout/Hairline'
@ -78,7 +81,15 @@ const useStyles = makeStyles({
},
})
const SafeList = ({ currentSafe, defaultSafe, onSafeClick, safes, setDefaultSafe }) => {
type Props = {
currentSafe: string | null
defaultSafe: DefaultSafe
safes: SafeRecord[]
onSafeClick: () => void
setDefaultSafe: SetDefaultSafe
}
const SafeList = ({ currentSafe, defaultSafe, onSafeClick, safes, setDefaultSafe }: Props): React.ReactElement => {
const classes = useStyles()
return (

View File

@ -2,6 +2,8 @@ import { createAction } from 'redux-actions'
export const SET_DEFAULT_SAFE = 'SET_DEFAULT_SAFE'
const setDefaultSafe = createAction(SET_DEFAULT_SAFE)
export type SetDefaultSafe = (safe: string) => void
const setDefaultSafe: SetDefaultSafe = createAction(SET_DEFAULT_SAFE)
export default setDefaultSafe

View File

@ -3,8 +3,10 @@ import { Map } from 'immutable'
export type SafesMap = Map<string, SafeRecord>
export type DefaultSafe = 'NOT_ASKED' | string | undefined
export interface SafeReducerState {
defaultSafe: 'NOT_ASKED' | string | undefined
defaultSafe: DefaultSafe
safes: SafesMap
latestMasterContractVersion: string
}