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

css for modal #41

Open
wants to merge 1 commit into
base: lac-main-css
Choose a base branch
from
Open
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
24 changes: 0 additions & 24 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,3 @@ body {
max-width: 600px;
}
}

/*
NEEDS TO BE REMOVED TO ANOTHER CSS FILE.
COMMENTED OUT IN ORDER TO NOT INTERFERE WITH WELCOME CSS

.modal_content {
position: absolute;
background-color: white;
position: abolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1rem;
border-radius: 0.5rem;
}

.close {
color: Black;
float: right;
}

.close:hover {
cursor: pointer;
} */
19 changes: 14 additions & 5 deletions src/DetailModal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import './css/DetailModal.css';

function DetailModal({ data, toggle }) {
const { name, nextPurchase, numberOfPurchases, lastPurchased } = data;
Expand All @@ -10,12 +11,20 @@ function DetailModal({ data, toggle }) {
<div className="modal">
<div className="modal_content">
<span className="close" onClick={handleClick}>
&larr;
</span>
<p>{name}</p>
<p>Next Purchase:{nextPurchase}</p>
<p>Number of purchases: {numberOfPurchases}</p>
<p>Last Purchase: {new Date(lastPurchased).toLocaleDateString()}</p>
<p className="modal_itemname">{name}</p>
<p>
<span className="modal_span">Next Purchase:</span> {nextPurchase}
</p>
<p>
<span className="modal_span">Number of purchases:</span>{' '}
{numberOfPurchases}
</p>
<p>
<span className="modal_span">Last Purchase:</span>{' '}
{new Date(lastPurchased).toLocaleDateString()}
</p>
</div>
</div>
);
Expand Down
47 changes: 47 additions & 0 deletions src/css/DetailModal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.modal {
position: fixed;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
z-index: 2000;
background-color: rgba(23, 62, 46, 0.9);
}

.modal_content {
font-family: 'Source Sans Pro', sans-serif;
position: absolute;
background-color: #f5f5f5;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1rem;
border-radius: 0.5rem;
}

.modal_itemname {
font-family: 'Playfair Display', serif;
font-size: 2rem;
font-weight: 600;
background-color: #c65e26;
/* color: #f5f5f5; */
padding: 1rem 0 1rem 0;
}

.modal_span {
font-weight: bold;
text-transform: lowercase;
}

.close {
text-transform: capitalize;
float: right;
transition: all 500ms;
}

.close:hover {
cursor: pointer;
color: #c65e26;
font-size: 1.3rem;
font-size-adjust: 5px;
}
6 changes: 0 additions & 6 deletions src/css/List.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
.item-control.inactive {
color: gray;
}
.modal {
position: fixed;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.25);
}

.item {
display: flex;
Expand Down