Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toiletcoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
toiletcoin
Commits
6a0aa669
Commit
6a0aa669
authored
Aug 02, 2019
by
Tonk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update icon
parent
fb063297
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
src/Pages/Home.js
+3
-3
src/components/DataCard.js
+7
-3
src/components/DataTable.js
+9
-7
No files found.
src/Pages/Home.js
View file @
6a0aa669
...
@@ -11,14 +11,14 @@ const Data = [
...
@@ -11,14 +11,14 @@ const Data = [
{
{
title
:
'Current chart'
,
title
:
'Current chart'
,
backgroundColor
:
'#51ABAD'
,
backgroundColor
:
'#51ABAD'
,
detail
:
[{
smtitle
:
'Total current'
,
smnumber
:
0
}],
detail
:
[{
smtitle
:
'Total current'
,
smnumber
:
0
,
iconType
:
'money'
}],
},
},
{
{
title
:
'Revenue chart'
,
title
:
'Revenue chart'
,
backgroundColor
:
'#51ABAD'
,
backgroundColor
:
'#51ABAD'
,
detail
:
[
detail
:
[
{
smtitle
:
'Total revenue'
,
smnumber
:
18.0
},
{
smtitle
:
'Total revenue'
,
smnumber
:
18.0
,
iconType
:
'money'
},
{
smtitle
:
'Avg. revenue'
,
smnumber
:
17.53
},
{
smtitle
:
'Avg. revenue'
,
smnumber
:
17.53
,
iconType
:
'money'
},
{
smtitle
:
'Max. Revenue'
,
smnumber
:
18.0
,
iconType
:
'max'
},
{
smtitle
:
'Max. Revenue'
,
smnumber
:
18.0
,
iconType
:
'max'
},
{
smtitle
:
'Min. Revenue'
,
smnumber
:
17.0
,
iconType
:
'min'
},
{
smtitle
:
'Min. Revenue'
,
smnumber
:
17.0
,
iconType
:
'min'
},
],
],
...
...
src/components/DataCard.js
View file @
6a0aa669
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Card
,
Col
,
Row
,
Button
}
from
'react-bootstrap'
;
import
{
Card
,
Col
,
Row
,
Button
}
from
'react-bootstrap'
;
import
{
FaMoneyBillAlt
,
FaArrowUp
,
FaArrowDown
}
from
'react-icons/fa'
;
import
{
FaMoneyBillAlt
,
FaArrowUp
,
FaArrowDown
,
FaUserFriends
}
from
'react-icons/fa'
;
import
{
AreaChart
,
Area
,
XAxis
,
YAxis
,
ResponsiveContainer
}
from
'recharts'
;
import
{
AreaChart
,
Area
,
XAxis
,
YAxis
,
ResponsiveContainer
}
from
'recharts'
;
import
withWindowDimensions
from
'../utils/withWindowDimensions'
;
import
withWindowDimensions
from
'../utils/withWindowDimensions'
;
import
{
CSVLink
}
from
'react-csv'
;
import
{
CSVLink
}
from
'react-csv'
;
import
{
FaFileCsv
}
from
'react-icons/fa'
;
const
chartdata
=
[
const
chartdata
=
[
{
{
...
@@ -48,8 +49,10 @@ const SmCard = props => {
...
@@ -48,8 +49,10 @@ const SmCard = props => {
<
FaArrowUp
{...
iconStyle
}
/
>
<
FaArrowUp
{...
iconStyle
}
/
>
)
:
smdata
.
iconType
===
'min'
?
(
)
:
smdata
.
iconType
===
'min'
?
(
<
FaArrowDown
{...
iconStyle
}
/
>
<
FaArrowDown
{...
iconStyle
}
/
>
)
:
(
)
:
smdata
.
iconType
===
'money'
?
(
<
FaMoneyBillAlt
{...
iconStyle
}
/
>
<
FaMoneyBillAlt
{...
iconStyle
}
/
>
)
:
(
<
FaUserFriends
{...
iconStyle
}
/
>
)}
)}
<
/Col
>
<
/Col
>
<
Col
>
<
Col
>
...
@@ -114,7 +117,8 @@ const DataCard = props => {
...
@@ -114,7 +117,8 @@ const DataCard = props => {
<
/Row
>
<
/Row
>
<
Row
style
=
{{
justifyContent
:
'flex-end'
,
marginRight
:
1
}}
>
<
Row
style
=
{{
justifyContent
:
'flex-end'
,
marginRight
:
1
}}
>
<
CSVLink
data
=
{
data
.
detail
}
filename
=
{
data
.
title
}
>
<
CSVLink
data
=
{
data
.
detail
}
filename
=
{
data
.
title
}
>
<
Button
variant
=
"light"
style
=
{{
marginTop
:
'.5em'
}}
>
<
Button
variant
=
"outline-dark"
style
=
{{
marginTop
:
'.5em'
}}
>
<
FaFileCsv
style
=
{{
margin
:
'0 2px 2px 0'
}}
/
>
Export
to
CSV
Export
to
CSV
<
/Button
>
<
/Button
>
<
/CSVLink
>
<
/CSVLink
>
...
...
src/components/DataTable.js
View file @
6a0aa669
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Col
,
Table
,
Row
,
Button
}
from
'react-bootstrap'
;
import
{
Col
,
Table
,
Row
,
Button
}
from
'react-bootstrap'
;
import
{
CSVLink
}
from
'react-csv'
;
import
{
CSVLink
}
from
'react-csv'
;
import
{
FaFileCsv
}
from
'react-icons/fa'
;
const
data
=
[
const
data
=
[
{
site
:
'Pichaiyat Building'
,
people
:
2670.0
,
revenue
:
17.0
,
timestamp
:
'07/31/2019 14:23'
},
{
site
:
'Pichaiyat Building'
,
people
:
2670.0
,
revenue
:
17.0
,
timestamp
:
'07/31/2019 14:23'
},
{
site
:
'Pichaiyat Building'
,
people
:
2670.0
,
revenue
:
17.0
,
timestamp
:
'07/31/2019 14:23'
},
{
site
:
'Pichaiyat Building'
,
people
:
2670.0
,
revenue
:
17.0
,
timestamp
:
'07/31/2019 14:23'
},
...
@@ -22,6 +23,14 @@ const data = [
...
@@ -22,6 +23,14 @@ const data = [
const
DataTable
=
()
=>
{
const
DataTable
=
()
=>
{
return
(
return
(
<
Col
>
<
Col
>
<
Row
style
=
{{
marginLeft
:
1
}}
>
<
CSVLink
data
=
{
data
}
filename
=
{
'data-table'
}
>
<
Button
variant
=
"outline-dark"
style
=
{{
marginTop
:
'.5em'
}}
>
<
FaFileCsv
style
=
{{
margin
:
'0 2 5 0'
}}
/
>
Export
to
CSV
<
/Button
>
<
/CSVLink
>
<
/Row
>
<
Table
striped
bordered
hover
size
=
"sm"
style
=
{{
margin
:
'1em 0 0 0'
}}
>
<
Table
striped
bordered
hover
size
=
"sm"
style
=
{{
margin
:
'1em 0 0 0'
}}
>
<
thead
style
=
{{
backgroundColor
:
'#49b9ff'
,
color
:
'white'
}}
>
<
thead
style
=
{{
backgroundColor
:
'#49b9ff'
,
color
:
'white'
}}
>
<
tr
>
<
tr
>
...
@@ -42,13 +51,6 @@ const DataTable = () => {
...
@@ -42,13 +51,6 @@ const DataTable = () => {
))}
))}
<
/tbody
>
<
/tbody
>
<
/Table
>
<
/Table
>
<
Row
style
=
{{
justifyContent
:
'flex-end'
,
marginRight
:
1
}}
>
<
CSVLink
data
=
{
data
}
filename
=
{
'data-table'
}
>
<
Button
variant
=
"light"
style
=
{{
marginTop
:
'.5em'
}}
>
Export
to
CSV
<
/Button
>
<
/CSVLink
>
<
/Row
>
<
/Col
>
<
/Col
>
);
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment