fix: remove old `index.jsx` file
This commit is contained in:
parent
209d373516
commit
5a02cbfc9a
|
@ -1,76 +0,0 @@
|
||||||
import * as React from 'react'
|
|
||||||
import { useState } from 'react'
|
|
||||||
import { useSelector } from 'react-redux'
|
|
||||||
|
|
||||||
import Page from 'src/components/layout/Page'
|
|
||||||
|
|
||||||
import Layout from 'src/routes/safe/components/Layout'
|
|
||||||
import { useCheckForUpdates } from 'src/routes/safe/container/Hooks/useCheckForUpdates'
|
|
||||||
import { useLoadSafe } from 'src/routes/safe/container/Hooks/useLoadSafe'
|
|
||||||
import { safeParamAddressFromStateSelector } from 'src/routes/safe/store/selectors'
|
|
||||||
|
|
||||||
const INITIAL_STATE = {
|
|
||||||
sendFunds: {
|
|
||||||
isOpen: false,
|
|
||||||
selectedToken: undefined,
|
|
||||||
},
|
|
||||||
showReceive: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
const SafeView = () => {
|
|
||||||
const [state, setState] = useState(INITIAL_STATE)
|
|
||||||
const safeAddress = useSelector(safeParamAddressFromStateSelector)
|
|
||||||
|
|
||||||
useLoadSafe(safeAddress)
|
|
||||||
useCheckForUpdates()
|
|
||||||
|
|
||||||
const onShow = (action) => () => {
|
|
||||||
setState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
[`show${action}`]: true,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const onHide = (action) => () => {
|
|
||||||
setState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
[`show${action}`]: false,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const showSendFunds = (token) => {
|
|
||||||
setState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
sendFunds: {
|
|
||||||
isOpen: true,
|
|
||||||
selectedToken: token,
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const hideSendFunds = () => {
|
|
||||||
setState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
sendFunds: {
|
|
||||||
isOpen: false,
|
|
||||||
selectedToken: undefined,
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
const { sendFunds, showReceive } = state
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Page>
|
|
||||||
<Layout
|
|
||||||
hideSendFunds={hideSendFunds}
|
|
||||||
onHide={onHide}
|
|
||||||
onShow={onShow}
|
|
||||||
sendFunds={sendFunds}
|
|
||||||
showReceive={showReceive}
|
|
||||||
showSendFunds={showSendFunds}
|
|
||||||
/>
|
|
||||||
</Page>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SafeView
|
|
Loading…
Reference in New Issue