-
Notifications
You must be signed in to change notification settings - Fork 8
/
Card.jsx
56 lines (47 loc) · 1.12 KB
/
Card.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import styled from '@emotion/styled';
import { memo, useCallback } from 'react';
const Card = ({ cardData, onClickEvent }) => {
const cardClickHandler = useCallback(
(e) => {
onClickEvent(cardData);
},
[onClickEvent, cardData]
);
if (!cardData) return null;
return (
<Container onClick={cardClickHandler}>
<div>{cardData.fcNm}</div>
<div>{cardData.fcAddr}</div>
<div>{cardData.ref1}</div>
{cardData.memo && <div>{cardData.memo}</div>}
</Container>
);
};
const Container = styled.div`
width: 90%;
padding: 20px 24px;
border: 2px solid #999;
border-radius: 10px;
&:hover {
cursor: pointer;
box-shadow: 0 2px 4px 0 #acabab, 0 0 0 0.5px #e9ebee inset, 0 0 0 0.5px #e9ebee inset;
}
& div:nth-of-type(1) {
font-family: sans-serif;
font-size: 1.2rem;
font-weight: 700;
color: #3fc176;
}
& div:nth-of-type(2) {
margin-top: 0.1rem;
font-family: sans-serif;
font-size: 1rem;
}
& div:nth-of-type(3) {
margin-top: 0.1rem;
font-family: sans-serif;
font-size: 0.9rem;
color: #e74c3c;
}
`;
export default memo(Card);