Skip to content

Commit e3777c1

Browse files
committed
Refactor Back link into its own subcomponent
1 parent 62b911b commit e3777c1

File tree

3 files changed

+30
-41
lines changed

3 files changed

+30
-41
lines changed

frontend/src/About.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1-
import { Link } from "react-router-dom";
1+
import BackLink from "./shared/components/BackLink";
22

33
export default function About() {
44
return (
55
<div className="flex items-center pt-16 sm:mt-26 sm:pt-0">
66
<div className="relative max-w-2xl m-auto p-8 bg-[#F4F4F2] rounded-lg shadow-md">
7-
<Link
8-
className="absolute top-4 left-4 flex text-[#4a90e2] hover:text-[#3a7bc8] font-semibold cursor-pointer"
9-
to="/"
10-
aria-label="Go back"
11-
>
12-
<svg
13-
className="w-6 h-6 mr-2"
14-
fill="none"
15-
stroke="currentColor"
16-
strokeWidth={2}
17-
viewBox="0 0 24 24"
18-
>
19-
<path
20-
strokeLinecap="round"
21-
strokeLinejoin="round"
22-
d="M15 19l-7-7 7-7"
23-
/>
24-
</svg>
25-
Back
26-
</Link>
7+
<BackLink />
278
<p className="my-6">
289
<strong>Tenant First Aid</strong> is an AI-powered chatbot designed to
2910
help tenants navigate rental issues, answer questions, and provides

frontend/src/Disclaimer.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
import { Link } from "react-router-dom";
2+
import BackLink from "./shared/components/BackLink";
23

34
export default function Disclaimer() {
45
return (
56
<div className="flex items-center mt-16 sm:mt-26 sm:mb-10">
67
<div className="relative max-w-2xl m-auto p-8 bg-[#F4F4F2] rounded-lg shadow-md">
7-
<Link
8-
className="absolute top-4 left-4 flex text-[#4a90e2] hover:text-[#3a7bc8] font-semibold cursor-pointer"
9-
to="/"
10-
aria-label="Go back"
11-
>
12-
<svg
13-
className="w-6 h-6 mr-2"
14-
fill="none"
15-
stroke="currentColor"
16-
strokeWidth={2}
17-
viewBox="0 0 24 24"
18-
>
19-
<path
20-
strokeLinecap="round"
21-
strokeLinejoin="round"
22-
d="M15 19l-7-7 7-7"
23-
/>
24-
</svg>
25-
Back
26-
</Link>
8+
<BackLink />
279
<h2 className="text-2xl font-semibold mt-6 mb-2">Disclaimer</h2>
2810
<p>
2911
These Terms of Service ("<span className="underline">Terms</span>")
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Link } from "react-router-dom";
2+
3+
export default function BackLink() {
4+
return (
5+
<Link
6+
className="absolute top-4 left-4 flex text-[#4a90e2] hover:text-[#3a7bc8] font-semibold cursor-pointer"
7+
to="/"
8+
aria-label="Go back"
9+
>
10+
<svg
11+
className="w-6 h-6 mr-2"
12+
fill="none"
13+
stroke="currentColor"
14+
strokeWidth={2}
15+
viewBox="0 0 24 24"
16+
>
17+
<path
18+
strokeLinecap="round"
19+
strokeLinejoin="round"
20+
d="M15 19l-7-7 7-7"
21+
/>
22+
</svg>
23+
Back
24+
</Link>
25+
);
26+
}

0 commit comments

Comments
 (0)