mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-21 12:00:17 -04:00
Added class council page
This commit is contained in:
parent
077b0f9a89
commit
5b466a060c
File diff suppressed because one or more lines are too long
|
@ -12,6 +12,7 @@ import newsArticle from './pages/newsArticle';
|
||||||
import notFound from './pages/404';
|
import notFound from './pages/404';
|
||||||
import officers from './pages/officers';
|
import officers from './pages/officers';
|
||||||
import committee from './pages/committee';
|
import committee from './pages/committee';
|
||||||
|
import classcouncil from './pages/classcouncil';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
|
@ -24,6 +25,7 @@ export default function App() {
|
||||||
<Route path='/mission' exact component={mission} />
|
<Route path='/mission' exact component={mission} />
|
||||||
<Route path='/officers' exact component={officers} />
|
<Route path='/officers' exact component={officers} />
|
||||||
<Route path='/committee' exact component={committee} />
|
<Route path='/committee' exact component={committee} />
|
||||||
|
<Route path='/class-council' exact component={classcouncil} />
|
||||||
<Route path='/:path' component={notFound} />
|
<Route path='/:path' component={notFound} />
|
||||||
<Route path='/' exact component={index} />
|
<Route path='/' exact component={index} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
23
src/pages/classcouncil.tsx
Normal file
23
src/pages/classcouncil.tsx
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from 'react';
|
||||||
|
import Hero from '../components/Hero';
|
||||||
|
import MemberRow from '../components/MemberRow';
|
||||||
|
import useQuery from '../hooks/useInitiatives';
|
||||||
|
|
||||||
|
export default function ClassCouncil() {
|
||||||
|
let members = useQuery<SGA.MemberDocument[]>(
|
||||||
|
`*[_type == 'member' && role == 'class'] | order (year desc)`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!members) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Hero heading='Class Council' />
|
||||||
|
{members.map((member) => {
|
||||||
|
return <MemberRow key={member._id} member={member}></MemberRow>;
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user