Skip to content

Commit

Permalink
Added navigation and download options
Browse files Browse the repository at this point in the history
  • Loading branch information
email2vimalraj committed Sep 13, 2019
1 parent 0b88dff commit bdbe2bd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
49 changes: 32 additions & 17 deletions src/pages/admin/feedback.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from "react";
import { Row, Table, Spin } from "antd";
import { Row, Col, Table, Spin, Button } from "antd";
import { CSVLink } from "react-csv";

import "../../style.css";

import FirebaseContext from "../../firebase";

const AdminFeedback = () => {
Expand Down Expand Up @@ -191,23 +193,36 @@ const AdminFeedback = () => {
});

return (
<Row style={{ marginTop: 30, marginBottom: 30 }}>
<CSVLink
data={dataSource}
headers={columns}
filename={`feedbacks-${Date.now()}.csv`}
style={{ marginBottom: 10 }}
className="ant-btn button ant-btn-lg"
<>
<Row
type="flex"
justify="center"
style={{ marginTop: 30, marginBottom: 30 }}
>
Download
</CSVLink>
<Table
columns={columns}
dataSource={dataSource}
bordered
pagination={false}
/>
</Row>
<Col span={12}>
<Button size="large" className="button" href="/Ecl1392019">
Questions
</Button>
<CSVLink
data={dataSource}
headers={columns}
filename={`feedbacks-${Date.now()}.csv`}
style={{ marginBottom: 10 }}
className="ant-btn button ant-btn-lg"
>
Download
</CSVLink>
</Col>
</Row>
<Row style={{ marginTop: 30, marginBottom: 30 }}>
<Table
columns={columns}
dataSource={dataSource}
bordered
pagination={false}
/>
</Row>
</>
);
};

Expand Down
9 changes: 8 additions & 1 deletion src/pages/admin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
import { Row, Table, Col, Spin } from "antd";
import { Row, Table, Col, Spin, Button } from "antd";

import "../../style.css";

import FirebaseContext from "../../firebase";

Expand Down Expand Up @@ -67,6 +69,11 @@ const Admin = () => {
style={{ marginTop: 30, marginBottom: 30 }}
>
<Col span={12}>
<Button size="large" className="button" href="/Ecl1392019/feedback">
Feedbacks
</Button>
<br />
<br />
<Table
columns={columns}
dataSource={dataSource}
Expand Down

0 comments on commit bdbe2bd

Please sign in to comment.