Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

feat(metadata): add application name #1174

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions frontend/components/hypercert-create.tsx
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ const DEFAULT_FORM_DATA: HypercertCreateFormData = {
backgroundVectorArt: "",
metadataProperties: "",
transferRestrictions: TransferRestrictions.FromCreatorOnly,
applicationName: "hypercerts.org",
};

interface HypercertCreateFormData {
@@ -91,6 +92,7 @@ interface HypercertCreateFormData {
backgroundVectorArt: string;
metadataProperties: string;
transferRestrictions: TransferRestrictions;
applicationName: string;
}

/**
@@ -475,10 +477,16 @@ const formatValuesToMetaData = (
? new Date(val.workTimeEnd).getTime() / 1000
: 0;

let properties = [];
let properties = [
{
trait_type: "Minted by",
value: "true",
application: val.applicationName,
},
];
if (val.metadataProperties) {
try {
properties = JSON.parse(val.metadataProperties);
properties = [...properties, ...JSON.parse(val.metadataProperties)];
} catch (e) {
console.warn(
`Unable to parse metadataProperties: ${val.metadataProperties}`,
4 changes: 4 additions & 0 deletions frontend/plasmic-init.ts
Original file line number Diff line number Diff line change
@@ -243,6 +243,10 @@ PLASMIC.registerComponent(HypercertCreateForm, {
options: ["AllowAll", "DisallowAll", "FromCreatorOnly"],
defaultValueHint: "FromCreatorOnly",
},
applicationName: {
type: "string",
defaultValueHint: "hypercerts.org/create",
},
},
providesData: true,
importPath: "./components/hypercert-create",