diff --git a/web/src/app.tsx b/web/src/app.tsx index 5153d53..e6813d6 100644 --- a/web/src/app.tsx +++ b/web/src/app.tsx @@ -25,9 +25,9 @@ const App: React.FC = () => { }> - } /> - } /> - } /> + } /> + } /> + } /> 404 not found} /> diff --git a/web/src/components/TransactionCard/index.tsx b/web/src/components/TransactionCard/index.tsx index 9dbbcb3..11f7589 100644 --- a/web/src/components/TransactionCard/index.tsx +++ b/web/src/components/TransactionCard/index.tsx @@ -77,7 +77,7 @@ const TransactionCard: React.FC = ({ return ( <> {!isList || overrideIsList ? ( - navigateAndScrollTop(`/myTransactions/${id.toString()}`)}> + navigateAndScrollTop(`/my-transactions/${id.toString()}`)}> {!isUndefined(title) ? {title} : } @@ -92,7 +92,7 @@ const TransactionCard: React.FC = ({ ) : ( - navigateAndScrollTop(`/myTransactions/${id.toString()}`)}> + navigateAndScrollTop(`/my-transactions/${id.toString()}`)}> {!isUndefined(title) ? ( diff --git a/web/src/context/TransactionDetailsContext.tsx b/web/src/context/TransactionDetailsContext.tsx index b904b60..abb720e 100644 --- a/web/src/context/TransactionDetailsContext.tsx +++ b/web/src/context/TransactionDetailsContext.tsx @@ -2,14 +2,11 @@ import React, { createContext, useContext, useState, ReactNode } from "react"; import { TransactionDetailsFragment } from "src/graphql/graphql"; interface TransactionDetailsContextType { - transactionDetails: TransactionDetailsFragment | null; - setTransactionDetails: (details: TransactionDetailsFragment | null) => void; + transactionDetails: TransactionDetailsFragment | undefined; + setTransactionDetails: (details: TransactionDetailsFragment | undefined) => void; } -const TransactionDetailsContext = createContext({ - transactionDetails: null, - setTransactionDetails: () => {}, -}); +const TransactionDetailsContext = createContext(undefined); export const useTransactionDetailsContext = () => { const context = useContext(TransactionDetailsContext); @@ -22,7 +19,7 @@ export const useTransactionDetailsContext = () => { }; export const TransactionDetailsProvider: React.FC<{ children: ReactNode }> = ({ children }) => { - const [transactionDetails, setTransactionDetails] = useState(null); + const [transactionDetails, setTransactionDetails] = useState(undefined); return ( diff --git a/web/src/layout/Header/navbar/Explore.tsx b/web/src/layout/Header/navbar/Explore.tsx index 35e0331..3659ffc 100644 --- a/web/src/layout/Header/navbar/Explore.tsx +++ b/web/src/layout/Header/navbar/Explore.tsx @@ -48,8 +48,8 @@ const StyledLink = styled(Link)<{ isActive: boolean }>` `; const links = [ - { to: "/newTransaction", text: "New Transaction" }, - { to: "/myTransactions/display/1/desc/all", text: "My Transactions" }, + { to: "/new-transaction", text: "New Transaction" }, + { to: "/my-transactions/display/1/desc/all", text: "My Transactions" }, ]; const Explore: React.FC = () => { diff --git a/web/src/pages/MyTransactions/Modal/PaymentReleased/index.tsx b/web/src/pages/MyTransactions/Modal/PaymentReleased/index.tsx index 8e749a2..6cfebf1 100644 --- a/web/src/pages/MyTransactions/Modal/PaymentReleased/index.tsx +++ b/web/src/pages/MyTransactions/Modal/PaymentReleased/index.tsx @@ -1,6 +1,6 @@ import React, { useRef } from "react"; import { useClickAway } from "react-use"; -import { StyledModal } from "~src/pages/MyTransactions/Modal/StyledModal"; +import { StyledModal } from "pages/MyTransactions/Modal/StyledModal"; import VerifiedLogo from "./VerifiedLogo"; import Header from "./Header"; import Description from "./Description"; diff --git a/web/src/pages/MyTransactions/Modal/ProposeSettlementModal/Buttons/index.tsx b/web/src/pages/MyTransactions/Modal/ProposeSettlementModal/Buttons/index.tsx index e34d5f1..89ce7a7 100644 --- a/web/src/pages/MyTransactions/Modal/ProposeSettlementModal/Buttons/index.tsx +++ b/web/src/pages/MyTransactions/Modal/ProposeSettlementModal/Buttons/index.tsx @@ -25,4 +25,5 @@ const Buttons: React.FC = ({ toggleModal, amountProposed, isAmountVali ); }; + export default Buttons; diff --git a/web/src/pages/MyTransactions/TransactionDetails/index.tsx b/web/src/pages/MyTransactions/TransactionDetails/index.tsx index e9279ea..56a64c7 100644 --- a/web/src/pages/MyTransactions/TransactionDetails/index.tsx +++ b/web/src/pages/MyTransactions/TransactionDetails/index.tsx @@ -52,9 +52,7 @@ const TransactionDetails: React.FC = () => { const transactionInfo = useFetchIpfsJson(transactionUri); useEffect(() => { - if (transactionDetails) { - setTransactionDetails(transactionDetails.escrow); - } else setTransactionDetails({}); + setTransactionDetails(transactionDetails?.escrow); }, [transactionDetails, setTransactionDetails]); return ( diff --git a/web/src/pages/NewTransaction/EscrowDetails/Title/index.tsx b/web/src/pages/NewTransaction/EscrowDetails/Title/index.tsx index 7ec45d6..e3c4842 100644 --- a/web/src/pages/NewTransaction/EscrowDetails/Title/index.tsx +++ b/web/src/pages/NewTransaction/EscrowDetails/Title/index.tsx @@ -15,7 +15,7 @@ const Title: React.FC = () => {
- + ); }; diff --git a/web/src/pages/NewTransaction/EscrowDetails/TypeOfEscrow/index.tsx b/web/src/pages/NewTransaction/EscrowDetails/TypeOfEscrow/index.tsx index 6b9c603..5692939 100644 --- a/web/src/pages/NewTransaction/EscrowDetails/TypeOfEscrow/index.tsx +++ b/web/src/pages/NewTransaction/EscrowDetails/TypeOfEscrow/index.tsx @@ -17,7 +17,7 @@ const TypeOfEscrow: React.FC = () => {
- + ); }; diff --git a/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx b/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx index c1a75dd..76b4910 100644 --- a/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx +++ b/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx @@ -69,7 +69,7 @@ const DepositPaymentButton: React.FC = () => { label: "Transaction Terms", uri: extraDescriptionUri, }, - frontendUrl: `https://escrow-v2.kleros.builders/#/myTransactions/%s`, + frontendUrl: `https://escrow-v2.kleros.builders/#/my-transactions/%s`, arbitrableChainID: "421614", arbitrableAddress: "0x250AB0477346aDFC010585b58FbF61cff1d8f3ea", arbitratorChainID: "421614", @@ -115,7 +115,7 @@ const DepositPaymentButton: React.FC = () => { .then((wrapResult) => { if (wrapResult.status) { resetContext(); - navigate("/myTransactions/display/1/desc/all"); + navigate("/my-transactions/display/1/desc/all"); } }) .catch((error) => { diff --git a/web/src/pages/NewTransaction/NavigationButtons/NextButton.tsx b/web/src/pages/NewTransaction/NavigationButtons/NextButton.tsx index dd42558..8addfb3 100644 --- a/web/src/pages/NewTransaction/NavigationButtons/NextButton.tsx +++ b/web/src/pages/NewTransaction/NavigationButtons/NextButton.tsx @@ -56,19 +56,19 @@ const NextButton: React.FC = ({ nextRoute }) => { const isButtonDisabled = escrowType === "swap" || - (location.pathname.includes("/newTransaction/title") && !escrowTitle) || - (location.pathname.includes("/newTransaction/deliverable") && !isDeliverableValid) || - (location.pathname.includes("/newTransaction/payment") && + (location.pathname.includes("/new-transaction/title") && !escrowTitle) || + (location.pathname.includes("/new-transaction/deliverable") && !isDeliverableValid) || + (location.pathname.includes("/new-transaction/payment") && (areSendingFieldsEmpty || !isSellerAddressValid || !isRecipientAddressResolved || !hasSufficientNativeBalance)) || - (location.pathname.includes("/newTransaction/deadline") && (!deadline || isDeadlineInPast)) || - (location.pathname.includes("/newTransaction/notifications") && !isEmailValid); + (location.pathname.includes("/new-transaction/deadline") && (!deadline || isDeadlineInPast)) || + (location.pathname.includes("/new-transaction/notifications") && !isEmailValid); const handleNextClick = async () => { try { - if (location.pathname.includes("/newTransaction/deliverable") && escrowType === "general") { + if (location.pathname.includes("/new-transaction/deliverable") && escrowType === "general") { const transactionUri = await handleFileUpload( escrowTitle, deliverableText, diff --git a/web/src/pages/NewTransaction/NavigationButtons/index.tsx b/web/src/pages/NewTransaction/NavigationButtons/index.tsx index 40e243e..2959951 100644 --- a/web/src/pages/NewTransaction/NavigationButtons/index.tsx +++ b/web/src/pages/NewTransaction/NavigationButtons/index.tsx @@ -21,7 +21,7 @@ const NavigationButtons: React.FC = ({ prevRoute, nextRo return ( - {prevRoute === "/newTransaction/notifications" ? : } + {prevRoute === "/new-transaction/notifications" ? : } ); }; diff --git a/web/src/pages/NewTransaction/Preview/index.tsx b/web/src/pages/NewTransaction/Preview/index.tsx index 0f757c4..a7a0106 100644 --- a/web/src/pages/NewTransaction/Preview/index.tsx +++ b/web/src/pages/NewTransaction/Preview/index.tsx @@ -51,7 +51,7 @@ const Preview: React.FC = () => { extraDescriptionUri={extraDescriptionUri} isPreview={true} /> - + ); }; diff --git a/web/src/pages/NewTransaction/Terms/Deadline/index.tsx b/web/src/pages/NewTransaction/Terms/Deadline/index.tsx index bf7b179..d12f2bd 100644 --- a/web/src/pages/NewTransaction/Terms/Deadline/index.tsx +++ b/web/src/pages/NewTransaction/Terms/Deadline/index.tsx @@ -24,7 +24,7 @@ const Deadline: React.FC = () => {
- + ); }; diff --git a/web/src/pages/NewTransaction/Terms/Deliverable/index.tsx b/web/src/pages/NewTransaction/Terms/Deliverable/index.tsx index cd9145f..ad3b22d 100644 --- a/web/src/pages/NewTransaction/Terms/Deliverable/index.tsx +++ b/web/src/pages/NewTransaction/Terms/Deliverable/index.tsx @@ -82,13 +82,13 @@ const Deliverable: React.FC = () => { placeholder="eg. I should receive a website created in React with the following specification: x,y,z." /> - + ) : ( {
- + ); }; diff --git a/web/src/pages/NewTransaction/Terms/Payment/GeneralTransaction/index.tsx b/web/src/pages/NewTransaction/Terms/Payment/GeneralTransaction/index.tsx index 7b3a826..c70f6c8 100644 --- a/web/src/pages/NewTransaction/Terms/Payment/GeneralTransaction/index.tsx +++ b/web/src/pages/NewTransaction/Terms/Payment/GeneralTransaction/index.tsx @@ -27,7 +27,7 @@ const GeneralTransaction: React.FC = () => { - + ); }; diff --git a/web/src/pages/NewTransaction/Terms/Payment/index.tsx b/web/src/pages/NewTransaction/Terms/Payment/index.tsx index 29445e5..c6a7193 100644 --- a/web/src/pages/NewTransaction/Terms/Payment/index.tsx +++ b/web/src/pages/NewTransaction/Terms/Payment/index.tsx @@ -19,8 +19,8 @@ const Payment: React.FC = () => { ) : ( { const location = useLocation(); const routeToIndexMap = { - "/newTransaction/typeOfEscrow": 0, - "/newTransaction/title": 0, - "/newTransaction/deliverable": 1, - "/newTransaction/payment": 1, - "/newTransaction/deadline": 1, - "/newTransaction/notifications": 1, - "/newTransaction/preview": 2, + "/new-transaction/escrow-type": 0, + "/new-transaction/title": 0, + "/new-transaction/deliverable": 1, + "/new-transaction/payment": 1, + "/new-transaction/deadline": 1, + "/new-transaction/notifications": 1, + "/new-transaction/preview": 2, }; const currentItemIndex = Object.entries(routeToIndexMap).reduce( diff --git a/web/src/pages/NewTransaction/index.tsx b/web/src/pages/NewTransaction/index.tsx index 0d2eb98..8ed40c1 100644 --- a/web/src/pages/NewTransaction/index.tsx +++ b/web/src/pages/NewTransaction/index.tsx @@ -52,8 +52,8 @@ const NewTransaction: React.FC = () => { {isConnected && isOnSupportedChain ? ( - } /> - } /> + } /> + } /> } /> } /> } />