Skip to content

Commit

Permalink
fix: update faq link (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
rongquan1 authored Sep 25, 2024
1 parent b2c94e3 commit a94c70f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
8 changes: 7 additions & 1 deletion src/components/Demo/DemoCreate/DemoCreateIssue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getDocumentIssued, getDocumentPrepared, getWrappedDocument } from "../.
import { DemoFormContext } from "../contexts/DemoFormContext";
import { Banner } from "../../../UI/Banner";
import { GaAction, GaCategory } from "../../../../types";
import { URLS } from "../../../../constants";

export const DemoCreateIssue: FunctionComponent = () => {
const { issued, error: issuedError } = useSelector(getDocumentIssued);
Expand Down Expand Up @@ -44,7 +45,12 @@ export const DemoCreateIssue: FunctionComponent = () => {
<h3>Failed</h3>
<p className="py-5">
Please check if you have internet connection,
<br /> alternatively, see <Link to="/faq">FAQ</Link> or <Link to="/contact">Contact us</Link>
<br />
alternatively, see{" "}
<a href={URLS.FAQ} target="_blank" rel="noopener noreferrer">
FAQ
</a>{" "}
or <Link to="/contact">Contact us</Link>
</p>
<Button className="bg-cerulean-500 text-white rounded hover:bg-cerulean-800">
<Link className="text-white hover:text-white" to="/demo">
Expand Down
10 changes: 6 additions & 4 deletions src/components/DocumentDropzone/Views/ViewActionError.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { FunctionComponent } from "react";
import { Link } from "react-router-dom";
import { Button } from "@tradetrust-tt/tradetrust-ui-components";
import { useSelector } from "react-redux";
import { RootState } from "../../../reducers";
import { DetailedError } from "../../DocumentDropzone/DetailedErrors";
import { URLS } from "../../../constants";

interface ViewActionErrorProps {
resetData: () => void;
Expand All @@ -26,16 +26,18 @@ export const ViewActionError: FunctionComponent<ViewActionErrorProps> = ({ reset
title={`Unable to load certificate with the provided parameters`}
message={retrieveCertificateByActionError}
/>
<Link
to="/faq"
<a
href={URLS.FAQ}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
e.stopPropagation();
}}
>
<Button className="text-white bg-scarlet-500 border-scarlet-500 hover:bg-scarlet-400 hover:border-scarlet-400">
What Should I do?
</Button>
</Link>
</a>
<br />
<div
data-testid="try-another"
Expand Down
10 changes: 6 additions & 4 deletions src/components/DocumentDropzone/Views/ViewVerificationError.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { FunctionComponent } from "react";
import { Link } from "react-router-dom";
import { Button } from "@tradetrust-tt/tradetrust-ui-components";
import { useSelector } from "react-redux";
import { RootState } from "../../../reducers";
import { DetailedErrors } from "../DetailedErrors";
import { URLS } from "../../../constants";

interface ViewVerificationErrorProps {
resetData: () => void;
Expand All @@ -23,8 +23,10 @@ export const ViewVerificationError: FunctionComponent<ViewVerificationErrorProps
</div>
</div>
<DetailedErrors verificationStatus={verificationStatus} verificationError={verificationError} />
<Link
to="/faq"
<a
href={URLS.FAQ}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
e.stopPropagation();
}}
Expand All @@ -34,7 +36,7 @@ export const ViewVerificationError: FunctionComponent<ViewVerificationErrorProps
>
What Should I do?
</Button>
</Link>
</a>
<br />
<div
data-testid="try-another"
Expand Down
10 changes: 6 additions & 4 deletions src/components/MagicDropzone/MagicDropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FunctionComponent, useCallback, useMemo } from "react";
import { useDispatch } from "react-redux";
import { Link } from "react-router-dom";
import { useDropzone } from "react-dropzone";
import { isValid } from "@tradetrust-tt/tt-verify";
import { Button, ButtonSize, LoaderSpinner } from "@tradetrust-tt/tradetrust-ui-components";
Expand All @@ -11,6 +10,7 @@ import { DetailedErrors } from "../DocumentDropzone/DetailedErrors";
import { updateDemoDocument, resetDemoState } from "../../reducers/demo-verify";
import { getDropzoneBoxUi } from "./../../common/utils/getDropzoneBoxUi";
import { GaAction, GaCategory } from "../../types";
import { URLS } from "../../constants";

interface MagicDropzoneViewProps {
isPending: boolean;
Expand Down Expand Up @@ -41,16 +41,18 @@ const MagicDropzoneView: FunctionComponent<MagicDropzoneViewProps> = ({ isPendin
</div>
</div>
<DetailedErrors verificationStatus={verificationStatus} verificationError={verificationError} />
<Link
to="/faq"
<a
href={URLS.FAQ}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
e.stopPropagation();
}}
>
<Button className="text-white bg-scarlet-500 border-scarlet-500 hover:bg-scarlet-400 hover:border-scarlet-400">
What Should I do?
</Button>
</Link>
</a>
<br />
<div
data-testid="try-another"
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum URLS {
CREATOR = "https://creator.tradetrust.io/",
GITHUB = "https://github.com/TradeTrust/tradetrust-website",
DOCS = "https://docs.tradetrust.io/",
FAQ = "https://www.tradetrust.io/common-error-faqs/",
}

export enum FaqType {
Expand Down

0 comments on commit a94c70f

Please sign in to comment.