Skip to content

Commit 90550b1

Browse files
committed
feat(web): update-routes-paths-to-kebab-case
1 parent 204ecb0 commit 90550b1

File tree

19 files changed

+39
-40
lines changed

19 files changed

+39
-40
lines changed

web/src/app.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ const App: React.FC = () => {
2525
<NewTransactionProvider>
2626
<SentryRoutes>
2727
<Route path="/" element={<Layout />}>
28-
<Route index element={<Navigate to="newTransaction" replace />} />
29-
<Route path="newTransaction/*" element={<NewTransaction />} />
30-
<Route path="myTransactions/*" element={<MyTransactions />} />
28+
<Route index element={<Navigate to="new-transaction" replace />} />
29+
<Route path="new-transaction/*" element={<NewTransaction />} />
30+
<Route path="my-transactions/*" element={<MyTransactions />} />
3131
<Route path="*" element={<h1>404 not found</h1>} />
3232
</Route>
3333
</SentryRoutes>

web/src/components/TransactionCard/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const TransactionCard: React.FC<ITransactionCard> = ({
7777
return (
7878
<>
7979
{!isList || overrideIsList ? (
80-
<StyledCard hover onClick={() => navigateAndScrollTop(`/myTransactions/${id.toString()}`)}>
80+
<StyledCard hover onClick={() => navigateAndScrollTop(`/my-transactions/${id.toString()}`)}>
8181
<StatusBanner id={parseInt(id)} status={currentStatusEnum} />
8282
<CardContainer>
8383
{!isUndefined(title) ? <StyledTitle>{title}</StyledTitle> : <StyledSkeleton />}
@@ -92,7 +92,7 @@ const TransactionCard: React.FC<ITransactionCard> = ({
9292
</CardContainer>
9393
</StyledCard>
9494
) : (
95-
<StyledListItem hover onClick={() => navigateAndScrollTop(`/myTransactions/${id.toString()}`)}>
95+
<StyledListItem hover onClick={() => navigateAndScrollTop(`/my-transactions/${id.toString()}`)}>
9696
<StatusBanner isCard={false} id={parseInt(id)} status={currentStatusEnum} />
9797
<ListContainer>
9898
{!isUndefined(title) ? (

web/src/layout/Header/navbar/Explore.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const StyledLink = styled(Link)<{ isActive: boolean }>`
4848
`;
4949

5050
const links = [
51-
{ to: "/newTransaction", text: "New Transaction" },
52-
{ to: "/myTransactions/display/1/desc/all", text: "My Transactions" },
51+
{ to: "/new-transaction", text: "New Transaction" },
52+
{ to: "/my-transactions/display/1/desc/all", text: "My Transactions" },
5353
];
5454

5555
const Explore: React.FC = () => {

web/src/pages/MyTransactions/Modal/PaymentReleased/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useRef } from "react";
22
import { useClickAway } from "react-use";
3-
import { StyledModal } from "~src/pages/MyTransactions/Modal/StyledModal";
3+
import { StyledModal } from "pages/MyTransactions/Modal/StyledModal";
44
import VerifiedLogo from "./VerifiedLogo";
55
import Header from "./Header";
66
import Description from "./Description";

web/src/pages/MyTransactions/Modal/ProposeSettlementModal/Buttons/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ const Buttons: React.FC<IButtons> = ({ toggleModal, amountProposed, isAmountVali
2525
</Container>
2626
);
2727
};
28+
2829
export default Buttons;

web/src/pages/MyTransactions/TransactionDetails/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ const TransactionDetails: React.FC = () => {
5252
const transactionInfo = useFetchIpfsJson(transactionUri);
5353

5454
useEffect(() => {
55-
if (transactionDetails) {
56-
setTransactionDetails(transactionDetails.escrow);
57-
} else setTransactionDetails({});
55+
setTransactionDetails(transactionDetails?.escrow);
5856
}, [transactionDetails, setTransactionDetails]);
5957

6058
return (

web/src/pages/NewTransaction/EscrowDetails/Title/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Title: React.FC = () => {
1515
<Container>
1616
<Header text="Title" />
1717
<TextField />
18-
<NavigationButtons prevRoute="/newTransaction/typeOfEscrow" nextRoute="/newTransaction/deliverable" />
18+
<NavigationButtons prevRoute="/new-transaction/escrow-type" nextRoute="/new-transaction/deliverable" />
1919
</Container>
2020
);
2121
};

web/src/pages/NewTransaction/EscrowDetails/TypeOfEscrow/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TypeOfEscrow: React.FC = () => {
1717
<Header text="What kind of escrow do you want to create?" />
1818
<EscrowOptions />
1919
<Info />
20-
<NavigationButtons prevRoute="" nextRoute="/newTransaction/title" />
20+
<NavigationButtons prevRoute="" nextRoute="/new-transaction/title" />
2121
</Container>
2222
);
2323
};

web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const DepositPaymentButton: React.FC = () => {
6969
label: "Transaction Terms",
7070
uri: extraDescriptionUri,
7171
},
72-
frontendUrl: `https://escrow-v2.kleros.builders/#/myTransactions/%s`,
72+
frontendUrl: `https://escrow-v2.kleros.builders/#/my-transactions/%s`,
7373
arbitrableChainID: "421614",
7474
arbitrableAddress: "0x250AB0477346aDFC010585b58FbF61cff1d8f3ea",
7575
arbitratorChainID: "421614",
@@ -115,7 +115,7 @@ const DepositPaymentButton: React.FC = () => {
115115
.then((wrapResult) => {
116116
if (wrapResult.status) {
117117
resetContext();
118-
navigate("/myTransactions/display/1/desc/all");
118+
navigate("/my-transactions/display/1/desc/all");
119119
}
120120
})
121121
.catch((error) => {

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ const NextButton: React.FC<INextButton> = ({ nextRoute }) => {
5656

5757
const isButtonDisabled =
5858
escrowType === "swap" ||
59-
(location.pathname.includes("/newTransaction/title") && !escrowTitle) ||
60-
(location.pathname.includes("/newTransaction/deliverable") && !isDeliverableValid) ||
61-
(location.pathname.includes("/newTransaction/payment") &&
59+
(location.pathname.includes("/new-transaction/title") && !escrowTitle) ||
60+
(location.pathname.includes("/new-transaction/deliverable") && !isDeliverableValid) ||
61+
(location.pathname.includes("/new-transaction/payment") &&
6262
(areSendingFieldsEmpty ||
6363
!isSellerAddressValid ||
6464
!isRecipientAddressResolved ||
6565
!hasSufficientNativeBalance)) ||
66-
(location.pathname.includes("/newTransaction/deadline") && (!deadline || isDeadlineInPast)) ||
67-
(location.pathname.includes("/newTransaction/notifications") && !isEmailValid);
66+
(location.pathname.includes("/new-transaction/deadline") && (!deadline || isDeadlineInPast)) ||
67+
(location.pathname.includes("/new-transaction/notifications") && !isEmailValid);
6868

6969
const handleNextClick = async () => {
7070
try {
71-
if (location.pathname.includes("/newTransaction/deliverable") && escrowType === "general") {
71+
if (location.pathname.includes("/new-transaction/deliverable") && escrowType === "general") {
7272
const transactionUri = await handleFileUpload(
7373
escrowTitle,
7474
deliverableText,

web/src/pages/NewTransaction/NavigationButtons/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const NavigationButtons: React.FC<NavigationButtonsProps> = ({ prevRoute, nextRo
2121
return (
2222
<Container>
2323
<PreviousButton prevRoute={prevRoute} />
24-
{prevRoute === "/newTransaction/notifications" ? <DepositPaymentButton /> : <NextButton nextRoute={nextRoute} />}
24+
{prevRoute === "/new-transaction/notifications" ? <DepositPaymentButton /> : <NextButton nextRoute={nextRoute} />}
2525
</Container>
2626
);
2727
};

web/src/pages/NewTransaction/Preview/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Preview: React.FC = () => {
5151
extraDescriptionUri={extraDescriptionUri}
5252
isPreview={true}
5353
/>
54-
<NavigationButtons prevRoute="/newTransaction/notifications" nextRoute="/newTransaction/deliverable" />
54+
<NavigationButtons prevRoute="/new-transaction/notifications" nextRoute="/new-transaction/deliverable" />
5555
</Container>
5656
);
5757
};

web/src/pages/NewTransaction/Terms/Deadline/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Deadline: React.FC = () => {
2424
<Container>
2525
<Header text="Delivery Deadline" />
2626
<StyledDatepicker time onSelect={handleDateSelect} />
27-
<NavigationButtons prevRoute="/newTransaction/payment" nextRoute="/newTransaction/notifications" />
27+
<NavigationButtons prevRoute="/new-transaction/payment" nextRoute="/new-transaction/notifications" />
2828
</Container>
2929
);
3030
};

web/src/pages/NewTransaction/Terms/Deliverable/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ const Deliverable: React.FC = () => {
8282
placeholder="eg. I should receive a website created in React with the following specification: x,y,z."
8383
/>
8484
<StyledFileUploader callback={handleAttachFile} variant="info" msg={fileFootMessage} />
85-
<NavigationButtons prevRoute="/newTransaction/title" nextRoute="/newTransaction/payment" />
85+
<NavigationButtons prevRoute="/new-transaction/title" nextRoute="/new-transaction/payment" />
8686
</>
8787
) : (
8888
<TokenTransaction
8989
headerText="I should receive"
90-
prevRoute="/newTransaction/title"
91-
nextRoute="/newTransaction/payment"
90+
prevRoute="/new-transaction/title"
91+
nextRoute="/new-transaction/payment"
9292
quantity={receivingQuantity}
9393
setQuantity={setReceivingQuantity}
9494
token={receivingToken}

web/src/pages/NewTransaction/Terms/Notifications/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Notifications: React.FC = () => {
1515
<Container>
1616
<Header text="Subscribe for Email Notifications" />
1717
<EmailField />
18-
<NavigationButtons prevRoute="/newTransaction/deadline" nextRoute="/newTransaction/preview" />
18+
<NavigationButtons prevRoute="/new-transaction/deadline" nextRoute="/new-transaction/preview" />
1919
</Container>
2020
);
2121
};

web/src/pages/NewTransaction/Terms/Payment/GeneralTransaction/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const GeneralTransaction: React.FC = () => {
2727
<TokenAndAmount quantity={sendingQuantity} setQuantity={setSendingQuantity} />
2828
<ToDivider />
2929
<DestinationAddress recipientAddress={sellerAddress} setRecipientAddress={setSellerAddress} />
30-
<NavigationButtons prevRoute="/newTransaction/deliverable" nextRoute="/newTransaction/deadline" />
30+
<NavigationButtons prevRoute="/new-transaction/deliverable" nextRoute="/new-transaction/deadline" />
3131
</Container>
3232
);
3333
};

web/src/pages/NewTransaction/Terms/Payment/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const Payment: React.FC = () => {
1919
) : (
2020
<TokenTransaction
2121
headerText="I am paying"
22-
prevRoute="/newTransaction/deliverable"
23-
nextRoute="/newTransaction/deadline"
22+
prevRoute="/new-transaction/deliverable"
23+
nextRoute="/new-transaction/deadline"
2424
quantity={sendingQuantity}
2525
setQuantity={setSendingQuantity}
2626
token={sendingToken}

web/src/pages/NewTransaction/Timeline.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ const Timeline: React.FC = () => {
2727
const location = useLocation();
2828

2929
const routeToIndexMap = {
30-
"/newTransaction/typeOfEscrow": 0,
31-
"/newTransaction/title": 0,
32-
"/newTransaction/deliverable": 1,
33-
"/newTransaction/payment": 1,
34-
"/newTransaction/deadline": 1,
35-
"/newTransaction/notifications": 1,
36-
"/newTransaction/preview": 2,
30+
"/new-transaction/escrow-type": 0,
31+
"/new-transaction/title": 0,
32+
"/new-transaction/deliverable": 1,
33+
"/new-transaction/payment": 1,
34+
"/new-transaction/deadline": 1,
35+
"/new-transaction/notifications": 1,
36+
"/new-transaction/preview": 2,
3737
};
3838

3939
const currentItemIndex = Object.entries(routeToIndexMap).reduce(

web/src/pages/NewTransaction/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const NewTransaction: React.FC = () => {
5252
{isConnected && isOnSupportedChain ? (
5353
<MiddleContentContainer>
5454
<Routes>
55-
<Route index element={<Navigate to="typeOfEscrow" replace />} />
56-
<Route path="/typeOfEscrow/*" element={<TypeOfEscrow />} />
55+
<Route index element={<Navigate to="escrow-type" replace />} />
56+
<Route path="/escrow-type/*" element={<TypeOfEscrow />} />
5757
<Route path="/title/*" element={<Title />} />
5858
<Route path="/deliverable/*" element={<Deliverable />} />
5959
<Route path="/payment/*" element={<Payment />} />

0 commit comments

Comments
 (0)