Skip to content

Commit

Permalink
change name from RedactableValues to SelectiveRedaction
Browse files Browse the repository at this point in the history
  • Loading branch information
MinHtet-O committed Feb 13, 2024
1 parent 80606fe commit 9efe74a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/core/RedactableValues/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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?: {
Expand All @@ -12,7 +12,7 @@ interface RedactableValueProps {
};
}

export const RedactableValues: FunctionComponent<RedactableValueProps> = ({
export const SelectiveRedaction: FunctionComponent<SelectiveRedaction> = ({
editable,
onToggleEditable,
options,
Expand Down
1 change: 1 addition & 0 deletions src/core/SelectiveRedaction/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./SelectiveRedaction";
Original file line number Diff line number Diff line change
@@ -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 (
<TemplateBWithRedactableValues
<TemplateBWithSelectiveRedaction
document={TemplateBSampleV2}
handleObfuscation={() => {}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -43,7 +46,7 @@ const CustomStyles = styled.div`
}
`;

export const TemplateBWithRedactableValues: FunctionComponent<
export const TemplateBWithSelectiveRedaction: FunctionComponent<
TemplateProps<TemplateBSchema>
> = ({ document, handleObfuscation }) => {
const [editable, setEditable] = useState(false);
Expand All @@ -65,7 +68,7 @@ export const TemplateBWithRedactableValues: FunctionComponent<
return (
<>
<Wrapper data-testid="invoice-template">
<RedactableValues
<SelectiveRedaction
editable={editable}
onToggleEditable={() => setEditable(!editable)}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/templates/examples/TemplateB/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
},
];

0 comments on commit 9efe74a

Please sign in to comment.