Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style home page and make it responsive #56

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,40 @@ export function Home({ data, setListPath, setAllLists }) {
};

return (
<div className="Home">
<ul className="font-archivo">
<div className="flex flex-col h-[80vh] my-8 p-8 bg-white rounded-3xl shadow-xl overflow-hidden mx-auto">
<ul className="font-archivo flex-grow overflow-y-auto space-y-4">
{data &&
data.map((list) => {
const uniqueId = crypto.randomUUID();
return (
<Fragment key={uniqueId}>
<SingleList
name={list.name}
setListPath={setListPath}
path={list.path}
/>
<button onClick={() => handleDelete(list)}>
<DeleteIcon />
</button>

<ShareListComponent
name={list.name}
setListPath={setListPath}
path={list.path}
/>

<br></br>
<br></br>
<div className="flex items-center justify-between p-4 rounded-3xl shadow-md border">
<SingleList
name={list.name}
setListPath={setListPath}
path={list.path}
/>
<div className="flex items-center space-x-4">
<button onClick={() => handleDelete(list)} className="p-2">
<DeleteIcon />
</button>
<ShareListComponent
name={list.name}
setListPath={setListPath}
path={list.path}
/>
</div>
</div>
</Fragment>
);
})}
</ul>
<form action="" onSubmit={handleSubmit}>
<label htmlFor="listName">Add a New List:</label>
<form
action=""
onSubmit={handleSubmit}
className="flex flex-col sm:flex-row items-center space-y-2 sm:space-y-0 sm:space-x-4 mt-4"
>
<label htmlFor="listName">Create a new list:</label>
<input
type="text"
id="listName"
Expand Down
Loading