Skip to content

Commit

Permalink
feat: NDA template
Browse files Browse the repository at this point in the history
- Added "styled-components" as a dependency in the package.json file.
- Created a new NDA template file and added it to the template registry.
- Added a new story file for the NDA template.
- Created types for the NDA template.
- Added styles for the NDA template.
  • Loading branch information
deblanco committed Oct 15, 2024
1 parent 5f8d755 commit 9799df8
Show file tree
Hide file tree
Showing 10 changed files with 482 additions and 1,416 deletions.
1,555 changes: 140 additions & 1,415 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^6.1.13",
"xml2js": "^0.6.2"
},
"devDependencies": {
Expand Down
156 changes: 156 additions & 0 deletions src/templates/NDA/NDA.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { TemplateProps } from "@tradetrust-tt/decentralized-renderer-react-components";
import React, { FunctionComponent } from "react";
import { getDocumentData } from "../../utils";
import { TemplateNdaDocument, TemplateNdaSchema } from "./types";
import { NdaBody, NdaPoweredBy, NdaWrapper } from "./NDAStyles";

const Content = (document: TemplateNdaDocument): JSX.Element => {
return (
<NdaWrapper>
<NdaBody>
<h1>NON-DISCLOSURE AGREEMENT (NDA)</h1>
<p>
This Non-Disclosure Agreement (the “Agreement”) is entered into as of
the [DATE], by and between:
</p>
<p>
<b>{document.disclosingParty.name}</b>,<br />
with a principal place of business at{" "}
{document.disclosingParty.address}
<br /> (hereinafter referred to as “Disclosing Party”),
</p>
<p>and</p>
<p>
<b>{document.receivingParty.name}</b>,<br />
with a principal place of business at{" "}
{document.receivingParty.address}
<br /> (hereinafter referred to as “Receiving Party”).
</p>
<h2>1. Definition of Confidential Information</h2>
<p>
“Confidential Information” means any and all technical and
non-technical information disclosed by Disclosing Party to Receiving
Party, including but not limited to:
</p>
<ul>
<li>
business strategies, customer information, financial data, software,
hardware, inventions, and know-how;
</li>
<li>
any other information that, due to the nature of its content or the
circumstances surrounding its disclosure, the Receiving Party should
reasonably understand to be confidential.
</li>
</ul>
<h2>2. Obligations of Receiving Party</h2>
<p>The Receiving Party shall:</p>
<ul>
<li>
Maintain the confidentiality of the Confidential Information and not
disclose it to any third parties, except as required by law or with
written permission from the Disclosing Party.
</li>
<li>
Use the Confidential Information only for the purpose of{" "}
{document.purpose}.
</li>
<li>
Take all reasonable precautions to protect the confidentiality of
the Confidential Information.
</li>
</ul>
<h2>3. Exclusions from Confidential Information</h2>
<p>Confidential Information does not include information that:</p>
<ul>
<li>
Is or becomes publicly known through no breach of this Agreement by
the Receiving Party;
</li>
<li>
Is disclosed to the Receiving Party by a third party without breach
of any confidentiality obligation;
</li>
<li>
Is independently developed by the Receiving Party without the use of
the Confidential Information.
</li>
</ul>
<h2>4. Term</h2>
<p>
This Agreement shall commence on the Effective Date and shall continue
until the Confidential Information no longer qualifies as confidential
or until terminated by either party with written notice.
</p>
<h2>5. Return of Materials</h2>
<p>
Upon termination or expiration of this Agreement, or upon request by
the Disclosing Party, the Receiving Party shall return or destroy all
documents or other tangible materials containing Confidential
Information.
</p>
<h2>6. No License</h2>
<p>
Nothing in this Agreement grants the Receiving Party any rights to the
Disclosing Party’s intellectual property or other proprietary rights.
</p>
<h2>7. Remedies</h2>
<p>
The Receiving Party acknowledges that any breach of this Agreement may
cause irreparable harm to the Disclosing Party, and agrees that the
Disclosing Party shall be entitled to seek injunctive relief in
addition to any other remedies available at law.
</p>
<h2>8. Governing Law</h2>
<p>
This Agreement shall be governed by and construed in accordance with
the laws of {document.governingLawStateCountry}.
</p>
<h2>9. Entire Agreement</h2>
<p>
This Agreement constitutes the entire agreement between the parties
with respect to the subject matter hereof and supersedes all prior
agreements, understandings, and communications.
</p>

<h2>10. Miscellaneous</h2>
<ul>
<li>
No amendment or waiver of any provision of this Agreement shall be
effective unless in writing and signed by both parties.
</li>
<li>
If any provision of this Agreement is held to be invalid or
unenforceable, the remainder of this Agreement shall continue in
full force and effect.
</li>
</ul>
</NdaBody>
<NdaPoweredBy>
<a
href="https://stabilityprotocol.com"
target="_blank"
rel="noreferrer"
>
<img
src="data:image/svg+xml,%3csvg%20width='25'%20height='31'%20viewBox='0%200%2025%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2024.1065L12.4161%2017.1897L24.8323%2024.1244L12.4161%2030.9997L0%2024.1065Z'%20fill='%230A0A0A'/%3e%3cpath%20d='M0%206.91602L12.4161%2013.7925V27.4893L0%2020.7428V6.91602Z'%20fill='%233E7CB1'/%3e%3cpath%20d='M24.8321%206.93469L12.416%2013.81V27.508L24.8321%2020.7615V6.93469Z'%20fill='%2330C5FF'/%3e%3cpath%20d='M0%206.91677L12.4161%200L24.8323%206.9347L12.4161%2013.81L0%206.91677Z'%20fill='%2341EEF9'/%3e%3c/svg%3e"
alt="cube"
// style="height: 1.5rem; margin-right: 0.5rem; margin-left: 0px;"
/>
<span>Powered by STABILITY</span>
</a>
</NdaPoweredBy>
</NdaWrapper>
);
};

export const TemplateNda: FunctionComponent<
TemplateProps<TemplateNdaSchema>
> = ({ document }) => {
const documentData = getDocumentData(document) as TemplateNdaDocument;
return (
<>
<div>{Content(documentData)}</div>
</>
);
};
58 changes: 58 additions & 0 deletions src/templates/NDA/NDAStyles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import styled from "styled-components";

export const NdaWrapper = styled.div`
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
`;

export const NdaBody = styled.div`
width: 100%;
max-width: 800px;
border: 1px solid #000;
padding: 20px;
border-radius: 5px;
h1 {
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;
}
p {
margin-bottom: 20px;
}
b {
font-weight: bold;
}
ul {
margin-bottom: 20px;
}
li {
margin-bottom: 10px;
}
h2 {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
`;

export const NdaPoweredBy = styled.div`
width: 100%;
margin-top: 20px;
font-size: 12px;
> a {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
`;
17 changes: 17 additions & 0 deletions src/templates/NDA/TemplateNDA.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { FunctionComponent } from "react";
import { TemplateASampleV2 } from "./sampleV2";
import { TemplateNda } from "./NDA";

export default {
title: "TemplateNDA",
component: TemplateNda,
parameters: {
componentSubtitle: "Sample Template NDA",
},
};

export const TemplateNonDisclosureAgreement: FunctionComponent = () => {
return (
<TemplateNda document={TemplateASampleV2} handleObfuscation={() => {}} />
);
};
9 changes: 9 additions & 0 deletions src/templates/NDA/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { TemplateNda } from "./NDA";

export const TemplateNDATemplates = [
{
id: "nda",
label: "NDA",
template: TemplateNda,
},
];
31 changes: 31 additions & 0 deletions src/templates/NDA/sampleV2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { v2 } from "@tradetrust-tt/tradetrust";
import { TemplateAV2 } from "./types";

export const TemplateASampleV2: TemplateAV2 = {
$template: {
type: v2.TemplateType.EmbeddedRenderer,
name: "NDA",
url: "http://localhost:3000",
},
issuers: [
{
name: "abc",
tokenRegistry: "0x142Ca30e3b78A840a82192529cA047ED759a6F7e",
identityProof: {
type: v2.IdentityProofType.DNSTxt,
location: "example.tradetrust.io",
},
},
],
effectiveDate: "2020-01-01",
disclosingParty: {
name: "ABC Ltd.",
address: "Singapore",
},
receivingParty: {
name: "XYZ Ltd.",
address: "Singapore",
},
purpose: "To share information",
governingLawStateCountry: "Singapore",
};
45 changes: 45 additions & 0 deletions src/templates/NDA/sampleV3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { v3 } from "@tradetrust-tt/tradetrust";
import { TemplateAV3 } from "./types";

export const TemplateASampleV3: TemplateAV3 = {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://schemata.openattestation.com/com/openattestation/1.0/OpenAttestation.v3.json",
"https://schemata.openattestation.com/io/tradetrust/bill-of-lading/1.0/bill-of-lading-context.json",
],
type: ["VerifiableCredential", "OpenAttestationCredential"],
issuanceDate: "2010-01-01T19:23:24Z",
issuer: {
id: "https://example.com",
name: "DEMO TOKEN REGISTRY",
},
openAttestationMetadata: {
template: {
type: v3.TemplateType.EmbeddedRenderer,
name: "NDA",
url: "https://generic-templates.tradetrust.io",
},
proof: {
type: v3.ProofType.OpenAttestationProofMethod,
method: v3.Method.TokenRegistry,
value: "0x72d9a82203Ef9177239A5E3cB7A8FB9a78D04f17",
},
identityProof: {
type: v3.IdentityProofType.DNSTxt,
identifier: "demo-tradetrust.openattestation.com",
},
},
credentialSubject: {
effectiveDate: "2020-01-01",
disclosingParty: {
name: "ABC Ltd.",
address: "Singapore",
},
receivingParty: {
name: "XYZ Ltd.",
address: "Singapore",
},
purpose: "To share information",
governingLawStateCountry: "Singapore",
},
};
22 changes: 22 additions & 0 deletions src/templates/NDA/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { v2, v3 } from "@tradetrust-tt/tradetrust";

export type TemplateAV2 = v2.OpenAttestationDocument & TemplateNdaDocument;
export type TemplateAV3 = v3.OpenAttestationDocument & {
credentialSubject: TemplateNdaDocument;
};

export type TemplateNdaSchema = TemplateAV2 | TemplateAV3;

export interface TemplateNdaDocument {
effectiveDate: string;
disclosingParty: {
name: string;
address: string;
};
receivingParty: {
name: string;
address: string;
};
purpose: string;
governingLawStateCountry: string;
}
4 changes: 3 additions & 1 deletion src/templates/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { TemplateRegistry } from "@tradetrust-tt/decentralized-renderer-react-components";
import { TemplateATemplates } from "./examples/TemplateA";
import { TemplateBTemplates } from "./examples/TemplateB";
import { TemplateNDATemplates } from "./NDA";

export const registry: TemplateRegistry<any> = {
TEMPLATE_A: TemplateATemplates,
TEMPLATE_B: TemplateBTemplates,
};
NDA: TemplateNDATemplates,
};

0 comments on commit 9799df8

Please sign in to comment.