Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #735 from Northeastern-Electric-Racing/#652-update…
Browse files Browse the repository at this point in the history
…-home-links

#652 update home links
  • Loading branch information
jamescd18 authored Jun 17, 2022
2 parents 300219e + 58f4e77 commit 7fd65d1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/frontend/pages/HomePage/home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

.title {
text-align: center;
padding-top: 2em;
padding-top: 1em;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ describe('useful links component', () => {
it('renders headers', () => {
renderComponent();
expect(screen.getByText(/Useful Links/i)).toBeInTheDocument();
expect(screen.getByText(/Finance/i)).toBeInTheDocument();
expect(screen.getByText(/Other/i)).toBeInTheDocument();
});

it('renders links', () => {
renderComponent();
expect(screen.getByText(/Personal purchasing guidelines/i)).toBeInTheDocument();
expect(screen.getByText(/Procurement form/i)).toBeInTheDocument();
expect(screen.getByText(/Part numbering spreadsheet/i)).toBeInTheDocument();
expect(screen.getByText(/Purchasing Guidelines/i)).toBeInTheDocument();
expect(screen.getByText(/Procurement Form/i)).toBeInTheDocument();
expect(screen.getAllByText(/Guidelines/i).length).toEqual(4);
});
});
83 changes: 45 additions & 38 deletions src/frontend/pages/HomePage/useful-links/useful-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,68 @@
*
*/

import { linkPipe } from '../../../../shared/pipes';
import PageBlock from '../../../layouts/page-block/page-block';
import {
faCoins,
faReceipt,
faHandHoldingUsd,
faDollarSign,
faFileAlt,
faSortNumericDown,
faCogs
} from '@fortawesome/free-solid-svg-icons';
import { Col, Container, Row } from 'react-bootstrap';
import styles from './useful-links.module.css';
import { iconLinkPipe } from '../../../../shared/pipes';
import PageBlock from '../../../layouts/page-block/page-block';
import './useful-links.module.css';

// React-bootstrap grid documentation: https://react-bootstrap.github.io/layout/grid/
const UsefulLinks: React.FC = () => {
const financeLinks = [
linkPipe(
'Personal purchasing guidelines',
const links = [
iconLinkPipe(
faCoins,
'Purchasing Guidelines',
'https://docs.google.com/document/d/1M5Ldy9L1BifBo18tdKpv3CH-frRneyEK26hUXbtMg7Q/edit'
),
linkPipe('Procurement Form', 'https://forms.gle/6ztRoa1iL7p1KHwP6'),
linkPipe(
'Reimbursement guidelines',
iconLinkPipe(
faHandHoldingUsd,
'Reimbursement Guidelines',
'https://docs.google.com/document/d/1HvLnVNzZTftgoAXppIEp-gTmUBQGt-V6n97prziWWrs/edit'
)
];

const otherLinks = [
linkPipe(
'Part numbering spreadsheet',
'https://docs.google.com/spreadsheets/d/1av0ReONZF3r82kCvkUEGl3uue4jfQgbw-KQDZnsejPQ/edit'
),
linkPipe(
'McMaster order sheet',
iconLinkPipe(faDollarSign, 'Procurement Form', 'https://forms.gle/6ztRoa1iL7p1KHwP6'),
iconLinkPipe(
faReceipt,
'McMaster Order Sheet',
'https://docs.google.com/spreadsheets/d/1kqpnw8jZDx2GO5NFUtqefRXqT1XX46iMx5ZI4euPJgY/edit'
),
linkPipe('Individual Member Goals Form', 'https://forms.gle/MAZJSFcMBjn44p3F6'),
linkPipe('Manufacturing Request Form', 'https://forms.gle/vJmTRt2xnzGa7akb8')
iconLinkPipe(
faFileAlt,
'Project Update Log',
'https://docs.google.com/document/d/1w0B6upZRY28MlbVA4hyU3X_NRNP0cagmLWqjHn6B8OA/edit'
),
iconLinkPipe(
faSortNumericDown,
'Part Numbering Guidelines',
'https://docs.google.com/document/d/1Y8IXCvYjXP3RBj6h4-xLCHXVLW5R6pi3-4i5SYMKtZY/edit'
),
iconLinkPipe(
faCogs,
'Hardware Guidelines',
'https://docs.google.com/document/d/1OD1d1VaIEHCwiFCuU7wfwAPu-UA--0_QzbyJjBsexwg/edit'
)
];

const allColsStyle = 'mb-2';
return (
<PageBlock
title={'Useful Links'}
headerRight={<></>}
body={
<Container fluid className={styles.linksContainer}>
<Container fluid>
<Row>
<Col md>
<h4>Finance</h4>
<ul>
{financeLinks.map((link, idx) => (
<li key={idx}>{link}</li>
))}
</ul>
</Col>
<Col md>
<h4>Other</h4>
<ul>
{otherLinks.map((link, idx) => (
<li key={idx}>{link}</li>
))}
</ul>
</Col>
{links.map((link) => (
<Col className={allColsStyle} xs={6} sm={6} md={4} lg={3} xl={2}>
{link}
</Col>
))}
</Row>
</Container>
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/pipes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const linkPipe = (description: string, link: string): ReactElement => {
export const iconLinkPipe = (icon: IconProp, description: string, link: string) => {
return (
<div className="d-flex flex-row align-items-center">
<FontAwesomeIcon icon={icon} size="1x" className="pr-1" />
<FontAwesomeIcon icon={icon} size="lg" className="pr-1" />
{linkPipe(description, link)}
</div>
);
Expand Down

0 comments on commit 7fd65d1

Please sign in to comment.