From 9efe74afa3a0c8704954aae0fe70a4de9409311c Mon Sep 17 00:00:00 2001 From: Min Htet Oo Date: Tue, 13 Feb 2024 14:00:56 +0800 Subject: [PATCH] change name from RedactableValues to SelectiveRedaction --- src/core/RedactableValues/index.ts | 1 - .../SelectiveRedaction.tsx} | 4 ++-- src/core/SelectiveRedaction/index.ts | 1 + ...s.tsx => TemplateBWithSelectiveRedaction.stories.tsx} | 8 ++++---- ...bleValues.tsx => TemplateBWithSelectiveRedaction.tsx} | 9 ++++++--- src/templates/examples/TemplateB/index.tsx | 6 +++--- 6 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 src/core/RedactableValues/index.ts rename src/core/{RedactableValues/RedactableValues.tsx => SelectiveRedaction/SelectiveRedaction.tsx} (93%) create mode 100644 src/core/SelectiveRedaction/index.ts rename src/templates/examples/TemplateB/{TemplateBWithRedactableValues.stories.tsx => TemplateBWithSelectiveRedaction.stories.tsx} (55%) rename src/templates/examples/TemplateB/{TemplateBWithRedactableValues.tsx => TemplateBWithSelectiveRedaction.tsx} (98%) diff --git a/src/core/RedactableValues/index.ts b/src/core/RedactableValues/index.ts deleted file mode 100644 index e6cb17f..0000000 --- a/src/core/RedactableValues/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./RedactableValues"; diff --git a/src/core/RedactableValues/RedactableValues.tsx b/src/core/SelectiveRedaction/SelectiveRedaction.tsx similarity index 93% rename from src/core/RedactableValues/RedactableValues.tsx rename to src/core/SelectiveRedaction/SelectiveRedaction.tsx index 3c98d6c..f8d387d 100644 --- a/src/core/RedactableValues/RedactableValues.tsx +++ b/src/core/SelectiveRedaction/SelectiveRedaction.tsx @@ -2,7 +2,7 @@ import { Button } from "@tradetrust-tt/tradetrust-ui-components"; import React, { FunctionComponent } from "react"; import patternWaves from "/static/images/pattern-waves.png"; -interface RedactableValueProps { +interface SelectiveRedaction { editable: boolean; onToggleEditable: () => void; options?: { @@ -12,7 +12,7 @@ interface RedactableValueProps { }; } -export const RedactableValues: FunctionComponent = ({ +export const SelectiveRedaction: FunctionComponent = ({ editable, onToggleEditable, options, diff --git a/src/core/SelectiveRedaction/index.ts b/src/core/SelectiveRedaction/index.ts new file mode 100644 index 0000000..33d37fb --- /dev/null +++ b/src/core/SelectiveRedaction/index.ts @@ -0,0 +1 @@ +export * from "./SelectiveRedaction"; diff --git a/src/templates/examples/TemplateB/TemplateBWithRedactableValues.stories.tsx b/src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.stories.tsx similarity index 55% rename from src/templates/examples/TemplateB/TemplateBWithRedactableValues.stories.tsx rename to src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.stories.tsx index fe8201a..517b9b0 100644 --- a/src/templates/examples/TemplateB/TemplateBWithRedactableValues.stories.tsx +++ b/src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.stories.tsx @@ -1,18 +1,18 @@ import React, { FunctionComponent } from "react"; -import { TemplateBWithRedactableValues } from "./TemplateBWithRedactableValues"; +import { TemplateBWithSelectiveRedaction } from "./TemplateBWithSelectiveRedaction"; import { TemplateBSampleV2 } from "./sampleV2"; export default { title: "TemplateB", - component: TemplateBWithRedactableValues, + component: TemplateBWithSelectiveRedaction, parameters: { componentSubtitle: "Sample Template B", }, }; -export const TemplateWithRedactableValues: FunctionComponent = () => { +export const TemplateWithSelectiveRedaction: FunctionComponent = () => { return ( - {}} /> diff --git a/src/templates/examples/TemplateB/TemplateBWithRedactableValues.tsx b/src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.tsx similarity index 98% rename from src/templates/examples/TemplateB/TemplateBWithRedactableValues.tsx rename to src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.tsx index 0236cb9..7b080c9 100644 --- a/src/templates/examples/TemplateB/TemplateBWithRedactableValues.tsx +++ b/src/templates/examples/TemplateB/TemplateBWithSelectiveRedaction.tsx @@ -7,7 +7,10 @@ import { format } from "date-fns"; import React, { FunctionComponent, useState } from "react"; import { DocumentQrCode } from "../../../core/DocumentQrCode"; import { Wrapper } from "../../../core/Wrapper"; -import { IconRedact, RedactableValues } from "../../../core/RedactableValues"; +import { + IconRedact, + SelectiveRedaction, +} from "../../../core/SelectiveRedaction"; import { getDocumentData } from "../../../utils"; import { TemplateB, TemplateBSchema } from "./types"; @@ -43,7 +46,7 @@ const CustomStyles = styled.div` } `; -export const TemplateBWithRedactableValues: FunctionComponent< +export const TemplateBWithSelectiveRedaction: FunctionComponent< TemplateProps > = ({ document, handleObfuscation }) => { const [editable, setEditable] = useState(false); @@ -65,7 +68,7 @@ export const TemplateBWithRedactableValues: FunctionComponent< return ( <> - setEditable(!editable)} /> diff --git a/src/templates/examples/TemplateB/index.tsx b/src/templates/examples/TemplateB/index.tsx index 9be2f96..bdf75ec 100644 --- a/src/templates/examples/TemplateB/index.tsx +++ b/src/templates/examples/TemplateB/index.tsx @@ -1,9 +1,9 @@ -import { TemplateBWithRedactableValues } from "./TemplateBWithRedactableValues"; +import { TemplateBWithSelectiveRedaction } from "./TemplateBWithSelectiveRedaction"; export const TemplateBTemplates = [ { id: "template-b", - label: "Template B with RedactableValues", - template: TemplateBWithRedactableValues, + label: "Template B with SelectiveRedaction", + template: TemplateBWithSelectiveRedaction, }, ];