Ken Schaefer
2 years ago
6 changed files with 87 additions and 20 deletions
@ -0,0 +1,26 @@
|
||||
.expense-date { |
||||
display: flex; |
||||
flex-direction: column; |
||||
width: 5.5rem; |
||||
height: 5.5rem; |
||||
border: 1px solid #ececec; |
||||
background-color: #2a2a2a; |
||||
color: white; |
||||
border-radius: 12px; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.expense-date__month { |
||||
font-size: 0.75rem; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.expense-date__year { |
||||
font-size: 0.75rem; |
||||
} |
||||
|
||||
.expense-date__day { |
||||
font-size: 1.5rem; |
||||
font-weight: bold; |
||||
} |
@ -0,0 +1,17 @@
|
||||
import './ExpenseDate.css'; |
||||
|
||||
function ExpenseDate(props) { |
||||
const month = props.date.toLocaleString('en-US', { month: 'long' }); |
||||
const day = props.date.toLocaleString('en-US', { day: '2-digit' }); |
||||
const year = props.date.getFullYear(); |
||||
|
||||
return ( |
||||
<div className="expense-date"> |
||||
<div className="expense-date__month">{month}</div> |
||||
<div className="expense-date__year">{year}</div> |
||||
<div className="expense-date__day">{day}</div> |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default ExpenseDate; |
@ -0,0 +1,9 @@
|
||||
.expenses { |
||||
padding: 1rem; |
||||
background-color: rgb(31, 31, 31); |
||||
margin: 2rem auto; |
||||
width: 50rem; |
||||
max-width: 95%; |
||||
border-radius: 12px; |
||||
box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); |
||||
} |
@ -0,0 +1,31 @@
|
||||
import ExpenseItem from "./ExpenseItem"; |
||||
import "./Expenses.css"; |
||||
|
||||
function Expenses(props) { |
||||
return ( |
||||
<div className="expenses"> |
||||
<ExpenseItem |
||||
title={props.items[0].title} |
||||
amount={props.items[0].amount} |
||||
date={props.items[0].date} |
||||
></ExpenseItem> |
||||
<ExpenseItem |
||||
title={props.items[1].title} |
||||
amount={props.items[1].amount} |
||||
date={props.items[1].date} |
||||
></ExpenseItem> |
||||
<ExpenseItem |
||||
title={props.items[2].title} |
||||
amount={props.items[2].amount} |
||||
date={props.items[2].date} |
||||
></ExpenseItem> |
||||
<ExpenseItem |
||||
title={props.items[3].title} |
||||
amount={props.items[3].amount} |
||||
date={props.items[3].date} |
||||
></ExpenseItem> |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default Expenses; |
Loading…
Reference in new issue