diff --git a/src/components/Alert.tsx b/src/components/Alert.tsx index c2f315dc..6d8f5166 100644 --- a/src/components/Alert.tsx +++ b/src/components/Alert.tsx @@ -1,14 +1,16 @@ -import { Box, Typography } from '@mui/material' +import { Box, SxProps, Typography } from '@mui/material' import React from 'react' const Alert = ({ variant, title, content, + sx, }: { - variant: 'info' | 'negative' + variant: 'info' | 'negative' | 'warning' title?: string content: string + sx?: SxProps }) => { return ( @@ -55,6 +66,17 @@ const Alert = ({ /> )} + {variant === 'warning' && ( + + + + )} {title && ( diff --git a/src/helpers/useSmartContract.tsx b/src/helpers/useSmartContract.tsx index 8987e344..8a03a4c8 100644 --- a/src/helpers/useSmartContract.tsx +++ b/src/helpers/useSmartContract.tsx @@ -126,9 +126,6 @@ export const SmartContractProvider: React.FC = ({ ch ) setProvider(ethersProvider) setManagerReadContract(managerReadOnlyContract) - // const allCMAccounts = await getCMAccountMappings() - // let result = allCMAccounts.getAllMappings() - // console.log(result) } catch (error) { console.error('User denied account access:', error) } diff --git a/src/redux/services/partners.ts b/src/redux/services/partners.ts index c188ef67..3a91d3d7 100644 --- a/src/redux/services/partners.ts +++ b/src/redux/services/partners.ts @@ -93,7 +93,7 @@ async function getContractMappings(): Promise> { function checkMatch(data): boolean { if (data.supportedResult.length === 0 && data.wantedResult.length === 0) { - return true + return false } const supportedResultSet = new Set(data.supportedResult.map(getServiceName)) diff --git a/src/views/partners/ConfigurSupplier.tsx b/src/views/partners/ConfigurSupplier.tsx index 7fbefad2..4c8ba5dc 100644 --- a/src/views/partners/ConfigurSupplier.tsx +++ b/src/views/partners/ConfigurSupplier.tsx @@ -294,7 +294,6 @@ export const BasicSupportedServices = () => { }) useEffect(() => { if (partner) { - console.log({ supportedServices: partner.supportedServices }) dispatchSupplierState({ type: actionTypes.UPDATE_SUPPORTED_SERVICES, payload: { services: partner.supportedServices, reset: true }, diff --git a/src/views/partners/Configuration.tsx b/src/views/partners/Configuration.tsx index 7d65ab45..a6079b87 100644 --- a/src/views/partners/Configuration.tsx +++ b/src/views/partners/Configuration.tsx @@ -29,12 +29,14 @@ const Content = () => { const { state, dispatch } = usePartnerConfigurationContext() const [loading, setLoading] = useState(false) const partnerConfig = usePartnerConfig() + async function submit() { setLoading(true) await partnerConfig.CreateConfiguration(state) setLoading(false) } const { balance } = useWalletBalance() + if (contractCMAccountAddress) return return ( { )} - + Create Configuration + + + {state.step === 0 && ( diff --git a/src/views/partners/MyMessenger.tsx b/src/views/partners/MyMessenger.tsx index 92364f6d..af855e53 100644 --- a/src/views/partners/MyMessenger.tsx +++ b/src/views/partners/MyMessenger.tsx @@ -454,7 +454,11 @@ const MyMessenger = () => { Offered Services - {getServicesNames(state.stepsConfig[1]?.services)} + {state.stepsConfig[1]?.services.length > 0 ? ( + getServicesNames(state.stepsConfig[1]?.services) + ) : ( + <>None + )} @@ -462,7 +466,11 @@ const MyMessenger = () => { Wanted Services - {getServicesNames(state.stepsConfig[2]?.services)} + {state.stepsConfig[2]?.services.length > 0 ? ( + getServicesNames(state.stepsConfig[2]?.services) + ) : ( + <>None + )} {/* { )} + {state.stepsConfig[1]?.services.length == 0 && ( + + )} + {state.stepsConfig[2]?.services.length == 0 && ( + + )} + {bots.length == 0 && ( + + )} - None. - +
  • + + None. + +
  • )} ) : (