-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
polina
committed
Nov 21, 2024
1 parent
125be16
commit 4fbd0d2
Showing
9 changed files
with
233 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 23 additions & 2 deletions
25
src/func-pages/history-page/history-element/HistoryElement.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
export const HistoryElement = () => { | ||
return <li>sdds</li>; | ||
import { Transaction } from '../../../types'; | ||
import styles from './styles.module.css'; | ||
|
||
interface iHistoryElement { | ||
operation: Transaction; | ||
} | ||
|
||
export const HistoryElement = ({ operation }: iHistoryElement) => { | ||
const transactionType = operation.transactionType === 'INCOME'; | ||
return ( | ||
<li className={styles.history_element_container}> | ||
<div className={styles.history_element_wrapper}> | ||
<div className={styles.transaction__image}></div> | ||
<div className={styles.transaction__info}> | ||
<span className={styles.transaction__type}>{transactionType ? 'Пополнение' : 'Списание'}</span> | ||
<span className={styles.transaction__resource}>{operation.type === 'CARD' ? 'Карта' : 'Кошелек'}</span> | ||
</div> | ||
</div> | ||
<div className={`${styles.amount} ${transactionType ? styles.amount_income : styles.amount_outcome}`}> | ||
{operation.amount} | ||
</div> | ||
</li> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.history_element_container { | ||
padding: 10px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.history_element_wrapper { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 10px; | ||
} | ||
|
||
.transaction__image { | ||
width: 40px; | ||
height: 40px; | ||
border-radius: 50%; | ||
background-color: blueviolet; | ||
} | ||
|
||
.transaction__info { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.transaction__type { | ||
font-weight: 500; | ||
font-size: 18px; | ||
} | ||
|
||
.transaction__resource { | ||
font-size: 16px; | ||
opacity: 0.8; | ||
} | ||
|
||
.amount { | ||
font-size: 22px; | ||
font-weight: 500; | ||
} | ||
|
||
.amount_income { | ||
color: #58e018; | ||
} | ||
|
||
.amount_income::before { | ||
content: '+ '; | ||
} | ||
|
||
.amount_outcome { | ||
color: #e01818; | ||
} | ||
|
||
.amount_outcome::before { | ||
content: '- '; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
.container { | ||
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(1, 59, 155, 1) 100%); | ||
color: white; | ||
height: 100vh; | ||
} | ||
|
||
.header { | ||
font-size: 24px; | ||
font-weight: 400; | ||
padding: 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
font-size: 20px; | ||
} | ||
|
||
.header button { | ||
background: transparent; | ||
border: none; | ||
color: white; | ||
font-size: 18px; | ||
} | ||
|
||
.history_dates { | ||
list-style: none; | ||
padding: 0; | ||
margin: 20px 10px; | ||
} | ||
|
||
.operation__date { | ||
margin-top: 20px; | ||
width: calc(100% - 40px); | ||
margin-left: 10px; | ||
font-size: 22px; | ||
padding-bottom: 5px; | ||
border-bottom: 1px solid rgba(255, 255, 255, 0.356); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,7 @@ input { | |
input::placeholder { | ||
color: rgba(255, 255, 255, 0.356); | ||
} | ||
|
||
body { | ||
background-color: black; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters