Skip to content

Commit baa32a3

Browse files
committed
refactor: migrate NewTransaction Title component
1 parent 01d2991 commit baa32a3

File tree

3 files changed

+17
-42
lines changed

3 files changed

+17
-42
lines changed

web/src/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
--spacing-fluid-100-130: clamp(100px, calc(100px + (130 - 100) * (100vw - 375px) / (1250 - 375)), 130px);
4141
--spacing-fluid-300-424-300: clamp(300px, calc(300px + (424 - 300) * (100vw - 300px) / (1250 - 300)), 424px);
4242
--spacing-fluid-300-480: clamp(300px, calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375)), 480px);
43+
--spacing-fluid-342-500: clamp(342px, calc(342px + (500 - 342) * (100vw - 375px) / (1250 - 375)), 500px);
4344
--spacing-fluid-342-618: clamp(342px, calc(342px + (618 - 342) * (100vw - 375px) / (1250 - 375)), 618px);
4445
}
4546

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

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import React from "react";
22
import Header from "pages/NewTransaction/Header";
3-
import styled from "styled-components";
4-
import TextField from "./TextField";
53
import NavigationButtons from "pages/NewTransaction/NavigationButtons";
6-
7-
const Container = styled.div`
8-
display: flex;
9-
flex-direction: column;
10-
align-items: center;
11-
`;
4+
import { useNewTransactionContext } from "~src/context/NewTransactionContext";
5+
import { TextField } from "@kleros/ui-components-library";
126

137
const Title: React.FC = () => {
8+
const { escrowTitle, setEscrowTitle } = useNewTransactionContext();
9+
10+
const handleWrite = (value: string) => {
11+
setEscrowTitle(value);
12+
};
13+
1414
return (
15-
<Container>
15+
<div className="flex flex-col items-center">
1616
<Header text="Title" />
17-
<TextField />
17+
<TextField
18+
className="w-[84vw] lg:w-fluid-342-500"
19+
value={escrowTitle}
20+
onChange={handleWrite}
21+
placeholder="e.g. Escrow with John"
22+
/>
1823
<NavigationButtons prevRoute="/new-transaction/escrow-type" nextRoute="/new-transaction/deliverable" />
19-
</Container>
24+
</div>
2025
);
2126
};
2227
export default Title;

0 commit comments

Comments
 (0)