Merge pull request #14 from StevanFreeborn/master

Add about page information. Deploy master to production.
This commit is contained in:
StevanFreeborn
2022-06-26 11:49:35 -05:00
committed by GitHub
12 changed files with 182 additions and 17 deletions
+8
View File
@@ -10,13 +10,21 @@ import Footer from './components/footer';
export default function App() {
return (
<div className='d-flex flex-column min-vh-100'>
<NavBar/>
<Routes>
<Route path='/' element={<Home/>}/>
<Route path='/About' element={<About/>}/>
</Routes>
<Footer/>
</div>
);
}
+22
View File
@@ -0,0 +1,22 @@
import React from 'react';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
export default function AboutSection(props) {
return(
<Row className='my-2'>
<Col>
<h4 className='highlight'>{props.section.header}</h4>
<hr />
<p>{props.section.description}</p>
</Col>
</Row>
);
}
+4 -2
View File
@@ -3,13 +3,15 @@ import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
export default function CardHolder(props) {
return(
<Container fluid className="bg-dark">
<Row className="d-flex flex-row justify-content-center align-items-center py-3">
{props.children}
</Row>
</Container>
);
}
+19 -2
View File
@@ -10,27 +10,44 @@ export default function CharacterCard(props) {
const lastEpisode = props.character.lastEpisode;
return(
<Card style={{ width: '22rem' }} className='p-1 m-3'>
<Card.Img variant='top' src={image} width='100%' />
<Card.Body>
<Card.Title>{characterName}</Card.Title>
<Card.Text>
<Table>
<tbody>
<tr>
<td className='fw-bold'>First Episode:</td>
<td>{firstEpisode}</td>
</tr>
<tr>
<td className='fw-bold'>Last Episode:</td>
<td>{lastEpisode}</td>
</tr>
</tbody>
</Table>
</Card.Text>
</Card.Body>
</Card>
);
}
+31 -1
View File
@@ -1,5 +1,9 @@
import React from 'react';
import { Github } from 'react-bootstrap-icons';
import { Globe } from 'react-bootstrap-icons';
import { Envelope } from 'react-bootstrap-icons';
import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
@@ -7,6 +11,7 @@ import Col from 'react-bootstrap/Col';
export default function Footer() {
return (
<footer className='mt-auto py-3'>
<Container>
<hr/>
@@ -14,25 +19,50 @@ export default function Footer() {
<Row>
<Col className='text-start'>
<span>
<span className='highlight'>criminal</span>mindsapi &#169; 2022
</span>
</Col>
<Col className='text-end'>
<a
className='text-dark'
className='text-dark m-1'
href='https://github.com/StevanFreeborn/criminalmindsapi'
target='_blank'
rel="noreferrer"
>
<Github size={25} />
</a>
<a
className='text-dark m-1'
href='https://stevanfreeborn.com'
target='_blank'
rel="noreferrer"
>
<Globe size={25} />
</a>
<a
className='text-dark m-1'
href='mailto:stevan.freeborn@gmail.com'
target='_blank'
rel="noreferrer"
>
<Envelope size={25} />
</a>
</Col>
</Row>
</Container>
</footer>
)
}
+11 -5
View File
@@ -4,19 +4,26 @@ import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
export default function Greeting() {
return (
<Container>
<Row className='py-5'>
<Row className='py-4'>
<Col className='text-center'>
<Col>
<h1>
<h1 className='text-center mb-3'>
The <span className='highlight'>Criminal</span> Minds API
</h1>
<p>
Welcome to the Criminal Minds API! The documentation should supply you with all the information you need to start making requests. It is programmatically generated using swagger and provides the ability to make exploratory calls easily. Give it a review before you get started on your project.
</p>
<p>
Note the api is free, but to prevent malicious activity there is a rate limit of 10,000 requests a day. If that limit is reached you will receive a response with a 429 status code. Details about your rate limit standing are returned in response headers, specifically the x-rate-limit-limit, x-rate-limit-remaining, and x-rate-limit-reset headers.
</p>
<p className='text-center'>
Checkout the <a href='https://criminalmindsapi.azurewebsites.net' rel='noreferrer' target='_blank' className='highlight'>documentation</a>.
</p>
@@ -26,5 +33,4 @@ export default function Greeting() {
</Container>
);
}
+7 -2
View File
@@ -5,11 +5,13 @@ import Col from 'react-bootstrap/Col';
import { TailSpin } from 'react-loading-icons';
export default function Loading() {
return (
<Container className='m-auto'>
<Row>
<Col className='text-center'>
<TailSpin
height='3em'
fill='#912718'
@@ -19,10 +21,13 @@ export default function Loading() {
strokeOpacity={1}
strokeWidth={2}
/>
<div className='mt-2'>Loading...</div>
</Col>
</Row>
</Container>
);
}
-2
View File
@@ -5,7 +5,6 @@ import { NavLink } from 'react-router-dom';
import Container from 'react-bootstrap/Container';
export default function NavBar() {
return (
<Navbar
expand='sm'
@@ -62,5 +61,4 @@ export default function NavBar() {
</Navbar>
)
}
+29 -1
View File
@@ -5,8 +5,36 @@ const baseUrl = process.env.NODE_ENV === 'development' ?
const versionHeader = 'x-api-version';
const versionHeaderValue = 1;
const aboutSections = [
{
header: "Who",
description: "Hi, I'm Stevan Freeborn. I am well...someone who likes to make things and put them on the interwebz. One of my favorite tv shows is Criminal Minds."
},
{
header: "What",
description: "The Criminal Minds API is a collection of information about the Criminal Minds series. This information is organized into Characters, Episodes, Quotes, and Seasons. The API has documentation that is programmatically generated using swagger and can be used to make exploratory requests."
},
{
header: "Why",
description: "I've been learning how to code and wanted to build a web api using MongoDB, ASP.NET Core 6, and React and I figured what better subject matter than one of my favorite tv shows."
},
{
header: "Issues",
description: "If you come across any errors, missing information, or would like to suggest changes, please contribute by creating an issue or a pull request on GitHub."
},
{
header: "Contact",
description: "If you would like to talk about the project or discuss the finer points of brewing a great cup of coffee, send me an email at stevan.freeborn@gmail.com. I would love to chat with you."
},
{
header: "License",
description: "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
}
];
export {
baseUrl,
versionHeader,
versionHeaderValue
versionHeaderValue,
aboutSections
};
+4
View File
@@ -8,9 +8,13 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
);
+41 -2
View File
@@ -1,8 +1,47 @@
import React from 'react';
import Loading from '../components/loading';
import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import AboutSection from '../components/aboutSection';
import { aboutSections as sections } from '../constants';
export default function About() {
const getSections = () => {
return sections.map(section => {
return (
<AboutSection
section={section}
/>
);
});
}
return (
<p>Coming soon...</p>
<Container>
<Row>
<Col>
<h1 className='text-center py-4'>Wheels up...</h1>
</Col>
</Row>
{getSections()}
</Container>
);
}
+6
View File
@@ -16,6 +16,7 @@ export default function Home() {
const res = await characterService.getCharacters();
// TODO: Handle a failed request.
if (!res.ok) return;
const characters = await res.json();
@@ -47,10 +48,15 @@ export default function Home() {
return (
<>
<Greeting />
{characters.length > 0 ?
<CardHolder>
{getCharacterCards()}
</CardHolder>
: <Loading />}
</>
);