-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Plan * Work on header. * Adjust search * Adjust colors. * Extract primary header. * Make cards list scrollable. * Adjust colors. * Add more dummy pages. * Navigate with query * Adjust plan * Fix error.
- Loading branch information
1 parent
05084b0
commit e77c26e
Showing
11 changed files
with
144 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,57 @@ | ||
import { PredefinedCompanies, Routes } from '@/app/lib/shared'; | ||
import { PrimaryHeader } from '@/app/ui/primary-header'; | ||
import { | ||
IconGift, | ||
IconLayoutGrid, | ||
IconPlus, | ||
IconSearch, | ||
} from '@tabler/icons-react'; | ||
import Link from 'next/link'; | ||
|
||
export default function Page() { | ||
return <main>Add cards</main>; | ||
return ( | ||
<div className="h-full flex flex-col"> | ||
<PrimaryHeader | ||
title="Add cards" | ||
actions={ | ||
<Link href={Routes.ScanCard}> | ||
<button className="btn btn-primary"> | ||
<IconPlus className="w-6 h-6" /> | ||
Add card | ||
</button> | ||
</Link> | ||
} | ||
> | ||
<> | ||
<div className="form-control flex-1"> | ||
<label className="input input-bordered flex items-center gap-2 w-full"> | ||
<input type="text" className="grow w-full" placeholder="Search" /> | ||
<IconSearch className="h-4 w-4 opacity-70"></IconSearch> | ||
</label> | ||
</div> | ||
<button className="btn btn-circle btn-ghost"> | ||
<IconLayoutGrid className="w-6 h-6" /> | ||
</button> | ||
</> | ||
</PrimaryHeader> | ||
<main className="overflow-y-auto flex-1 bg-base-100"> | ||
<ul className="menu menu-lg rounded-box text-base-content"> | ||
{Object.values(PredefinedCompanies).map(company => ( | ||
<li key={company}> | ||
<Link | ||
href={{ | ||
pathname: Routes.ScanCard, | ||
query: { predefinedCompany: company }, | ||
}} | ||
prefetch={false} | ||
> | ||
<IconGift className="w-8 h-8" /> | ||
{company} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</main> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.bottomBarNavHeight { | ||
height: var(--bottom-bar-height); | ||
} | ||
.childrenHeight { | ||
height: calc(100vh - var(--bottom-bar-height)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return <div>Scan card page</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return <div>Scan card page</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Image from 'next/image'; | ||
|
||
export function PrimaryHeader({ | ||
title, | ||
actions, | ||
children, | ||
}: { | ||
title: string; | ||
actions?: React.ReactNode; | ||
children?: React.ReactNode; | ||
}) { | ||
return ( | ||
<header> | ||
<div className="navbar bg-base-200 text-base-content"> | ||
<div className="navbar-start"> | ||
<Image | ||
src="/logo.svg" | ||
alt="Tilda logo" | ||
className="w-8 rounded-lg bg-base-content" | ||
width={24} | ||
height={24} | ||
/> | ||
<h1 className="btn btn-ghost text-lg">{title}</h1> | ||
</div> | ||
{actions && <div className="navbar-end">{actions}</div>} | ||
</div> | ||
{children && ( | ||
<div className="navbar bg-base-100 text-base-content gap-2"> | ||
{children} | ||
</div> | ||
)} | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters