Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update faq link #940

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading