55 Typography , Box , Paper , Grid , Chip , Table , TableBody , TableCell ,
66 TableContainer , TableHead , TableRow , TextField , Button , Alert ,
77 CircularProgress , Select , MenuItem , FormControl , InputLabel ,
8- useMediaQuery , useTheme ,
8+ useMediaQuery , useTheme , Tabs , Tab ,
99} from "@mui/material" ;
1010import { useAccount , useReadContract , useReadContracts } from "wagmi" ;
1111import { useSearchParams } from "next/navigation" ;
@@ -157,6 +157,7 @@ function OwnerActions({ memberWallet }: { memberWallet: string }) {
157157 const { data : rewardTypesData } = useRewardTypes ( ) ;
158158
159159 const [ disclaimer , setDisclaimer ] = useState ( false ) ;
160+ const [ actionTab , setActionTab ] = useState ( 0 ) ;
160161
161162 if ( ! isOwner ) return null ;
162163
@@ -166,10 +167,15 @@ function OwnerActions({ memberWallet }: { memberWallet: string }) {
166167 < TextField label = "Program ID" value = { actionProgramId } onChange = { ( e ) => setActionProgramId ( e . target . value ) }
167168 type = "number" size = "small" sx = { { width : 150 , mb : 2 } } />
168169
169- < Grid container spacing = { 3 } >
170- { /* Deposit */ }
171- < Grid item xs = { 12 } md = { 4 } >
172- < Typography variant = "subtitle2" gutterBottom > Deposit FULA</ Typography >
170+ < Tabs value = { actionTab } onChange = { ( _ , v ) => setActionTab ( v ) } sx = { { borderBottom : 1 , borderColor : "divider" } } >
171+ < Tab label = "Deposit" />
172+ < Tab label = "Transfer to Parent" />
173+ < Tab label = "Withdraw" />
174+ </ Tabs >
175+
176+ { /* Deposit */ }
177+ { actionTab === 0 && (
178+ < Box sx = { { pt : 2 , maxWidth : 480 } } >
173179 < TextField label = "Amount (FULA)" value = { depositAmount } onChange = { ( e ) => setDepositAmount ( e . target . value ) }
174180 fullWidth size = "small" type = "number" />
175181 < FormControl fullWidth size = "small" sx = { { mt : 1 } } >
@@ -196,11 +202,12 @@ function OwnerActions({ memberWallet }: { memberWallet: string }) {
196202 </ Box >
197203 { depositSuccess && < Alert severity = "success" sx = { { mt : 1 } } > Deposited!</ Alert > }
198204 { depositError && < Alert severity = "error" sx = { { mt : 1 } } > { formatContractError ( depositError ) } </ Alert > }
199- </ Grid >
205+ </ Box >
206+ ) }
200207
201- { /* Transfer to Parent */ }
202- < Grid item xs = { 12 } md = { 4 } >
203- < Typography variant = "subtitle2" gutterBottom > Transfer to Parent </ Typography >
208+ { /* Transfer to Parent */ }
209+ { actionTab === 1 && (
210+ < Box sx = { { pt : 2 , maxWidth : 480 } } >
204211 { transferLimitData != null && Number ( transferLimitData ) > 0 && (
205212 < Alert severity = "info" sx = { { mb : 1 } } >
206213 Transfer limit: < strong > { Number ( transferLimitData ) } %</ strong > of total balance (Clients only).
@@ -217,11 +224,12 @@ function OwnerActions({ memberWallet }: { memberWallet: string }) {
217224 </ Button >
218225 { transBackSuccess && < Alert severity = "success" sx = { { mt : 1 } } > Transferred!</ Alert > }
219226 { transBackError && < Alert severity = "error" sx = { { mt : 1 } } > { formatContractError ( transBackError ) } </ Alert > }
220- </ Grid >
227+ </ Box >
228+ ) }
221229
222- { /* Withdraw */ }
223- < Grid item xs = { 12 } md = { 4 } >
224- < Typography variant = "subtitle2" gutterBottom > Withdraw </ Typography >
230+ { /* Withdraw */ }
231+ { actionTab === 2 && (
232+ < Box sx = { { pt : 2 , maxWidth : 480 } } >
225233 < TextField label = "Amount (FULA)" value = { withdrawAmount } onChange = { ( e ) => setWithdrawAmount ( e . target . value ) }
226234 fullWidth size = "small" type = "number" />
227235 < Button size = "small" variant = "contained" color = "secondary" sx = { { mt : 1 } }
@@ -231,8 +239,8 @@ function OwnerActions({ memberWallet }: { memberWallet: string }) {
231239 </ Button >
232240 { withdrawSuccess && < Alert severity = "success" sx = { { mt : 1 } } > Withdrawn!</ Alert > }
233241 { withdrawError && < Alert severity = "error" sx = { { mt : 1 } } > { formatContractError ( withdrawError ) } </ Alert > }
234- </ Grid >
235- </ Grid >
242+ </ Box >
243+ ) }
236244
237245 < OnChainDisclaimer accepted = { disclaimer } onChange = { setDisclaimer } />
238246 </ Paper >
0 commit comments