Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add footer #121

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
5 changes: 4 additions & 1 deletion statusboard/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import AppRouter from '../AppRouter/AppRouter';
import Header from '../Header/Header';
import PageContents from '../PageContents/PageContents';
import { BrigadeDataContextProvider } from '../../contexts/BrigadeDataContext';
import Footer from '../Footer/Footer';
import { TaxonomyDataContextProvider } from '../../contexts/TaxonomyDataContext';
import './App.scss';

function App() {
return (
<div className="App">
<div id="App">
<TaxonomyDataContextProvider>
<BrigadeDataContextProvider>
<AppRouter>
<Header />
<PageContents />
<Footer />
</AppRouter>
</BrigadeDataContextProvider>
</TaxonomyDataContextProvider>
Expand Down
5 changes: 5 additions & 0 deletions statusboard/src/components/App/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#App {
display: flex;
flex-direction: column;
min-height: 100vh;
}
23 changes: 23 additions & 0 deletions statusboard/src/components/Footer/Footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.App-footer {
width: 100%;
min-height: 5rem;
display: flex;
flex-direction: row;
align-items: center;
Comment on lines +2 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem to have an effect. Maybe worth thinking about removing them.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I tend to prefer that the space an element takes up be determined by padding, etc. Using height can be hard to debug for a new person later.

font-size: 1.25rem;
background-color: var(--cfa-purple-dark);

p {
color: var(--cfa-white);
font-family: var(--font-family-text);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem necessary and it should probably inherit from the rest of the document, so maybe worth removing.

margin-left: 1.0rem;
margin-right: 1.0rem;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The links in here have a hover color that blends into the background. Changing that could be a more accessibility friendly improvement.

}

@media only screen and (max-width: 800px) {
.p {
margin-right: auto;
margin-left: auto;
}
}
}
21 changes: 21 additions & 0 deletions statusboard/src/components/Footer/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { render } from '@testing-library/react';
import Footer from './Footer';

describe('Footer: <Footer />', () => {
it('should contain a link to open a bug report', function () {
const { getByText } = render(<Footer />);
expect(getByText('bug report').closest('a')).toHaveAttribute(
'href',
'https://github.com/codeforamerica/brigade-project-index-statusboard/issues/new?assignees=&labels=&template=bug_report.md&title='
);
});

it('should contain a link to open a feature request', function () {
const { getByText } = render(<Footer />);
expect(getByText('feature request').closest('a')).toHaveAttribute(
'href',
'https://github.com/codeforamerica/brigade-project-index-statusboard/issues/new?assignees=&labels=&template=feature_request.md&title='
);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to make sure the link to the repository is there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am skipping it, I am not sure that I want the GitHub repository link at all :/
I am not sure if it adds anything, or if it is better to have it focused on requesting bug and issue reports

});
21 changes: 21 additions & 0 deletions statusboard/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import './Footer.scss';

const submitBugReport =
'https://github.com/codeforamerica/brigade-project-index-statusboard/issues/new?assignees=&labels=&template=bug_report.md&title=';
const submitFeatureRequest =
'https://github.com/codeforamerica/brigade-project-index-statusboard/issues/new?assignees=&labels=&template=feature_request.md&title=';
const githubRepository =
'https://github.com/codeforamerica/brigade-project-index-statusboard';

export default function Footer(): JSX.Element {
return (
<footer className="App-footer">
<p>
Submit a <a href={submitBugReport}>bug report</a> or{' '}
<a href={submitFeatureRequest}>feature request</a> to our GitHub{' '}
<a href={githubRepository}>repository</a>
</p>
</footer>
);
}
2 changes: 1 addition & 1 deletion statusboard/src/components/PageContents/PageContents.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.contents {
display: block;
flex: 1;
k3KAW8Pnf7mkmdSMPHz27 marked this conversation as resolved.
Show resolved Hide resolved
padding: 3rem 5vw 0 5vw;
k3KAW8Pnf7mkmdSMPHz27 marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
1 change: 0 additions & 1 deletion statusboard/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ body {
margin: 0;
padding: 0;
font-size: 1.25rem;
padding-bottom: 3rem;
}

a {
Expand Down