Skip to content

Commit 62d6ce4

Browse files
committed
feat: improve landing page and change font
1 parent 2bc04a9 commit 62d6ce4

File tree

9 files changed

+78
-36
lines changed

9 files changed

+78
-36
lines changed

messages/ar.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"landing": {
3-
"navigate": "انتقل إلى القضية"
3+
"title": "البحث عن قضية",
4+
"subtitle": "أدخل رقم القضية لعرض تفاصيلها.",
5+
"button": "بحث"
46
},
57
"case": {
68
"title": "القضية",

messages/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"landing": {
3-
"navigate": "navigate to case"
3+
"title": "Search for a Case",
4+
"subtitle": "Enter the case number to view its details.",
5+
"button": "Search"
46
},
57
"case": {
68
"title": "CASE",

messages/es.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"landing": {
3-
"navigate": "navigate to case"
3+
"title": "Busca un Caso",
4+
"subtitle": "Introduzca el número del caso para ver los detalles.",
5+
"button": "Buscar"
46
},
57
"case": {
68
"title": "CASO",

public/search.svg

Lines changed: 10 additions & 0 deletions
Loading

src/app/[locale]/components/Navbar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ const Navbar: React.FC<INavbar> = ({ locale }) => {
4141
className={clsx(
4242
"justify-self-end place-self-center",
4343
"border-stroke border-2 rounded",
44+
"transition hover:scale-110 hover:drop-shadow",
4445
)}
4546
>
4647
<DropdownMenu>
4748
<DropdownMenuTrigger
4849
className={clsx(
49-
"focus:outline-none hover:bg-light-background transition",
50-
"rounded",
50+
"focus:outline-none transition",
51+
"rounded bg-light-background",
5152
"py-2 px-4",
5253
)}
5354
>

src/app/[locale]/layout.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@ import clsx from "clsx";
22
import type { Metadata } from "next";
33
import { NextIntlClientProvider } from "next-intl";
44
import { getMessages } from "next-intl/server";
5-
import localFont from "next/font/local";
5+
import { Open_Sans } from "next/font/google";
66
import { getLangDir } from "rtl-detect";
77

88
import Navbar from "./components/Navbar";
99

1010
import "../globals.css";
1111

12-
const geistSans = localFont({
13-
src: "../fonts/GeistVF.woff",
14-
variable: "--font-geist-sans",
15-
weight: "100 900",
16-
});
17-
const geistMono = localFont({
18-
src: "../fonts/GeistMonoVF.woff",
19-
variable: "--font-geist-mono",
20-
weight: "100 900",
12+
const openSans = Open_Sans({
13+
subsets: ["latin"],
14+
display: "swap",
2115
});
2216

2317
export const metadata: Metadata = {
24-
title: "Create Next App",
25-
description: "Generated by create next app",
18+
title: "Kleros: Library of Justice",
19+
description: "Kleros archival UI",
2620
};
2721

2822
export default async function RootLayout({
@@ -38,11 +32,7 @@ export default async function RootLayout({
3832
return (
3933
<html lang={locale}>
4034
<body
41-
className={clsx(
42-
geistSans.variable,
43-
geistMono.variable,
44-
"antialiased bg-white-background",
45-
)}
35+
className={clsx(openSans.className, "antialiased bg-white-background")}
4636
dir={langDir}
4737
>
4838
<NextIntlClientProvider {...{ messages }}>

src/app/[locale]/page.tsx

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,80 @@
11
"use client";
22

33
import clsx from "clsx";
4-
import { useTranslations } from "next-intl";
4+
import { useLocale, useTranslations } from "next-intl";
5+
import Image from "next/image";
6+
import { getLangDir } from "rtl-detect";
57

68
import { useRouter } from "@/i18n/routing";
79

810
const Home: React.FC = () => {
911
const t = useTranslations("landing");
12+
const locale = useLocale();
13+
const langDir = getLangDir(locale);
14+
1015
const router = useRouter();
16+
1117
return (
1218
<div className="mx-auto my-auto">
13-
<h1 className="text-secondary-text text-2xl font-bold text-center">
14-
{t("navigate").toUpperCase()}
19+
<h1 className="text-secondary-text text-xl font-bold text-center">
20+
{t("title")}
1521
</h1>
22+
<h2 className="text-secondary-text text-md text-center">
23+
{t("subtitle")}
24+
</h2>
1625
<form
17-
className="my-4 text-center"
26+
className="my-4 flex justify-center items-center"
1827
action={(formData) => {
1928
const disputeId = formData.get("dispute")?.toString();
2029
if (!disputeId) return;
2130
router.push(`/case/${disputeId}`);
2231
}}
2332
>
24-
<label
25-
htmlFor="dispute"
26-
className="text-2xl font-bold text-primary-blue"
27-
>
28-
#
33+
<div className="relative">
2934
<input
3035
name="dispute"
3136
className={clsx(
32-
"w-32 ml-2 border-b-4",
33-
"text-2xl font-semibold border-slate-300 focus:outline-0 p-2",
37+
"w-32 h-10 border-2 border-stroke",
38+
"focus:outline-none",
39+
{
40+
"rounded-l pl-6": langDir === "ltr",
41+
"rounded-r pr-6": langDir === "rtl",
42+
},
43+
"text-md font-semibold text-secondary-text p-2",
3444
)}
3545
type="number"
3646
step={1}
3747
min={0}
3848
max={1000000}
3949
/>
40-
</label>
41-
<button type="submit" className="p-2 text-2xl text-primary-blue">
42-
50+
<span
51+
className={clsx(
52+
"absolute top-1/2 -translate-y-1/2 text-lg",
53+
{
54+
"left-2": langDir === "ltr",
55+
"right-2": langDir === "rtl",
56+
},
57+
"font-semibold text-secondary-text",
58+
)}
59+
>
60+
#
61+
</span>
62+
</div>
63+
<button
64+
type="submit"
65+
className={clsx(
66+
"bg-primary-blue h-10",
67+
{
68+
"rounded-r": langDir === "ltr",
69+
"rounded-l": langDir === "rtl",
70+
},
71+
"text-base text-white-background font-semibold",
72+
"px-4 flex gap-2 justify-center items-center",
73+
"hover:bg-secondary-blue transition",
74+
)}
75+
>
76+
<Image src="/search.svg" alt="Search" width="16" height="16" />
77+
{t("button")}
4378
</button>
4479
</form>
4580
</div>

src/app/fonts/GeistMonoVF.woff

-66.3 KB
Binary file not shown.

src/app/fonts/GeistVF.woff

-64.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)