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

feat(upgrade): Upgrade Rivet and Add-Ons #198

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rivet-react",
"version": "0.7.1",
"version": "0.7.5",
"description": "Rivet React components",
"author": "",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -41,9 +41,9 @@
"react-docgen-typescript": "1.12.3",
"react-scripts-ts": "2.17.0",
"react-styleguidist": "7.2.5",
"rivet-collapsible": "0.1.1-alpha",
"rivet-switch": "0.1.1-alpha",
"rivet-uits": "1.1.0",
"rivet-collapsible": "0.2.10",
"rivet-switch": "0.3.1",
"rivet-uits": "1.6.0",
"semantic-release": "15.9.12",
"typescript": "2.9.2",
"webpack": "3.8.1"
Expand Down
5 changes: 3 additions & 2 deletions src/components/Footer/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ describe('<Footer />', () => {
describe('Navigation', () => {
it('should include no links by default', () => {
const cut = mount(<Footer />);
expect(cut.find('ul.rvt-footer__aux-links')).toHaveLength(0);
expect(cut.find('ul.rvt-footer__aux-links')).toHaveLength(1);
});
it('should render nav links in list', () => {
const cut = mount(
<Footer>
<a id="privacy" href="/privacy">Privacy Policy</a>
</Footer>);
expect(cut.find('ul.rvt-footer__aux-links')).toHaveLength(1);
expect(cut.find('li.rvt-footer__aux-item > a')).toHaveLength(1);
// One link for accessibility, one for the child, and two for the copyright
expect(cut.find('li.rvt-footer__aux-item > a')).toHaveLength(4);
expect(cut.find('#privacy')).toHaveLength(1);
});
});
Expand Down
23 changes: 11 additions & 12 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ import * as Rivet from '../util/Rivet';
import Icon from '../util/RivetIcons';

const componentClass = 'rvt-footer';
const ulClass = 'rvt-footer__aux-links';
const liClass = 'rvt-footer__aux-item';

const footerNavLi = (child, index) =>
<li key={index} className={liClass}>{child}</li>

const footerNav = (children) =>
<ul className={ulClass}>
{React.Children.map(children, footerNavLi)}
</ul>

const Footer: React.SFC<React.HTMLAttributes<HTMLDivElement>> =
({ className, children, id = Rivet.shortuid(), ...attrs }) => (
<footer id={id} role="contentinfo" className={classNames(componentClass, className)} {...attrs}>
<div className="rvt-footer__copyright-lockup">
<div className="rvt-footer__trident">
<Icon name="trident-footer" />
</div>
<p><a href="https://www.iu.edu/copyright/index.html">Copyright</a> &copy; {new Date().getFullYear()} The Trustees of <a href="https://www.iu.edu/">Indiana University</a></p>
<div className="rvt-footer__trident">
<Icon name="trident-footer" />
</div>
{children && footerNav(children)}
<ul className="rvt-footer__aux-links">
<li key="accessibility-footer-link" className={liClass}>
<a href="https://accessibility.iu.edu/assistance/">Accessibility</a>
</li>
{React.Children.map(children, footerNavLi)}
<li key="copyright-footer-link" className={liClass}>
<a href="https://www.iu.edu/copyright/index.html">Copyright</a> &copy; 2019 The Trustees of <a href="https://www.iu.edu/">Indiana University</a>
</li>
</ul>
</footer>
);
Footer.displayName = 'Footer';
Expand Down