Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RojhatToptamus committed Jun 26, 2024
1 parent 3aef170 commit aaddb38
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 96 deletions.
1 change: 1 addition & 0 deletions .next/trace
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"generate-buildid","duration":151,"timestamp":196797712252,"id":4,"parentId":1,"tags":{},"startTime":1719406393678,"traceId":"647503704223d41d"},{"name":"load-custom-routes","duration":136,"timestamp":196797712508,"id":5,"parentId":1,"tags":{},"startTime":1719406393678,"traceId":"647503704223d41d"},{"name":"next-build","duration":60165,"timestamp":196797653648,"id":1,"tags":{"buildMode":"default","isTurboBuild":"false","version":"14.2.4","isTurbopack":false},"startTime":1719406393619,"traceId":"647503704223d41d"}]
6 changes: 0 additions & 6 deletions packages/nextjs/app/dashboard/attestation/[uid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export default function AttestationPage({
});

useEffect(() => {
console.log("UUID:", uid);
console.log("Loading:", isLoading);
console.log("Success:", isSuccess);
console.log("Error:", isError);
console.log("Fetched Attestation:", fetchedAttestation);

if (isSuccess && fetchedAttestation) {
// Check if fetchedAttestation is an object
const rawAttestation = fetchedAttestation as any;
Expand Down
6 changes: 3 additions & 3 deletions packages/nextjs/app/dashboard/attestations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ const Attestations = () => {
recipient: shortAddress(event.args.recipient),
attester: shortAddress(event.args.attester),
uid: event.args.uid,
schema: (event.args.schema_uid).toString(),
timestamp: timeAgo((event.args.timestamp).toString()),
}))
schema: event.args.schema_uid.toString(),
timestamp: timeAgo(event.args.timestamp.toString()),
})),
);
}
}, [eventData]);
Expand Down
44 changes: 25 additions & 19 deletions packages/nextjs/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,41 @@
import Link from "next/link";
import React, { useState, useEffect } from "react";
import type { NextPage } from "next";
import { Bars3Icon, BugAntIcon,CheckBadgeIcon,DocumentTextIcon,CodeBracketIcon } from "@heroicons/react/24/outline";
import {
Bars3Icon,
BugAntIcon,
CheckBadgeIcon,
DocumentTextIcon,
CodeBracketIcon,
} from "@heroicons/react/24/outline";

