diff --git a/webclient/package.json b/webclient/package.json index f91bc53..06dedad 100644 --- a/webclient/package.json +++ b/webclient/package.json @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", + "moment": "^2.24.0", "react": "^16.12.0", "react-dom": "^16.12.0", "react-router-dom": "^5.1.2", diff --git a/webclient/src/App.js b/webclient/src/App.js index d0ddcf5..6803af6 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -7,6 +7,7 @@ import { requester } from './utils.js'; import { Home } from './Home.js'; import { Transactions, TransactionDetail } from './Transactions.js'; import { Cards } from './Cards.js'; +import { Training } from './Training.js'; import { NotFound, PleaseLogin } from './Misc.js'; function App() { @@ -41,9 +42,6 @@ function App() { setUserCache(false); } - let menuName = user && user.member && user.member.preferred_name || 'Profile'; - menuName = menuName.length > 7 ? 'Profile' : menuName; - return ( @@ -60,13 +58,18 @@ function App() { to='/' /> - + + + + + + diff --git a/webclient/src/Home.js b/webclient/src/Home.js index 3b63524..b99bd50 100644 --- a/webclient/src/Home.js +++ b/webclient/src/Home.js @@ -142,7 +142,9 @@ function MemberInfo(props) { {lastTrans.length ? lastTrans.map((x, i) => - {x.date} + + {x.date} + {x.account_type} ${x.amount} diff --git a/webclient/src/Training.js b/webclient/src/Training.js new file mode 100644 index 0000000..452cfc0 --- /dev/null +++ b/webclient/src/Training.js @@ -0,0 +1,49 @@ +import React, { useState, useEffect } from 'react'; +import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom'; +import './light.css'; +import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react'; +import moment from 'moment'; +import { requester } from './utils.js'; +import { NotFound, PleaseLogin } from './Misc.js'; + +export function Training(props) { + const { user } = props; + + return ( + +
Training
+ + {user.training.length ? + + + + Course / Event Name + Class Date + Status + Instructor + + + + + {user.training.map((x, i) => + + + {x.session.course.name} + + + {moment(x.session.datetime).format('MMMM Do YYYY')} + + {x.attendance_status} + {x.session.old_instructor} + + )} + +
+ : +

No training yet! Sign up for a course to take a class.

+ } + +
+ ); +}; + diff --git a/webclient/src/Transactions.js b/webclient/src/Transactions.js index b977870..ac70d50 100644 --- a/webclient/src/Transactions.js +++ b/webclient/src/Transactions.js @@ -17,7 +17,6 @@ export function Transactions(props) { Date - ID Amount Account Memo @@ -28,8 +27,9 @@ export function Transactions(props) { {user.transactions.length ? user.transactions.slice().reverse().map((x, i) => - {x.date} - {x.id} + + {x.date} + ${x.amount} {x.account_type} {x.memo} diff --git a/webclient/yarn.lock b/webclient/yarn.lock index 6ccdcaf..8d1e607 100644 --- a/webclient/yarn.lock +++ b/webclient/yarn.lock @@ -6618,6 +6618,11 @@ mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: dependencies: minimist "0.0.8" +moment@^2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" + integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"