Skip to content

Commit 5b519a8

Browse files
committed
Style form to add list and individual lists
1 parent a0aaa16 commit 5b519a8

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

src/components/CreateList.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ export function CreateList({ user, setListPath }: Props) {
4848
return (
4949
<>
5050
<Form onSubmit={handleSubmit}>
51-
<h3>Create New Shopping List</h3>
52-
<Form.Label htmlFor="newListName">Name Your List</Form.Label>
51+
<h3 className="heading-text">
52+
<Form.Label htmlFor="newListName">Create A New List</Form.Label>
53+
</h3>
5354
<InputGroup>
5455
<br />
5556
<Form.Control
@@ -62,7 +63,11 @@ export function CreateList({ user, setListPath }: Props) {
6263
aria-required="true" // Indicates that this field is required
6364
/>
6465
<br />
65-
<Button aria-label="Create new shopping list">Create List</Button>
66+
<div className="custom-button-wrapper">
67+
<Button aria-label="Create new shopping list" type="submit">
68+
Create List
69+
</Button>
70+
</div>
6671
</InputGroup>
6772
</Form>
6873
</>

src/components/SingleList.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
@import "../views/unauthenticated/UnauthenticatedHome.scss";
2+
13
.SingleList {
4+
@extend .custom-button-wrapper;
5+
// @extend .button;
26
align-items: baseline;
3-
display: flex;
4-
flex-direction: row;
57
font-size: 1.2em;
8+
width: 120px;
69
}
710

811
.SingleList-label {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.lists {
2+
margin-top: 20px;
3+
padding: 0;
4+
display: flex;
5+
justify-content: space-between;
6+
flex-flow: wrap;
7+
}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { SingleList, CreateList } from "../../components";
33
import { List, User } from "../../api";
4+
import "./AuthenticatedHome.scss";
45

56
interface Props {
67
data: List[];
@@ -10,14 +11,11 @@ interface Props {
1011

1112
export function AuthenticatedHome({ data, setListPath, user }: Props) {
1213
return (
13-
<>
14-
<p>
15-
Hello from the home (<code>/</code>) page!
16-
</p>
17-
14+
<div className="home">
1815
{user && (
1916
<>
20-
<ul>
17+
<CreateList user={user} setListPath={setListPath} />
18+
<ul className="lists">
2119
{data.map((list, index) => (
2220
<SingleList
2321
key={index}
@@ -27,9 +25,8 @@ export function AuthenticatedHome({ data, setListPath, user }: Props) {
2725
/>
2826
))}
2927
</ul>
30-
<CreateList user={user} setListPath={setListPath} />
3128
</>
3229
)}
33-
</>
30+
</div>
3431
);
3532
}

src/views/unauthenticated/UnauthenticatedHome.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.home {
44
background-color: rgba($primary-beige, 0.9);
55
border-radius: 5%;
6+
padding: 40px;
67
}
78

89
.heading-text {

0 commit comments

Comments
 (0)