From afeb10aa3cd31c4712db6d8bfc7b7b0073c223bd Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Fri, 22 Nov 2024 11:44:11 +0300 Subject: [PATCH 1/6] update announcements --- src/pages/announcements/index.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/pages/announcements/index.tsx b/src/pages/announcements/index.tsx index 5c097159..89e4c495 100644 --- a/src/pages/announcements/index.tsx +++ b/src/pages/announcements/index.tsx @@ -24,6 +24,7 @@ import { IPlatformProps, } from '../../utils/interfaces'; import { withRoles } from '../../utils/withRoles'; +import { Link, Stack, Typography } from '@mui/material'; function Index() { const { retrieveAnnouncements, retrievePlatformById } = useAppStore(); @@ -175,11 +176,24 @@ function Index() {
- + + + + smart announcements allow you to send targeted messages to specific user segments. {" "} + + Learn more + + + } - variant='outlined' + variant='contained' onClick={() => router.push('/announcements/create-new-announcements') } From 1daa65568b02825f9bd3780c8ca0fd06e206c02f Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Fri, 22 Nov 2024 11:46:39 +0300 Subject: [PATCH 2/6] replace Tctext --- src/pages/announcements/index.tsx | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/pages/announcements/index.tsx b/src/pages/announcements/index.tsx index 89e4c495..01f9d336 100644 --- a/src/pages/announcements/index.tsx +++ b/src/pages/announcements/index.tsx @@ -1,3 +1,4 @@ +import { Link, Stack, Typography } from '@mui/material'; import moment from 'moment'; import router from 'next/router'; import React, { useEffect, useState } from 'react'; @@ -13,7 +14,6 @@ import TcBoxContainer from '../../components/shared/TcBox/TcBoxContainer'; import TcButton from '../../components/shared/TcButton'; import TcDatePickerPopover from '../../components/shared/TcDatePickerPopover'; import TcPagination from '../../components/shared/TcPagination'; -import TcText from '../../components/shared/TcText'; import { useToken } from '../../context/TokenContext'; import { defaultLayout } from '../../layouts/defaultLayout'; import { StorageService } from '../../services/StorageService'; @@ -24,7 +24,6 @@ import { IPlatformProps, } from '../../utils/interfaces'; import { withRoles } from '../../utils/withRoles'; -import { Link, Stack, Typography } from '@mui/material'; function Index() { const { retrieveAnnouncements, retrievePlatformById } = useAppStore(); @@ -177,16 +176,19 @@ function Index() {
- + + Announcement Scheduling + - smart announcements allow you to send targeted messages to specific user segments. {" "} + smart announcements allow you to send targeted messages to + specific user segments.{' '} - Learn more + Learn more @@ -233,16 +235,16 @@ function Index() {
) : (
- - + No announcements yet + + + > + Your announcements will show up for the month and timezone + selected once you create them{' '} +
)}
From c611059c1054e540a43088350d5a21f326c6c3b2 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Thu, 5 Dec 2024 20:54:28 +0300 Subject: [PATCH 3/6] update oci --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6f023c9..70724208 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "moment-timezone": "^0.5.38", "next": "^14.2.18", "next-router-mock": "^0.9.9", - "oci-js-sdk": "^1.6.1", + "oci-js-sdk": "^1.6.3", "papaparse": "^5.4.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -21268,9 +21268,9 @@ "license": "MIT" }, "node_modules/oci-js-sdk": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/oci-js-sdk/-/oci-js-sdk-1.6.1.tgz", - "integrity": "sha512-SJCjGutEo0mgXsQ1w9NSww7xWiMQ5ZOQsor9ufUBC6NjExxk3Yb8etd6MNMWoa1InISpxhNtu/REIEFwBeK1Yg==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/oci-js-sdk/-/oci-js-sdk-1.6.3.tgz", + "integrity": "sha512-qxel2knoiHReFvw/I5vNqo9/dSHRz3bzX1J3WmGnHLqlrupR1KNSXfxfNSwyjRF8eJjzDLMpJ+DSKZPOANO4zA==", "license": "ISC", "dependencies": { "@ethereum-attestation-service/eas-sdk": "^2.7.0", diff --git a/package.json b/package.json index 5559f2fb..830deb38 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "moment-timezone": "^0.5.38", "next": "^14.2.18", "next-router-mock": "^0.9.9", - "oci-js-sdk": "^1.6.1", + "oci-js-sdk": "^1.6.3", "papaparse": "^5.4.1", "react": "^18.3.1", "react-dom": "^18.3.1", From 98a0b0f5b22af0770be204e9a4c4bfa31bca7f64 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Fri, 6 Dec 2024 16:09:37 +0300 Subject: [PATCH 4/6] update url --- src/pages/reputation-score/mint.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/reputation-score/mint.tsx b/src/pages/reputation-score/mint.tsx index 3a8d5107..7f667059 100644 --- a/src/pages/reputation-score/mint.tsx +++ b/src/pages/reputation-score/mint.tsx @@ -170,7 +170,7 @@ const AttestationSection: React.FC = ({ }) => { const handleNavigation = () => { - const url = 'https://identity-on-chain-platform.pages.dev/permissions'; + const url = 'https://logid.xyz/permissions'; window.open(url, '_blank'); }; return ( @@ -346,7 +346,7 @@ const UserProfileBox: React.FC = ({ profile }) => { const router = useRouter(); const handleNavigation = () => { - const url = 'https://identity-on-chain-platform.pages.dev/permissions'; + const url = 'https://logid.xyz/permissions'; router.push(url); }; From e16b53318d1c54aae97067680eaddc5a697d6b25 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Fri, 6 Dec 2024 16:13:28 +0300 Subject: [PATCH 5/6] update --- src/pages/reputation-score/mint.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/reputation-score/mint.tsx b/src/pages/reputation-score/mint.tsx index 7f667059..bed43bb6 100644 --- a/src/pages/reputation-score/mint.tsx +++ b/src/pages/reputation-score/mint.tsx @@ -170,7 +170,7 @@ const AttestationSection: React.FC = ({ }) => { const handleNavigation = () => { - const url = 'https://logid.xyz/permissions'; + const url = 'https://app.logid.xyz/permissions'; window.open(url, '_blank'); }; return ( @@ -346,7 +346,7 @@ const UserProfileBox: React.FC = ({ profile }) => { const router = useRouter(); const handleNavigation = () => { - const url = 'https://logid.xyz/permissions'; + const url = 'https://app.logid.xyz/permissions'; router.push(url); }; From cf5d6431eff12ae915a2761e1852be3ff1a0c1e8 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Tue, 10 Dec 2024 11:48:25 +0300 Subject: [PATCH 6/6] fix --- src/pages/reputation-score/[...score].tsx | 7 +-- src/pages/reputation-score/mint.tsx | 63 +++++++++++++++-------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/pages/reputation-score/[...score].tsx b/src/pages/reputation-score/[...score].tsx index 965c2cb7..27f8b945 100644 --- a/src/pages/reputation-score/[...score].tsx +++ b/src/pages/reputation-score/[...score].tsx @@ -10,6 +10,7 @@ import TcBoxContainer from '@/components/shared/TcBox/TcBoxContainer'; import useAppStore from '@/store/useStore'; import { useSnackbar } from '@/context/SnackbarContext'; +import { withRoles } from '@/utils/withRoles'; const ScorePage = () => { const { showMessage } = useSnackbar(); @@ -41,19 +42,15 @@ const ScorePage = () => { const fetchReputationScore = async () => { setLoading(true); try { - console.log('Fetching reputation score for:', { tokenId, address }); - const score = await retrieveReputationScore({ tokenId, address, }); - console.log('Reputation Score Retrieved:', score); setReputationScore(score.reputationScore ?? 0); setCommunityName(score.communityName); } catch (error) { console.error('Error fetching reputation score:', error); - showMessage('Failed to load reputation score.', 'error'); } finally { setLoading(false); } @@ -176,4 +173,4 @@ const ScorePage = () => { ); }; -export default ScorePage; +export default withRoles(ScorePage, []); diff --git a/src/pages/reputation-score/mint.tsx b/src/pages/reputation-score/mint.tsx index bed43bb6..147a05aa 100644 --- a/src/pages/reputation-score/mint.tsx +++ b/src/pages/reputation-score/mint.tsx @@ -73,6 +73,7 @@ function Mint() { address, conf.APP_DEVELOPER_PUBLIC_ADDRESS as `0x${string}` ); + setUserProfile(result); setLoading(false); } catch (error) { @@ -168,7 +169,6 @@ const AttestationSection: React.FC = ({ isLoading, userProfile, }) => { - const handleNavigation = () => { const url = 'https://app.logid.xyz/permissions'; window.open(url, '_blank'); @@ -246,7 +246,7 @@ const MintSection: React.FC = ({ const { address } = useAccount(); const { dynamicNFTModuleInfo } = useAppStore(); - const { data: hasMinted } = useReadContract({ + const { data: hasMinted, refetch } = useReadContract({ address: engagementContract?.address as `0x${string}`, abi: engagementContract?.abi as Abi, functionName: 'balanceOf', @@ -259,10 +259,39 @@ const MintSection: React.FC = ({ isPending, } = useWriteContract(); - const { isPending: isWaiting } = useWaitForTransactionReceipt({ + const handleMintNFT = async () => { + try { + await writeContractAsync({ + address: engagementContract?.address as `0x${string}`, + abi: engagementContract?.abi as Abi, + functionName: 'mint', + args: [address, dynamicNFTModuleInfo.metadata[0].tokenId, 1, '0x0'], + }); + } catch (error: any) { + console.error('Mint failed:', error); + } + }; + + const { + data: receipt, + isSuccess, + isError, + isFetching: isWaitingForReceiptConfirmation, + } = useWaitForTransactionReceipt({ hash: transactionHash, }); + useEffect(() => { + if (receipt && isSuccess) { + showMessage( + 'Your Reputation NFT has been successfully minted!', + 'success' + ); + + refetch(); + } + }, [receipt, isSuccess, isError]); + return ( @@ -315,26 +344,16 @@ const MintSection: React.FC = ({ )}