From 0858510769b526fc5da683ace7d409292d6eb975 Mon Sep 17 00:00:00 2001 From: Min Htet Oo Date: Wed, 31 Jan 2024 13:24:50 +0800 Subject: [PATCH] group Group example templates under example folder /src/templates/example/TemplateA and TemplateB --- .../TemplateA/TemplateA.stories.tsx | 0 .../TemplateA/TemplateAWithQRCode.tsx | 4 ++-- .../TemplateA/TemplateAWithWaterMark.tsx | 4 ++-- .../TemplateAWithWrapperAndErrorBoundry.tsx | 6 +++--- .../{ => examples}/TemplateA/index.tsx | 20 +++++++++---------- .../{ => examples}/TemplateA/sampleV2.ts | 0 .../{ => examples}/TemplateA/sampleV3.ts | 0 .../{ => examples}/TemplateA/types.ts | 0 .../TemplateBWithPrivacyFilter.stories.tsx | 0 .../TemplateB/TemplateBWithPrivacyFilter.tsx | 8 ++++---- .../{ => examples}/TemplateB/index.tsx | 0 .../{ => examples}/TemplateB/sampleV2.ts | 0 .../{ => examples}/TemplateB/sampleV3.ts | 0 .../{ => examples}/TemplateB/types.ts | 0 src/templates/index.tsx | 4 ++-- 15 files changed, 23 insertions(+), 23 deletions(-) rename src/templates/{ => examples}/TemplateA/TemplateA.stories.tsx (100%) rename src/templates/{ => examples}/TemplateA/TemplateAWithQRCode.tsx (91%) rename src/templates/{ => examples}/TemplateA/TemplateAWithWaterMark.tsx (95%) rename src/templates/{ => examples}/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx (87%) rename src/templates/{ => examples}/TemplateA/index.tsx (54%) rename src/templates/{ => examples}/TemplateA/sampleV2.ts (100%) rename src/templates/{ => examples}/TemplateA/sampleV3.ts (100%) rename src/templates/{ => examples}/TemplateA/types.ts (100%) rename src/templates/{ => examples}/TemplateB/TemplateBWithPrivacyFilter.stories.tsx (100%) rename src/templates/{ => examples}/TemplateB/TemplateBWithPrivacyFilter.tsx (97%) rename src/templates/{ => examples}/TemplateB/index.tsx (100%) rename src/templates/{ => examples}/TemplateB/sampleV2.ts (100%) rename src/templates/{ => examples}/TemplateB/sampleV3.ts (100%) rename src/templates/{ => examples}/TemplateB/types.ts (100%) diff --git a/src/templates/TemplateA/TemplateA.stories.tsx b/src/templates/examples/TemplateA/TemplateA.stories.tsx similarity index 100% rename from src/templates/TemplateA/TemplateA.stories.tsx rename to src/templates/examples/TemplateA/TemplateA.stories.tsx diff --git a/src/templates/TemplateA/TemplateAWithQRCode.tsx b/src/templates/examples/TemplateA/TemplateAWithQRCode.tsx similarity index 91% rename from src/templates/TemplateA/TemplateAWithQRCode.tsx rename to src/templates/examples/TemplateA/TemplateAWithQRCode.tsx index a8c2743..4e523f7 100644 --- a/src/templates/TemplateA/TemplateAWithQRCode.tsx +++ b/src/templates/examples/TemplateA/TemplateAWithQRCode.tsx @@ -1,7 +1,7 @@ import { TemplateProps } from "@tradetrust-tt/decentralized-renderer-react-components"; import React, { FunctionComponent } from "react"; -import { DocumentQrCode } from "../../core/DocumentQrCode"; -import { getDocumentData } from "../../utils"; +import { DocumentQrCode } from "../../../core/DocumentQrCode"; +import { getDocumentData } from "../../../utils"; import { TemplateADocument, TemplateASchema } from "./types"; const Content = (document: TemplateADocument): JSX.Element => { diff --git a/src/templates/TemplateA/TemplateAWithWaterMark.tsx b/src/templates/examples/TemplateA/TemplateAWithWaterMark.tsx similarity index 95% rename from src/templates/TemplateA/TemplateAWithWaterMark.tsx rename to src/templates/examples/TemplateA/TemplateAWithWaterMark.tsx index 77c12a5..9d6b578 100644 --- a/src/templates/TemplateA/TemplateAWithWaterMark.tsx +++ b/src/templates/examples/TemplateA/TemplateAWithWaterMark.tsx @@ -1,8 +1,8 @@ import { TemplateProps } from "@tradetrust-tt/decentralized-renderer-react-components"; import React, { FunctionComponent } from "react"; -import { getDocumentData } from "../../utils"; +import { getDocumentData } from "../../../utils"; import { TemplateADocument, TemplateASchema } from "./types"; -import { PrintWatermark } from "../../core/PrintWatermark"; +import { PrintWatermark } from "../../../core/PrintWatermark"; const Content = (document: TemplateADocument): JSX.Element => { return ( diff --git a/src/templates/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx b/src/templates/examples/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx similarity index 87% rename from src/templates/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx rename to src/templates/examples/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx index 721d1e2..9434755 100644 --- a/src/templates/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx +++ b/src/templates/examples/TemplateA/TemplateAWithWrapperAndErrorBoundry.tsx @@ -1,8 +1,8 @@ import { TemplateProps } from "@tradetrust-tt/decentralized-renderer-react-components"; import React, { FunctionComponent } from "react"; -import { DocumentQrCode } from "../../core/DocumentQrCode"; -import { Wrapper } from "../../core/Wrapper"; -import { getDocumentData } from "../../utils"; +import { DocumentQrCode } from "../../../core/DocumentQrCode"; +import { Wrapper } from "../../../core/Wrapper"; +import { getDocumentData } from "../../../utils"; import { TemplateADocument, TemplateASchema } from "./types"; const Content = (document: TemplateADocument): JSX.Element => { diff --git a/src/templates/TemplateA/index.tsx b/src/templates/examples/TemplateA/index.tsx similarity index 54% rename from src/templates/TemplateA/index.tsx rename to src/templates/examples/TemplateA/index.tsx index ee51b31..fdce721 100644 --- a/src/templates/TemplateA/index.tsx +++ b/src/templates/examples/TemplateA/index.tsx @@ -3,16 +3,16 @@ import { TemplateAWithWaterMark } from "./TemplateAWithWaterMark"; import { TemplateAWithWrapperAndErrorBoundry } from "./TemplateAWithWrapperAndErrorBoundry"; export const TemplateATemplates = [ - // { - // id: "template-a-with-qr", - // label: "Template with QR Code", - // template: TemplateAWithQRCode, - // }, - // { - // id: "template-a-with-wrapper-and-error-boundry", - // label: "Template with Wrapper and Error Boundry", - // template: TemplateAWithWrapperAndErrorBoundry, - // }, + { + id: "template-a-with-qr", + label: "Template with QR Code", + template: TemplateAWithQRCode, + }, + { + id: "template-a-with-wrapper-and-error-boundry", + label: "Template with Wrapper and Error Boundry", + template: TemplateAWithWrapperAndErrorBoundry, + }, { id: "template-a-with-qr", label: "With water mark", diff --git a/src/templates/TemplateA/sampleV2.ts b/src/templates/examples/TemplateA/sampleV2.ts similarity index 100% rename from src/templates/TemplateA/sampleV2.ts rename to src/templates/examples/TemplateA/sampleV2.ts diff --git a/src/templates/TemplateA/sampleV3.ts b/src/templates/examples/TemplateA/sampleV3.ts similarity index 100% rename from src/templates/TemplateA/sampleV3.ts rename to src/templates/examples/TemplateA/sampleV3.ts diff --git a/src/templates/TemplateA/types.ts b/src/templates/examples/TemplateA/types.ts similarity index 100% rename from src/templates/TemplateA/types.ts rename to src/templates/examples/TemplateA/types.ts diff --git a/src/templates/TemplateB/TemplateBWithPrivacyFilter.stories.tsx b/src/templates/examples/TemplateB/TemplateBWithPrivacyFilter.stories.tsx similarity index 100% rename from src/templates/TemplateB/TemplateBWithPrivacyFilter.stories.tsx rename to src/templates/examples/TemplateB/TemplateBWithPrivacyFilter.stories.tsx diff --git a/src/templates/TemplateB/TemplateBWithPrivacyFilter.tsx b/src/templates/examples/TemplateB/TemplateBWithPrivacyFilter.tsx similarity index 97% rename from src/templates/TemplateB/TemplateBWithPrivacyFilter.tsx rename to src/templates/examples/TemplateB/TemplateBWithPrivacyFilter.tsx index a0579ed..1a76321 100644 --- a/src/templates/TemplateB/TemplateBWithPrivacyFilter.tsx +++ b/src/templates/examples/TemplateB/TemplateBWithPrivacyFilter.tsx @@ -2,10 +2,10 @@ import styled from "@emotion/styled"; import { RedactableValue, TemplateProps } from "@tradetrust-tt/decentralized-renderer-react-components"; import { format } from "date-fns"; import React, { FunctionComponent, useState } from "react"; -import { DocumentQrCode } from "../../core/DocumentQrCode"; -import { Wrapper } from "../../core/Wrapper"; -import { IconRedact, PrivacyFilter } from "../../core/PrivacyFilter"; -import { getDocumentData } from "../../utils"; +import { DocumentQrCode } from "../../../core/DocumentQrCode"; +import { Wrapper } from "../../../core/Wrapper"; +import { IconRedact, PrivacyFilter } from "../../../core/PrivacyFilter"; +import { getDocumentData } from "../../../utils"; import { TemplateB, TemplateBSchema } from "./types"; const CustomStyles = styled.div` diff --git a/src/templates/TemplateB/index.tsx b/src/templates/examples/TemplateB/index.tsx similarity index 100% rename from src/templates/TemplateB/index.tsx rename to src/templates/examples/TemplateB/index.tsx diff --git a/src/templates/TemplateB/sampleV2.ts b/src/templates/examples/TemplateB/sampleV2.ts similarity index 100% rename from src/templates/TemplateB/sampleV2.ts rename to src/templates/examples/TemplateB/sampleV2.ts diff --git a/src/templates/TemplateB/sampleV3.ts b/src/templates/examples/TemplateB/sampleV3.ts similarity index 100% rename from src/templates/TemplateB/sampleV3.ts rename to src/templates/examples/TemplateB/sampleV3.ts diff --git a/src/templates/TemplateB/types.ts b/src/templates/examples/TemplateB/types.ts similarity index 100% rename from src/templates/TemplateB/types.ts rename to src/templates/examples/TemplateB/types.ts diff --git a/src/templates/index.tsx b/src/templates/index.tsx index 70e757f..03a54c8 100644 --- a/src/templates/index.tsx +++ b/src/templates/index.tsx @@ -1,6 +1,6 @@ import { TemplateRegistry } from "@tradetrust-tt/decentralized-renderer-react-components"; -import { TemplateATemplates } from "./TemplateA"; -import { TemplateBTemplates } from "./TemplateB"; +import { TemplateATemplates } from "./examples/TemplateA"; +import { TemplateBTemplates } from "./examples/TemplateB"; export const registry: TemplateRegistry = { TEMPLATE_A: TemplateATemplates,