Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created modal for adding members #147

Open
wants to merge 1 commit into
base: nationals
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21,098 changes: 21,098 additions & 0 deletions api/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion api/src/api/members.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const express = require('express');
const router = express.Router();
const { Member, chapterEnum } = require('../models/members');
const { chapterEnum } = require('../models/members');
const Member = require('../models/members');
const errorWrap = require('../middleware/errorWrap');
const { requireRegistered, requireDirector } = require('../middleware/auth');
const {
Expand Down
10,899 changes: 5,477 additions & 5,422 deletions api/yarn.lock

Large diffs are not rendered by default.

36,816 changes: 36,816 additions & 0 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"moment": "^2.29.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-csv-reader": "^3.4.0",
"react-datepicker": "^3.4.1",
"react-dom": "^16.13.1",
"react-icons": "^4.2.0",
Expand Down
1 change: 0 additions & 1 deletion client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const App = () => {
}, [location]);

// TODO: Create user context and remove prop drilling

return (
<div className="app-container">
{user && <Navbar user={user} />}
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/table/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import React, { useState, useEffect } from 'react';
import type { Node } from 'react';
import { AgGridReact } from 'ag-grid-react';
import '../../css/Table.scss';
import { Button } from 'semantic-ui-react';
import { Button, Modal } from 'semantic-ui-react';
import CSVReader from 'react-csv-reader';

type TableProp = {
data: Array<Object>,
Expand Down
10 changes: 10 additions & 0 deletions client/src/css/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
html {
font-family: 'Inter', sans-serif;
}

.ui.table thead th {
font-weight: 200;
text-align: center;
}

.ui.basic.button, .ui.basic.buttons .button, .ui.basic.button:hover {
color: rgb(33, 133, 208) !important;
background: transparent none !important;
}
52 changes: 52 additions & 0 deletions client/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
import React, { useState, useEffect } from 'react';
import type { Node } from 'react';
import { useHistory } from 'react-router-dom';
import {
Modal,
Button,
Table as TableSem,
Label,
Icon,
} from 'semantic-ui-react';
import CSVReader from 'react-csv-reader';

import Page from '../components/layout/Page';
import Table from '../components/table/Table';
Expand All @@ -12,6 +20,8 @@ import '../css/Home.css';

const Home = (): Node => {
const [members, setMembers] = useState([]);
const [file, setFile] = useState({});
const [tableData, setTableData] = useState([]);

const history = useHistory();

Expand All @@ -35,6 +45,48 @@ const Home = (): Node => {

return (
<Page title="Members">
<Modal
trigger={
<div style={{ display: 'flex', justifyContent: 'right' }}>
<Button content="ADD MEMBER" primary />
</div>
}
header="Column Mapping"
actions={[
{ key: 'cancel', content: 'CANCEL', basic: true, style: { boxShadow: "none" }},
{ key: 'submit', content: 'SUBMIT', color: 'blue' },
]}
size="tiny"
content={
<div style={{ padding: '30px' }}>
<div style={{ display: 'flex' }}>
<Label
basic
icon="paperclip"
style={{ width: '100%' }}
size="big"
content={file && file.name}
/>
<label>
<Label size="large" basic style={{ display: "grid", cursor: "pointer" }}>
<Icon name="upload" style={{ marginLeft: "10px" }}/>
<br />
Upload
</Label>
<CSVReader
inputId="CSVReader"
inputStyle={{ display: 'none' }}
onFileLoaded={(data, fileInfo) => {
setFile(fileInfo);
setTableData(data);
}}
/>
</label>
</div>
<TableSem celled headerRow={['FILE COLUMN', 'COLUMN MAPPED TO']} />
</div>
}
/>
<Table
data={members}
columns={memberColumnDefs}
Expand Down
Loading