1
- import React from 'react' ;
1
+ import React , { Component } from 'react' ;
2
2
3
- import Header from '../../components/Header' ;
4
- import RightPaneContainer from '../../components/RightPaneContainer' ;
5
- import Card from '../../components/Card' ;
6
- import CardControls from '../../components/CardControls' ;
7
- import LatestOperationItem from '../../components/LatestOperationItem' ;
3
+ import { Link } from 'react-router-dom' ;
8
4
9
- const cardData = [
10
- {
11
- id : 1 ,
12
- title : 'AccessBank debit card' ,
13
- color : 'rgb(232, 110, 106)' ,
14
- pan : '454588******5633' ,
15
- balance : 200 ,
16
- currency : 'AZN' ,
17
- currencyCode : '944' ,
18
- } ,
19
- {
20
- id : 2 ,
21
- title : 'Expressbank Gold' ,
22
- color : 'rgb(94, 116, 186)' ,
23
- pan : '886381******6729' ,
24
- balance : 100 ,
25
- currency : 'AZN' ,
26
- currencyCode : '944' ,
27
- }
28
- ]
5
+ import Header from 'components/Header' ;
6
+ import RightPaneContainer from 'components/RightPaneContainer' ;
7
+ import Card from 'components/Card' ;
8
+ import CardControls from 'components/CardControls' ;
9
+ import LatestOperationItem from 'components/LatestOperationItem' ;
10
+
11
+ import { cardData , latestPaymentData } from 'helpers' ;
29
12
30
- export default ( ) => {
31
- return (
32
- < div className = "pane" >
33
- < div className = "pane pane-main" >
34
- < Header title = "Cards" >
35
- < CardControls />
36
- </ Header >
37
- < div className = "pane pane-body" >
38
- < div id = "cards" className = "pane pane-cards ui-sortable" >
39
- {
40
- cardData . map ( ( card , index ) =>
41
- < Card key = { index } { ...card } />
42
- )
43
- }
13
+ export default class Cards extends Component {
14
+ render ( ) {
15
+ return (
16
+ < div className = "pane" >
17
+ < div className = "pane pane-main" >
18
+ < Header title = "Cards" >
19
+ < CardControls >
20
+ < button id = "card-edit" className = "menu-item inactive" title = "Редактировать карту" > < i className = "icon icon-edit" > </ i > </ button >
21
+ < button id = "card-delete" className = "menu-item inactive" title = "Удалить карту" > < i className = "icon icon-delete" > </ i > </ button >
22
+ < Link to = "/cards/add" id = "card-new" className = "menu-item" title = "Добавить карту" >
23
+ < i className = "icon icon-new" > </ i >
24
+ </ Link >
25
+ </ CardControls >
26
+ </ Header >
27
+ < div className = "pane pane-body" >
28
+ < div id = "cards" className = "pane pane-cards ui-sortable" >
29
+ {
30
+ cardData . map ( ( card , index ) =>
31
+ < Card key = { index } { ...card } />
32
+ )
33
+ }
34
+ </ div >
44
35
</ div >
45
36
</ div >
46
- </ div >
47
- < RightPaneContainer title = "Operations ">
48
- < div className = "pane pane-right-fixed " >
49
- < div className = "latest-payment-header" >
50
- < h2 className = "title" > Last payments </ h2 >
37
+ < RightPaneContainer title = "Operations" >
38
+ < div className = "pane pane-right-fixed ">
39
+ < div className = "latest-payment-header " >
40
+ < h2 className = "title" > Last payments </ h2 >
41
+ </ div >
51
42
</ div >
52
- </ div >
53
- < div id = "latest-operation-container" className = "pane pane-item-container" >
54
- < div className = "list list-right" >
55
- < LatestOperationItem />
43
+ < div id = "latest-operation-container" className = "pane pane-item-container" >
44
+ < div className = "list list-right" >
45
+ {
46
+ latestPaymentData . map ( ( item , index ) =>
47
+ < LatestOperationItem key = { index } { ...item } />
48
+ )
49
+ }
50
+ </ div >
56
51
</ div >
57
- </ div >
58
- </ RightPaneContainer >
59
- </ div >
60
- )
52
+ </ RightPaneContainer >
53
+ </ div >
54
+ )
55
+ }
61
56
}
0 commit comments