Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
update init#fixbuild#04
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJonaseb11 committed Nov 1, 2024
1 parent b5ed8f7 commit 50b867f
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 121 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/nextjs/app/(app)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const metadata: Metadata = {
export default function DashboardPage() {
return (
<>
<div className="flex justify-center w-full ">
<p>Welcome, Partner! Start by claiming a role!🤝</p>
<div className="flex justify-center w-full mb-2 ">
<p className="text-2xl text-sky-500 ">Wallet connected successfully!! Start by claiming a role!🤝</p>
</div>
<div className="w-full min-h-full flex justify-center bg-neutral-100 shadow-2xl">
<ClaimRoleCard />
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/components/dashboard/ClaimRoleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const ClaimRoleCard: React.FC = () => {

return (

<div className="flex flex-col max-w-72 gap-4 bg-neutral-100 px-12 py-16 rounded-xl shadow mr-10">
<p>Welcome, Partner! Start by claiming a role!🤝</p>
<div className="flex flex-col max-w-72 gap-4 bg-neutral-100 px-12 py-8 rounded-xl shadow mr-10">
<p>Welcome, Partner! Start here by claiming a role!</p>
<p className="text-2xl text-center text-neutral-800">Congratulations!</p>
<p className="text-center text-neutral-500">
Claim a role that will be used to identify you on the Stoneproof platform.
Expand Down
9 changes: 7 additions & 2 deletions packages/nextjs/components/dashboard/DataRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ export const DataRegistry: React.FC = () => {
const fetchDataRecords = async () => {
setIsLoading(true);
try {
if (!window.ethereum) {
// Check if `window` is defined and `ethereum` is available to avoid server-side errors
if (typeof window !== "undefined" && !window.ethereum) {
alert("Please install MetaMask or any other EVM-wallet");
return;
}

// If `window` is defined, proceed with accessing `window.ethereum`
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const contractAddress = "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0";
Expand All @@ -45,7 +47,10 @@ export const DataRegistry: React.FC = () => {
};

useEffect(() => {
fetchDataRecords();
// Ensure fetchDataRecords runs only on the client side
if (typeof window !== "undefined") {
fetchDataRecords();
}
}, []);

return (
Expand Down
Loading

0 comments on commit 50b867f

Please sign in to comment.