const Dashboard = () => {
return (
<div>
<div className="flex-grow w-full mt-16 px-8 py-12 mt-36">
<div className="flex justify-center items-center gap-12 flex-col sm:flex-row ">
<div className="flex flex-col bg-[#475299] px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<CheckBadgeIcon className="h-8 w-8 fill-secondary" />
<p>
<div className="flex justify-center items-center gap-12 flex-col sm:flex-row ">
<div className="flex flex-col bg-[#475299] px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<CheckBadgeIcon className="h-8 w-8 fill-secondary" />
<p>
Start making attestations on existing schemas using the{" "}
<Link href="/dashboard/attestations" passHref className="link">
Attestations
</Link>{" "}
tab.
</p>
</div>
<div className="flex flex-col bg-[#475299] px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<DocumentTextIcon className="h-8 w-8 fill-secondary" />
<p>
<Link href="/dashboard/attestations" passHref className="link">
Attestations
</Link>{" "}
tab.
</p>
</div>
<div className="flex flex-col bg-[#475299] px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<DocumentTextIcon className="h-8 w-8 fill-secondary" />
<p>
Explore the schemas or create a new schema using the{" "}
<Link href="/dashboard/schemas" passHref className="link">
<Link href="/dashboard/schemas" passHref className="link">
Schemas
</Link>{" "}
tab.
</p>
</div>
</Link>{" "}
tab.
</p>
</div>
</div>
</div>
</div>
);
};
Expand Down
64 changes: 33 additions & 31 deletions packages/nextjs/app/dashboard/schemas/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Schemas = () => {
eventData.map((event) => ({
uid: event.args.uid,
schema: event.args.schema_record,
caller:shortAddress(event.args.caller),
caller: shortAddress(event.args.caller),
})),
);
}
Expand Down Expand Up @@ -102,38 +102,40 @@ const Schemas = () => {
</div>
) : (
<div>
<div className="overflow-x-auto shadow-md rounded-lg">
<table className="min-w-full bg-white border border-gray-200 ">
<thead>
<tr className="bg-gray-100 border-b">
<th className="px-4 py-2 text-[#495FA9]">UID</th>
<th className="px-4 py-2 text-[#495FA9]">Creator</th>
<th className="px-4 py-2 text-[#495FA9]">Schema Record</th>
</tr>
</thead>
<tbody>
{schemas.map((schema, index) => (
<tr key={index} className="border-b">
<td className="px-4 py-2">
<SchemaLink uid={schema.uid} />
</td>
<td className="px-4 py-2 text-[#495FA9]">
{schema.caller}
</td>
<td className="px-4 py-2 text-[#495FA9]">
{schema.schema}
</td>
<div className="overflow-x-auto shadow-md rounded-lg">
<table className="min-w-full bg-white border border-gray-200 ">
<thead>
<tr className="bg-gray-100 border-b">
<th className="px-4 py-2 text-[#495FA9]">UID</th>
<th className="px-4 py-2 text-[#495FA9]">Creator</th>
<th className="px-4 py-2 text-[#495FA9]">
Schema Record
</th>
</tr>
))}
</tbody>
</table>

</thead>
<tbody>
{schemas.map((schema, index) => (
<tr key={index} className="border-b">
<td className="px-4 py-2">
<SchemaLink uid={schema.uid} />
</td>
<td className="px-4 py-2 text-[#495FA9]">
{schema.caller}
</td>
<td className="px-4 py-2 text-[#495FA9]">
{schema.schema}
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-4 text-center">
<a className="text-[#495FA9]" href="/attestations">
View all Schemas
</a>
</div>
</div>
<div className="mt-4 text-center">
<a className="text-[#495FA9]" href="/attestations">
View all Schemas
</a>
</div></div>
)}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const Home: NextPage = () => {
const connectedAddress = useAccount();
return (
<>
<Dashboard />
<Dashboard />
</>
);
};

export default Home;
export default Home;
21 changes: 6 additions & 15 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,16 @@ export const Footer = () => {
return (
<div className="min-h-0 py-5 px-1 mb-11 lg:mb-0 bg-[#475299]">
<div>
<SwitchTheme
className={`pointer-events-auto ${
isLocalNetwork ? "self-end md:self-auto" : ""
}`}
/>
<SwitchTheme
className={`pointer-events-auto ${
isLocalNetwork ? "self-end md:self-auto" : ""
}`}
/>
</div>
<div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div className="text-center">
<a
href="https://olas.info/"
target="_blank"
rel="noreferrer"
className="link"
>
Visit Olas
</a>
</div>

</div>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const Header = () => {
const burgerMenuRef = useRef<HTMLDivElement>(null);
useOutsideClick(
burgerMenuRef,
useCallback(() => setIsDrawerOpen(false), [])
useCallback(() => setIsDrawerOpen(false), []),
);
return (
<div className="sticky lg:static top-0 navbar bg-[#475299] min-h-0 flex-shrink-0 justify-between z-20 px-0 sm:px-2">
Expand Down
19 changes: 0 additions & 19 deletions packages/nextjs/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,6 @@ export const fetchAllAttestations = async () => {
];
};

// Dummy fetch function to simulate fetching attestation data
export const fetchAttestation = async (uuid: string): Promise<Attestation> => {
// Replace this with your actual fetch call to get attestation data
return {
uid: uuid,
schema: "#159",
isEndorsement: true,
name: "Worked with",
domain: "via 0x794ce...",
context: "via 0x794ce...",
ipfsHash: "ipfs://QmZaTm...Jx3ziBQnPS",
from: "0x07a059F968efF2D70973Ed90abfb5B93DD6050198888792b5EAE5798BdE677E",
to: "0xd34d059F968efF2D70973Ed90abfb5B93DD6050198888792b5EAE5798BdE677E",
created: "06/22/2024 3:13:21 am",
expiration: "Never",
revoked: "No",
};
};

export const fetchTokenName = async (): Promise<any> => {
try {
const name = await contract.call("name");
Expand Down

0 comments on commit aaddb38

Please sign in to comment.