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 { statusColor, BasicTable, staticUrl, requester } from './utils.js'; import { LoginForm, SignupForm } from './LoginSignup.js'; import { AccountForm } from './Account.js'; function MemberInfo(props) { const user = props.user; const member = user.member; const lastTrans = user.transactions && user.transactions.slice(0,3); const lastCard = user.cards && user.cards.sort((a, b) => a.last_seen_at < b.last_seen_at)[0]; return (
{member.preferred_name} {member.last_name}
Status: {member.status || 'Unknown'} Expiry: {member.expire_date}
{!member.photo_medium && Welcome, new member!

Click here to view your appliction forms.

} {!member.photo_medium && Please set a member photo!

Visit the account settings page to set one.

}
Details
Application: {member.application_date || 'Unknown'} Start: {member.current_start_date || 'Unknown'} Vetted: {member.vetted_date || 'Not vetted'} Monthly: ${member.monthly_fees || 'Unknown'} Card Number: {lastCard && lastCard.card_number || 'None'} {member.photo_medium &&

View application forms

}
Latest Transactions
{lastTrans.length ? lastTrans.map(x => {x.date} {x.account_type} ${x.amount} ) : None }
); }; export function Home(props) { const { user } = props; return ( {user ? user.member.set_details ? : :
Or
}
Home

Welcome to the Protospace member portal! Here you can view member info, join classes, and manage your membership.

Quick Links

Main Website

Protospace Wiki

Discussion Google Group

Admin Google Group

Google Drive

Protospace Stats

Next member meeting: Jan 01, 2099

Next monthly clean: Jan 01, 2099

Current member count: 200

Due members: 20

Expired members: 100

Bay 108 temperature: 21 C

Bay 110 temperature: 22 C

); };