Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RojhatToptamus committed Jun 26, 2024
1 parent 4a59c4c commit 76d3f0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions packages/nextjs/app/dashboard/attestations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from "next/link";
import { useScaffoldEventHistory } from "~~/hooks/scaffold-stark/useScaffoldEventHistory";
import Modal from "~~/components/Modal";
import CreateAttestationForm from "~~/components/forms/CreateAttestationForm";
import { shortAddress, timeAgo } from "~~/utils/utils";

const Attestations = () => {
const [totalAttestations, setTotalAttestations] = useState<number>(0);
Expand Down Expand Up @@ -41,11 +42,11 @@ const Attestations = () => {
setTotalAttestations(eventData.length);
setAttestations(
eventData.map((event) => ({
recipient: event.args.recipient,
attester: event.args.attester,
recipient: shortAddress(event.args.recipient),
attester: shortAddress(event.args.attester),
uid: event.args.uid,
schema: event.args.schema_uid,
timestamp: event.args.timestamp,
schema: (event.args.schema_uid).toString(),
timestamp: timeAgo((event.args.timestamp).toString()),
}))
);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/app/dashboard/schemas/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from "next/link";
import { useScaffoldEventHistory } from "~~/hooks/scaffold-stark/useScaffoldEventHistory";
import Modal from "~~/components/Modal";
import RegisterSchemaForm from "~~/components/forms/RegisterSchemaForm";
import { shortAddress } from "~~/utils/utils";

const Schemas = () => {
const [totalSchemas, setTotalSchemas] = useState<number>(0);
Expand Down Expand Up @@ -31,7 +32,7 @@ const Schemas = () => {
eventData.map((event) => ({
uid: event.args.uid,
schema: event.args.schema_record,
caller: event.args.caller,
caller:shortAddress(event.args.caller),
})),
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ export const shortAddress = (addr: string): string => {
return "";
}
return (
addr.toString().substring(0, 6) +
addr.toString().substring(0, 8) +
"..." +
addr
.toString()
.substring(addr.toString().length - 6, addr.toString().length + 1)
.substring(addr.toString().length - 8, addr.toString().length + 1)
);
};

Expand Down

0 comments on commit 76d3f0a

Please sign in to comment.