import React, { useState, useEffect, useReducer } from 'react'; import { BrowserRouter as Router, Switch, Route, Link, useParams, useLocation } from 'react-router-dom'; import moment from 'moment-timezone'; import QRCode from 'react-qr-code'; import './light.css'; import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Popup, Segment, Table } from 'semantic-ui-react'; import { statusColor, BasicTable, siteUrl, staticUrl, requester, isAdmin } from './utils.js'; import { LoginForm, SignupForm } from './LoginSignup.js'; import { AccountForm } from './Account.js'; import { SignForm } from './Sign.js'; import { PayPalSubscribeDeal } from './PayPal.js'; function MemberInfo(props) { const user = props.user; const member = user.member; const lastTrans = user.transactions?.slice(0,3); const lastTrain = user.training?.sort((a, b) => a.session.datetime < b.session.datetime ? 1 : -1).slice(0,3); const lastCard = user.cards?.sort((a, b) => a.last_seen < b.last_seen)[0]; const unpaidTraining = user.training?.filter(x => x.attendance_status === 'Waiting for payment'); return (
You are not allowed entry into Protospace ❌
}Click here to view your application forms.
Visit the account settings page to set one.
Create a ${user.member.monthly_fees} / month subscription, get your first three months for the price of two:
Click "Checkout as Guest" if you don't have a PayPal account.
Pay ${x.session.cost} for {x.session.course_data.name} to avoid losing your spot.
Protospace Wiki — [register]
Forum (Spacebar) — [register]
{!!user && } {!!user && isAdmin(user) && } refreshStats()} />Next meeting: {getDateStat('next_meeting')}
Next clean: {getDateStat('next_clean')}
Next class: {getNextStat('next_class')}
Last class: {getNextStat('prev_class')}
Member count: {getStat('member_count')} [more]
Card scans today: {getZeroStat('card_scans')}
Minecraft players: {mcPlayers.length} {mcPlayers.length > 5 && '🔥'}
Server IP:
Players:
games.protospace.ca
{mcPlayers.length ? mcPlayers.map(x =>
Mumble users: {mumbleUsers.length}
Server IP:
Users:
mumble.protospace.ca
{mumbleUsers.length ? mumbleUsers.map(x =>
Trotec availability: {getTrackStat('TROTECS300')}
Last use:
{getTrackLast('TROTECS300')}
{getTrackAgo('TROTECS300')}
by {getTrackName('TROTECS300')}
Rabbit availability: {getTrackStat('FRICKIN-LASER')}
Last use:
{getTrackLast('FRICKIN-LASER')}
{getTrackAgo('FRICKIN-LASER')}
by {getTrackName('FRICKIN-LASER')}
Precix availability: {getTrackStat('CNC-PRECIX')}
Last use:
{getTrackLast('CNC-PRECIX')}
{getTrackAgo('CNC-PRECIX')}
by {getTrackName('CNC-PRECIX')}
Alarm status: {alarmStat()}{doorOpenStat()}
}