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

Fix: Ensure Footer Visibility on Smaller Screens #489

Merged
merged 6 commits into from
Mar 13, 2024
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
2 changes: 1 addition & 1 deletion src/components/footer/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('Footer', () => {
it('opens about dialog on desktop', () => {
renderFooter();

userEvent.click(screen.getAllByRole('button', { name: 'Help_Improve-Default' })[1]);
userEvent.click(screen.getAllByRole('button', { name: 'Help_Improve-Default' })[0]);

expect(screen.getByRole('dialog').textContent).toMatchInlineSnapshot(
`"About_Apertium-Default×CloseWhat_Is_Apertium-DefaultApertium-Default"`,
Expand Down
62 changes: 33 additions & 29 deletions src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,37 @@ const FooterNav_ = ({
const { t } = useLocalization();

return (
<Nav as="ul" className="p-0" role="navigation" style={{ cursor: 'pointer' }} variant="pills">
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.About)}>
<FontAwesomeIcon icon={faQuestionCircle} /> {t('About')}
</Nav.Link>
</Nav.Item>
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Download)}>
<FontAwesomeIcon icon={faDownload} /> {t('Download')}
</Nav.Link>
</Nav.Item>
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Documentation)}>
<FontAwesomeIcon icon={faBook} /> {t('Documentation')}
</Nav.Link>
</Nav.Item>
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Contact)}>
<FontAwesomeIcon icon={faEnvelope} /> {t('Contact')}
</Nav.Link>
</Nav.Item>
<Nav
as="ul"
className="p-2 flex-column flex-md-row"
role="navigation"
style={{ cursor: 'pointer' }}
variant="pills"
>
<div className="d-flex justify-content-between">
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.About)}>
<FontAwesomeIcon icon={faQuestionCircle} /> {t('About')}
</Nav.Link>
</Nav.Item>
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Download)}>
<FontAwesomeIcon icon={faDownload} /> {t('Download')}
</Nav.Link>
</Nav.Item>
</div>
<div className="d-flex justify-content-between">
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Documentation)}>
<FontAwesomeIcon icon={faBook} /> {t('Documentation')}
</Nav.Link>
</Nav.Item>
<Nav.Item as="li">
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Contact)}>
<FontAwesomeIcon icon={faEnvelope} /> {t('Contact')}
</Nav.Link>
</Nav.Item>
</div>
</Nav>
);
};
Expand Down Expand Up @@ -95,7 +105,7 @@ const Footer = ({
<>
<div className="d-flex flex-column container" ref={footerRef}>
<div className="d-flex flex-column container">
<div className="d-none d-md-flex flex-wrap flex-row justify-content-between position-relative row">
<div className="d-md-flex flex-wrap flex-column flex-md-row justify-content-between position-relative row">
<FooterNav setOpenTab={setOpenTab} />

<div className="mb-4 d-flex flex-column">
Expand All @@ -106,7 +116,7 @@ const Footer = ({
</Button>
</div>
<a
className="text-muted d-none d-lg-block version align-self-end"
className="text-muted d-lg-block version align-self-end font-weigth-bold"
href="https://github.com/apertium/apertium-html-tools"
rel="noreferrer"
target="_blank"
Expand All @@ -115,12 +125,6 @@ const Footer = ({
</a>
</div>
</div>
<div className="align-self-end card card-body d-block bg-light d-md-none my-2 p-2">
<span>{t('Notice_Mistake')}</span>{' '}
<Button className="p-0" onClick={() => setOpenTab(Tab.About)} tabIndex={0} variant="link">
{t('Help_Improve')}
</Button>
</div>
</div>
</div>

Expand Down
Loading