From 35914c775ce10dcea3e31159e1a3e1e25009cec8 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Thu, 28 Nov 2024 16:13:36 +0300 Subject: [PATCH] fix mui --- .../TcHivemindDiscordAnswering.tsx | 16 +- .../TcHivemindDiscordLearnings.tsx | 16 +- .../TcDiscordIntegrationSettingsDialog.tsx | 19 +- src/pages/reputation-score/mint.tsx | 216 +++++++++--------- 4 files changed, 143 insertions(+), 124 deletions(-) diff --git a/src/components/communitySettings/HivemindSettings/TcHivemindDiscordAnswering.tsx b/src/components/communitySettings/HivemindSettings/TcHivemindDiscordAnswering.tsx index fb85c8c5..a77cf2f5 100644 --- a/src/components/communitySettings/HivemindSettings/TcHivemindDiscordAnswering.tsx +++ b/src/components/communitySettings/HivemindSettings/TcHivemindDiscordAnswering.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { TreeItem, TreeView } from '@mui/lab'; import { FormControlLabel } from '@mui/material'; +import { SimpleTreeView, TreeItem } from '@mui/x-tree-view'; import { MdChevronRight, MdExpandMore } from 'react-icons/md'; import { TbRefresh } from 'react-icons/tb'; @@ -142,14 +142,16 @@ function TcHivemindDiscordAnswering({ ) : ( - } - defaultExpandIcon={} + {discordPlatformChannels.map((channel, index) => ( ( @@ -215,7 +217,7 @@ function TcHivemindDiscordAnswering({ ))} ))} - + )} diff --git a/src/components/communitySettings/HivemindSettings/TcHivemindDiscordLearnings.tsx b/src/components/communitySettings/HivemindSettings/TcHivemindDiscordLearnings.tsx index bc7e4cb9..23d36f88 100644 --- a/src/components/communitySettings/HivemindSettings/TcHivemindDiscordLearnings.tsx +++ b/src/components/communitySettings/HivemindSettings/TcHivemindDiscordLearnings.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { TreeItem, TreeView } from '@mui/lab'; import { FormControlLabel } from '@mui/material'; +import { SimpleTreeView, TreeItem } from '@mui/x-tree-view'; import moment from 'moment'; import { MdCalendarMonth, MdExpandMore } from 'react-icons/md'; import { MdChevronRight } from 'react-icons/md'; @@ -203,14 +203,16 @@ function TcHivemindDiscordLearnings({ ) : ( - } - defaultExpandIcon={} + {discordPlatformChannels.map((channel, index) => ( ( @@ -276,7 +278,7 @@ function TcHivemindDiscordLearnings({ ))} ))} - + )} diff --git a/src/components/communitySettings/communityPlatforms/TcDiscordIntegrationSettingsDialog.tsx b/src/components/communitySettings/communityPlatforms/TcDiscordIntegrationSettingsDialog.tsx index 72f3b343..1b2306e8 100644 --- a/src/components/communitySettings/communityPlatforms/TcDiscordIntegrationSettingsDialog.tsx +++ b/src/components/communitySettings/communityPlatforms/TcDiscordIntegrationSettingsDialog.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react'; -import { TreeItem, TreeView } from '@mui/lab'; import { Alert, AlertTitle, @@ -7,6 +6,7 @@ import { FormControlLabel, Typography, } from '@mui/material'; +import { SimpleTreeView, TreeItem } from '@mui/x-tree-view'; import moment from 'moment'; import { useRouter } from 'next/router'; import { AiOutlineClose } from 'react-icons/ai'; @@ -15,6 +15,7 @@ import { IoClose, IoSettingsSharp } from 'react-icons/io5'; import { MdCalendarMonth, MdExpandMore } from 'react-icons/md'; import { MdChevronRight } from 'react-icons/md'; import { RiTimeLine } from 'react-icons/ri'; +import '@mui/lab'; import TcCommunityPlatformIcon from './TcCommunityPlatformIcon'; import TcButton from '../../shared/TcButton'; @@ -398,13 +399,15 @@ function TcDiscordIntegrationSettingsDialog({ ) : ( - } - defaultExpandIcon={} + {discordPlatformChannels?.map((channel, index) => ( {channel.subChannels.map((subChannel, index) => ( ))} - + )} @@ -528,7 +531,7 @@ function TcDiscordIntegrationSettingsDialog({ variant='h6' /> -
+
@@ -148,7 +151,7 @@ function Mint() { const ConnectWalletSection: React.FC = () => ( - + Connect Your Wallet To mint your reputation score, please connect your wallet. @@ -168,69 +171,72 @@ const AttestationSection: React.FC = ({ const router = useRouter(); const handleNavigation = () => { - const url = "https://identity-on-chain-platform.pages.dev/permissions"; + const url = 'https://identity-on-chain-platform.pages.dev/permissions'; router.push(url); }; - return( + return ( - - Join the On-Chain Platform - - TogetherCrew has partnered with an on-chain platform to create secure, - on-chain attestations of user credentials. With on-chain access, you can - grant permission to applications, enabling them to decrypt and verify - your credentials. - - {isConnected && ( - - {isLoading ? ( - - - - ) : ( - <> - {userProfile.length > 0 ? ( - userProfile.map((profile, index) => ( - - )) - ) : ( - - - No Attestations Found - - In order to mint your reputation score, you need to have - idenitifers connected to wallet address. please register - your wallet on On-chain platform and attestation your - idenitifers. - - - - - )} - - )} - - )} + + Join the On-Chain Platform + + TogetherCrew has partnered with an on-chain platform to create secure, + on-chain attestations of user credentials. With on-chain access, you + can grant permission to applications, enabling them to decrypt and + verify your credentials. + + {isConnected && ( + + {isLoading ? ( + + + + ) : ( + <> + {userProfile.length > 0 ? ( + userProfile.map((profile, index) => ( + + )) + ) : ( + + + No Attestations Found + + In order to mint your reputation score, you need to have + idenitifers connected to wallet address. please register + your wallet on On-chain platform and attestation your + idenitifers. + + + + + )} + + )} + + )} + - - ) - -} + ); +}; const MintSection: React.FC = ({ isLoading, @@ -248,11 +254,19 @@ const MintSection: React.FC = ({ args: [address, dynamicNFTModuleInfo?.metadata[0]?.tokenId], }); - const { writeContractAsync, isPending } = useWriteContract(); + const { + data: transactionHash, + writeContractAsync, + isPending, + } = useWriteContract(); + + const { isPending: isWaiting } = useWaitForTransactionReceipt({ + hash: transactionHash, + }); return ( - + Mint Your Reputation Score Mint your reputation score to gain access to exclusive features and @@ -315,13 +329,11 @@ const MintSection: React.FC = ({ '0x0', ], }); - showMessage('Minting successful', 'success'); } catch (error: any) { console.error('Mint failed:', error); - showMessage('Minting failed', 'error'); } }} - disabled={isPending || !dynamicNFTModuleInfo?.metadata[0]?.tokenId} + disabled={isPending || isWaiting || !dynamicNFTModuleInfo?.metadata[0]?.tokenId} > {isPending ? 'Minting...' : 'Mint Reputation Score'} @@ -335,47 +347,47 @@ const UserProfileBox: React.FC = ({ profile }) => { const router = useRouter(); const handleNavigation = () => { - const url = "https://identity-on-chain-platform.pages.dev/permissions"; + const url = 'https://identity-on-chain-platform.pages.dev/permissions'; router.push(url); }; - + return ( - - - - {capitalizeFirstLetter(profile.provider)} - - - - - + + + + {capitalizeFirstLetter(profile.provider)} + + + + + ); };