Skip to content

Commit a5f344c

Browse files
committed
fix(web): address-coderabbit-feedback
1 parent 6707b93 commit a5f344c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/FormContact.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const FormContact: React.FC<IForm> = ({
4848
};
4949

5050
const fieldVariant = useMemo(() => {
51-
if (isEmpty(contactInput) || !isEditing) {
51+
if (!isEditing || isEmpty(contactInput)) {
5252
return undefined;
5353
}
5454
return contactIsValid ? "success" : "error";

web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { wrapWithToast, OPTIONS as toastOptions } from "utils/wrapWithToast";
1414

1515
import EnsureAuth from "components/EnsureAuth";
1616
import { EnsureChain } from "components/EnsureChain";
17-
import { isEmpty, isUndefined } from "src/utils";
17+
import { isEmpty } from "src/utils";
1818

1919
const StyledModal = styled(Modal)`
2020
position: absolute;
@@ -65,7 +65,7 @@ const SubmitEvidenceModal: React.FC<{
6565
const [file, setFile] = useState<File>();
6666
const { uploadFile } = useAtlasProvider();
6767

68-
const isDisabled = useMemo(() => isSending || isEmpty(message) || isUndefined(message), [isSending, message]);
68+
const isDisabled = useMemo(() => isSending || isEmpty(message), [isSending, message]);
6969

7070
const submitEvidence = useCallback(async () => {
7171
try {

web/src/pages/Resolver/NavigationButtons/NextButton.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ const NextButton: React.FC<INextButton> = ({ nextRoute }) => {
2222
disputeData.answers.every((answer) => answer.title !== "" && answer.description !== "");
2323

2424
//check if any filled address or ens is invalid
25-
const areFilledAddressesValid = disputeData?.aliasesArray?.every((alias) =>
26-
isEmpty(alias.address) && isEmpty(alias.name) ? true : alias.isValid
27-
);
28-
25+
const areAliasesValidOrEmpty = disputeData?.aliasesArray?.every((alias) => {
26+
const isAliasEmpty = isEmpty(alias.address) && isEmpty(alias.name);
27+
return isAliasEmpty || alias.isValid;
28+
});
2929
const isButtonDisabled =
3030
(location.pathname.includes("/resolver/title") && !disputeData.title) ||
3131
(location.pathname.includes("/resolver/description") && !disputeData.description) ||
3232
(location.pathname.includes("/resolver/court") && !disputeData.courtId) ||
3333
(location.pathname.includes("/resolver/jurors") && !disputeData.arbitrationCost) ||
3434
(location.pathname.includes("/resolver/voting-options") && !areVotingOptionsFilled) ||
35-
(location.pathname.includes("/resolver/notable-persons") && !areFilledAddressesValid) ||
35+
(location.pathname.includes("/resolver/notable-persons") && !areAliasesValidOrEmpty) ||
3636
(location.pathname.includes("/resolver/policy") && (isPolicyUploading || !disputeData.policyURI));
3737

3838
return <Button disabled={isButtonDisabled} onClick={() => navigate(nextRoute)} text="Next" />;

0 commit comments

Comments
 (0)