Skip to content
Merged
Show file tree
Hide file tree
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
86 changes: 86 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,58 @@ h1 {
margin-bottom: 2em;
}

.add-form {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 1rem 1.5rem;
width: 100%;
max-width: 600px;
margin: 0 auto 2rem auto;
padding: 2rem;
background-color: #1f1f1f;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

}

.add-form label {
align-self: center;
font-weight: 500;
color: #f0f0f0;
}

.add-form input {
padding: 0.5em;
border: 1px solid #ccc;
border-radius: 4px;
font-family: inherit;
background-color: #2c2c2c;
color: #f0f0f0;
width: 100%;
}

.add-form input[type="checkbox"] {
width: auto;
}

.add-form input[type="checkbox"] {
justify-self: start;
transform: scale(1.6);
}

.add-form button[type="submit"] {
font-size: 1em;
font-weight: 500;
padding: 0.75em 1.5em;
grid-column: span 2;
justify-self: center;
margin-top: 1.5rem;
}

.add-form .discount-group {
display: contents;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
Expand Down Expand Up @@ -302,6 +354,40 @@ h1 {
.page-text {
margin-bottom: 2em;
}

.add-form {
max-width: 90%;
padding: 1.5rem;
grid-template-columns: 1fr;
gap: 1rem;
}

.add-form button[type="submit"] {
grid-column: span 1;
}

.add-form input {
padding-left: 0.5rem;
padding-right: 0.5rem;
box-sizing: border-box;
}

.add-form .discount-group {
display: flex;
align-items: center;
gap: 0.75rem;
grid-column: 1 / -1;
}

.add-form .discount-group label {
margin: 0;
}

.add-form .discount-group input[type="checkbox"] {
transform: scale(1.4);
}


}

@media (max-width: 600px) { /* smaller mobile view for font scaling */
Expand Down
38 changes: 35 additions & 3 deletions src/pages/AddItem.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
import React from "react"
import { Link } from "react-router-dom";

const AddItem: React.FC = () => {
return (
<main className="main">
<section className="page-container">
<h1 className="page-title">Add Item</h1>
<p className="page-text">
Add Item
</p>
<form className="add-form">
<label htmlFor="itemName"> Item Name </label>
<input type="text" id="itemName" name="itemName" placeholder="Item Name" required />

<label htmlFor="store"> Store </label>
<input type="text" id="store" name="store" placeholder="Store" required />
{/* <Link to="/create-new-store"> Create New Store</Link> */}

<label htmlFor="units"> Units </label>
<input type="text" id="units" name="units" placeholder="Units" />

<label htmlFor="itemPrice"> Item Price</label>
<input type="number" id="itemPrice" name="itemPrice" placeholder="Item Price" step="0.01" min="0" required />

<label htmlFor="barcode"> Barcode (Optional) </label>
<input type="text" id="barcode" name="barcode" placeholder="Barcode" />

<label htmlFor="description"> Item Description (Optional) </label>
<input type="text" id="description" name="description" placeholder="Description" />

<label htmlFor="otherStoreItemListings"> Other Store Item Listings </label>
<input type="text" id="otherStoreItemListings" name="otherStoreItemListings" placeholder="Other Store Item Listings" />

<div className="discount-group">
<label htmlFor="isDiscount">Discount?</label>
<input type="checkbox" id="isDiscount" name="isDiscount" />
</div>

<label htmlFor="discountedPrice"> Discounted Price</label>
<input type="number" id="discountedPrice" name="discountedPrice" placeholder="Discounted Price" step="0.01" min="0" />

<button type="submit" className="button">Submit</button>

</form>
</section>
</main>
);
Expand Down