Skip to content

Commit

Permalink
Add class 'ValidationSuccess' and move 'ElementWrapper'
Browse files Browse the repository at this point in the history
  • Loading branch information
hungoptimizely committed Nov 20, 2023
1 parent 2176c02 commit 2630c2a
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Choice, equals, isNullOrEmpty } from "@optimizely/forms-sdk";
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FileUpload } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ImageChoice, equals, isNullOrEmpty } from "@optimizely/forms-sdk";
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Number } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ValidationMessage, ElementCaption } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Range } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Selection, isNullOrEmpty } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SubmitButton, isNullOrEmpty } from "@optimizely/forms-sdk";
import React, { useMemo } from "react";
import { useElement } from "../../hooks/useElement";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";

interface SubmitButtonElementBlockProps{
element: SubmitButton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Textarea } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Textbox } from "@optimizely/forms-sdk";
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage, DataList } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Url } from "@optimizely/forms-sdk"
import React, { useMemo } from "react";
import ElementWrapper from "../ElementWrapper";
import ElementWrapper from "./shared/ElementWrapper";
import { useElement } from "../../hooks/useElement";
import { ElementCaption, ValidationMessage } from "./shared";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ElementWrapperProps{
}

export default function ElementWrapper(props: ElementWrapperProps){
const failClass = props.validationResults?.some(r => !r.valid) ? "ValidationFail" : "";
const failClass = props.validationResults?.some(r => !r.valid) ? "ValidationFail" : "ValidationSuccess";

return (
<>
Expand Down

0 comments on commit 2630c2a

Please sign in to comment.