import React, { useState, useEffect, useReducer } from 'react'; import { Link, useParams, useHistory } from 'react-router-dom'; import moment from 'moment-timezone'; import QRCode from 'react-qr-code'; import './light.css'; import { Button, Container, Divider, Grid, Header, Icon, Image, 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 { StorageButton } from './Storage.js'; import { PayPalSubscribeDeal } from './PayPal.js'; function MemberInfo(props) { const user = props.user; const member = user.member; const history = useHistory(); 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 (
Visit the Paymaster page or pay a Director to buy Protocoin.
You are not allowed entry into Protospace ❌
}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.
⚠️ You need to attend a New Member Orientation to use any tool larger than a screwdriver.
}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')} [charts]
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')}
Media computer: {getTrackStat('PROTOGRAPH1')}
Last use:
Last print:
{getTrackLast('PROTOGRAPH1')}
{getTrackAgo('PROTOGRAPH1')}
by {getTrackName('PROTOGRAPH1')}
{getTrackLast('LASTLARGEPRINT')}
{getTrackAgo('LASTLARGEPRINT')}
by {getTrackName('LASTLARGEPRINT')}
ORD2 printer: {printer3dStat('ord2')}
ORD3 printer: {printer3dStat('ord3')}
{user ?Alarm status: {alarmStat()}
:Alarm status: Unauthorized
} {user &&Hosting status: {closedStat()}
}Protogarden: