Skip to content

Commit

Permalink
reformat everything with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
camdendotlol committed Aug 25, 2024
1 parent 67f350c commit f79d360
Show file tree
Hide file tree
Showing 72 changed files with 1,428 additions and 1,485 deletions.
10 changes: 5 additions & 5 deletions ADDING_POSTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ You should include a Chicago-style citation of the source. Don't worry about ind

Finally, go to the tags list and add one tag to specify what type of source it is. The valid options are:

* book
* periodical
* picture
* website
* video
- book
- periodical
- picture
- website
- video

This tag tells the website which icon to use on https://unitedfruitcompany.com/resources and helps users sort through the different types of materials.

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ With the codebase in your hands, you can make whatever changes you want. Add new

Keep in mind that, at the time of writing this, I'm not actually very experienced. This has been my first paid project (sorry, I'm doing this as a freelancer, you're probably doing this for class credits!) after a year and a half of self-teaching. If you feel like some code I wrote is wrong or confusing, there's a good chance you're right. Don't be afraid to reshape the codebase in your own image.

If you still have unanswered questions, I'm hopefully still around somewhere! Wherever I am in 5-10 years, I should be able get in touch for an hour or two and help you find your way around the codebase.
If you still have unanswered questions, I'm hopefully still around somewhere! Wherever I am in 5-10 years, I should be able get in touch for an hour or two and help you find your way around the codebase.
30 changes: 15 additions & 15 deletions CONTRIBUTING_NONCODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ In order for the website to display your post, you need to add a category to it.

Valid categories are:

* Article
* Bibliography
* Biographies
* Documents
* Timeline
- Article
- Bibliography
- Biographies
- Documents
- Timeline

If the post isn't categorized with something from that list, it won't show up on the site.

Expand All @@ -34,15 +34,15 @@ The date range must be in exactly the XXXX-XXXX format to be detected as a date.

Valid date ranges are:

* 1855-1880
* 1880-1890
* 1890-1900
* 1900-1910
* 1910-1920
* 1920-1930
* 1930-1935
* 1935-1940
* 1940-1945
- 1855-1880
- 1880-1890
- 1890-1900
- 1900-1910
- 1910-1920
- 1920-1930
- 1930-1935
- 1935-1940
- 1940-1945

For documents, enter the date range that the document is from. For example, a newspaper article from 1936 would be tagged "1935-1940".

Expand All @@ -58,4 +58,4 @@ The site makes heavy used of Wordpress's "Featured Image" system. This is differ

If that was a bit too much to take in, feel free to check out existing posts in the Wordpress site for examples.

If there's still any confusion, I should be around somewhere and hopefully not too busy to answer some questions.
If there's still any confusion, I should be around somewhere and hopefully not too busy to answer some questions.
19 changes: 9 additions & 10 deletions components/AudioSecret/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import React, { ReactNode } from 'react'
import { Container } from './styles'
import React, { ReactNode } from "react";
import { Container } from "./styles";

interface Props {
child: ReactNode
child: ReactNode;
}

const Secret: React.FC<Props> = ({ child }) => {
const secret = typeof Audio !== 'undefined' ? new Audio('../audio/secret.ogx') : undefined
const secret =
typeof Audio !== "undefined" ? new Audio("../audio/secret.ogx") : undefined;

return (
<Container onClick={async () => await secret?.play()}>
{ child }
</Container>
)
}
<Container onClick={async () => await secret?.play()}>{child}</Container>
);
};

export default Secret
export default Secret;
34 changes: 17 additions & 17 deletions components/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@ import {
ContainerContent,
Header,
DesktopNavLink,
MobileNavLink
} from './styles'
import Link from 'next/link'
import {
ArrowRight,
ArrowLeft
} from 'react-bootstrap-icons'
import { useRouter } from 'next/router'
import { getUpperPath } from '../../lib/common'
MobileNavLink,
} from "./styles";
import Link from "next/link";
import { ArrowRight, ArrowLeft } from "react-bootstrap-icons";
import { useRouter } from "next/router";
import { getUpperPath } from "../../lib/common";

interface Props {
header: string,
previousSlug: string,
nextSlug: string
header: string;
previousSlug: string;
nextSlug: string;
}

const Banner: React.FC<Props> = ({ header, previousSlug, nextSlug }) => {
const router = useRouter()
const router = useRouter();

return (
<FullwidthContainer>
Expand All @@ -31,7 +28,10 @@ const Banner: React.FC<Props> = ({ header, previousSlug, nextSlug }) => {
</Link>
</DesktopNavLink>
<MobileNavLink>
<Link href={`${getUpperPath(router.pathname)}/${previousSlug}`} passHref>
<Link
href={`${getUpperPath(router.pathname)}/${previousSlug}`}
passHref
>
<ArrowLeft />
</Link>
</MobileNavLink>
Expand All @@ -52,7 +52,7 @@ const Banner: React.FC<Props> = ({ header, previousSlug, nextSlug }) => {
</MobileNavLink>
</ContainerContent>
</FullwidthContainer>
)
}
);
};

export default Banner
export default Banner;
2 changes: 1 addition & 1 deletion components/Banner/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const FullwidthContainer = styled.div`
background: ${({ theme }) => theme.colors.secondary};
font-family: ${alegreyaSans.style.fontFamily};
`

export const ContainerContent = styled.div`
display: flex;
align-items: center;
Expand Down
50 changes: 23 additions & 27 deletions components/Bibliography/BibTypeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,36 @@ import {
Globe,
Image as BSImage, // Fix a linting error where eslint thinks this is an img component
Bookmark,
Newspaper
} from 'react-bootstrap-icons'
Newspaper,
} from "react-bootstrap-icons";

interface Props {
type: string | null
type: string | null;
}

const getIcon = (type: string | null) => {
switch(type) {
case 'book':
return (<Book />)
case 'video':
return (<Film />)
case 'picture':
return <BSImage />
case 'photo':
return <BSImage />
case 'image':
return <BSImage />
case 'website':
return <Globe />
case 'periodical':
return <Newspaper />
switch (type) {
case "book":
return <Book />;
case "video":
return <Film />;
case "picture":
return <BSImage />;
case "photo":
return <BSImage />;
case "image":
return <BSImage />;
case "website":
return <Globe />;
case "periodical":
return <Newspaper />;
default:
return <Bookmark />
return <Bookmark />;
}
}
};

const BibTypeIcon: React.FC<Props> = ({ type }) => {
return (
<>
{ getIcon(type) }
</>
)
}
return <>{getIcon(type)}</>;
};

export default BibTypeIcon
export default BibTypeIcon;
34 changes: 16 additions & 18 deletions components/Bibliography/FilterButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import styled from 'styled-components'
import BibTypeIcon from './BibTypeIcon'
import styled from "styled-components";
import BibTypeIcon from "./BibTypeIcon";

interface Props {
type: string | null,
filter: string | null,
setFilter: (arg: string | null) => void
type: string | null;
filter: string | null;
setFilter: (arg: string | null) => void;
}

const Button = styled.button<{ selected: boolean }>`
Expand All @@ -17,8 +17,9 @@ const Button = styled.button<{ selected: boolean }>`
transition: 0.2s;
font-size: 1rem;
border-radius: 3px;
${props => props.selected ? `background: ${props.theme.colors.darkBackground};` : ''}
${props => props.selected ? 'color: white;' : ''}
${(props) =>
props.selected ? `background: ${props.theme.colors.darkBackground};` : ""}
${(props) => (props.selected ? "color: white;" : "")}
:hover {
cursor: pointer;
Expand All @@ -28,26 +29,23 @@ const Button = styled.button<{ selected: boolean }>`
height: 20px;
width: 20px;
}
`
`;

const getLabel = (type: string | null) => {
if (!type) {
return <span>All</span>
return <span>All</span>;
} else {
return <span>{`${type[0].toLocaleUpperCase()}${type?.slice(1)}`}</span>
return <span>{`${type[0].toLocaleUpperCase()}${type?.slice(1)}`}</span>;
}
}
};

const FilterButton: React.FC<Props> = ({ type, filter, setFilter }) => {
return (
<Button
onClick={() => setFilter(type)}
selected={filter === type}
>
<Button onClick={() => setFilter(type)} selected={filter === type}>
<BibTypeIcon type={type} />
{getLabel(type)}
</Button>
)
}
);
};

export default FilterButton
export default FilterButton;
26 changes: 12 additions & 14 deletions components/Bibliography/FilterOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import FilterButton from './FilterButton'
import {
Menu
} from './FilterOptions.styles'
import FilterButton from "./FilterButton";
import { Menu } from "./FilterOptions.styles";

interface Props {
filter: null | string,
setFilter: (arg: string | null) => void
filter: null | string;
setFilter: (arg: string | null) => void;
}

const FilterOptions: React.FC<Props> = ({ filter, setFilter }) => {
return (
<Menu>
<FilterButton type={null} filter={filter} setFilter={setFilter} />
<FilterButton type='book' filter={filter} setFilter={setFilter} />
<FilterButton type='periodical' filter={filter} setFilter={setFilter} />
<FilterButton type='picture' filter={filter} setFilter={setFilter} />
<FilterButton type='website' filter={filter} setFilter={setFilter} />
<FilterButton type='video' filter={filter} setFilter={setFilter} />
<FilterButton type="book" filter={filter} setFilter={setFilter} />
<FilterButton type="periodical" filter={filter} setFilter={setFilter} />
<FilterButton type="picture" filter={filter} setFilter={setFilter} />
<FilterButton type="website" filter={filter} setFilter={setFilter} />
<FilterButton type="video" filter={filter} setFilter={setFilter} />
</Menu>
)
}
);
};

export default FilterOptions
export default FilterOptions;
Loading

0 comments on commit f79d360

Please sign in to comment.