File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed
packages/apps/human-app/frontend Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ module.exports = {
3434 // allow imports from material react table library
3535 camelcase : [ 'error' , { allow : [ 'MRT_' ] } ] ,
3636 'react/jsx-pascal-case' : [ 'error' , { ignore : [ 'MRT_' ] } ] ,
37+ 'react/jsx-no-leaked-render' : 'off' ,
3738 '@typescript-eslint/restrict-template-expressions' : [
3839 'error' ,
3940 {
Original file line number Diff line number Diff line change 196196 "KYCInProgress" : " KYC in progress" ,
197197 "confirmEmail" : " Confirm email" ,
198198 "kycCompleted" : " KYC Completed" ,
199+ "kycDeclined" : " KYC Declined" ,
199200 "walletAddressMessage" : " This address is the wallet address where you will receive payments for completing tasks." ,
200201 "connectWallet" : " Connect Wallet" ,
201202 "walletConnected" : " Wallet Connected " ,
Original file line number Diff line number Diff line change 1+ import Grid from '@mui/material/Grid' ;
2+ import Typography from '@mui/material/Typography' ;
3+ import CancelIcon from '@mui/icons-material/Cancel' ;
4+
5+ interface ErrorLabelProps {
6+ children : string | React . ReactElement ;
7+ }
8+
9+ export function ErrorLabel ( { children } : ErrorLabelProps ) {
10+ if ( typeof children === 'string' ) {
11+ return (
12+ < Grid alignItems = "center" container gap = "0.5rem" padding = "0.5rem 0" >
13+ < Typography variant = "buttonLarge" > { children } </ Typography >
14+ < CancelIcon color = "error" fontSize = "small" />
15+ </ Grid >
16+ ) ;
17+ }
18+
19+ return children ;
20+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { RegisterAddressBtn } from '@/pages/worker/profile/register-address-btn'
1212import { DoneLabel } from '@/pages/worker/profile/done-label' ;
1313import { useRegisterAddressNotifications } from '@/hooks/use-register-address-notifications' ;
1414import { useRegisterAddressMutation } from '@/api/services/worker/use-register-address' ;
15+ import { ErrorLabel } from './error-label' ;
1516// import { RegisterAddressOnChainButton } from '@/pages/worker/profile/register-address-on-chain-btn';
1617
1718export function ProfileActions ( ) {
@@ -38,6 +39,8 @@ export function ProfileActions() {
3839 const { t } = useTranslation ( ) ;
3940 const emailVerified = user . status === 'active' ;
4041 const kycApproved = user . kyc_status === 'approved' ;
42+ const kycDeclined = user . kyc_status === 'declined' ;
43+ const kycToComplete = ! ( kycApproved || kycDeclined ) ;
4144
4245 const getConnectWalletBtn = ( ) => {
4346 switch ( true ) {
@@ -87,11 +90,13 @@ export function ProfileActions() {
8790 return (
8891 < Grid container flexDirection = "column" gap = "1rem" >
8992 < Grid >
90- { kycApproved ? (
93+ { kycApproved && (
9194 < DoneLabel > { t ( 'worker.profile.kycCompleted' ) } </ DoneLabel >
92- ) : (
93- < StartKycButton />
9495 ) }
96+ { kycDeclined && (
97+ < ErrorLabel > { t ( 'worker.profile.kycDeclined' ) } </ ErrorLabel >
98+ ) }
99+ { kycToComplete && < StartKycButton /> }
95100 </ Grid >
96101 < Grid > { getConnectWalletBtn ( ) } </ Grid >
97102 { kycApproved && ! user . wallet_address && isWalletConnected ? (
You can’t perform that action at this time.
0 commit comments