Skip to content

Commit 2d1d15e

Browse files
authored
Fix: Ensure Footer Visibility on Smaller Screens (#489)
### Summary #468 Issue This pull request addresses an issue where the footer was not rendering on smaller screens due to the d-none class. The visibility of the footer is crucial for providing a seamless user experience across different devices. ### Changes Made - Removed the d-none class from the div in the footer folder index file, enabling the footer to be visible on smaller screens. ### Why The d-none class was unintentionally hiding the footer on smaller screens, affecting the overall user experience. This change ensures consistent visibility across all screen sizes. The d-none class in Bootstrap is a utility class that sets an element to display: none! important;, effectively hiding it. ### ScreenShots **before** ![Screenshot 2024-02-25 163600](https://github.com/apertium/apertium-html-tools/assets/86158204/1d59046e-2041-436d-9986-f10baf35dce9) **After** ![Screenshot 2024-02-25 163441](https://github.com/apertium/apertium-html-tools/assets/86158204/e115ded4-47ce-428e-b7fc-702ad2125242) - Tested on various devices and screen sizes. - Ensured the removal of the d-none class did not introduce any unintended side effects. This PR is ready for review. Your feedback is appreciated!
1 parent ac973a9 commit 2d1d15e

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

src/components/footer/__tests__/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('Footer', () => {
108108
it('opens about dialog on desktop', () => {
109109
renderFooter();
110110

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

113113
expect(screen.getByRole('dialog').textContent).toMatchInlineSnapshot(
114114
`"About_Apertium-Default×CloseWhat_Is_Apertium-DefaultApertium-Default"`,

src/components/footer/index.tsx

+33-29
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,37 @@ const FooterNav_ = ({
3838
const { t } = useLocalization();
3939

4040
return (
41-
<Nav as="ul" className="p-0" role="navigation" style={{ cursor: 'pointer' }} variant="pills">
42-
<Nav.Item as="li">
43-
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.About)}>
44-
<FontAwesomeIcon icon={faQuestionCircle} /> {t('About')}
45-
</Nav.Link>
46-
</Nav.Item>
47-
<Nav.Item as="li">
48-
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Download)}>
49-
<FontAwesomeIcon icon={faDownload} /> {t('Download')}
50-
</Nav.Link>
51-
</Nav.Item>
52-
<Nav.Item as="li">
53-
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Documentation)}>
54-
<FontAwesomeIcon icon={faBook} /> {t('Documentation')}
55-
</Nav.Link>
56-
</Nav.Item>
57-
<Nav.Item as="li">
58-
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Contact)}>
59-
<FontAwesomeIcon icon={faEnvelope} /> {t('Contact')}
60-
</Nav.Link>
61-
</Nav.Item>
41+
<Nav
42+
as="ul"
43+
className="p-2 flex-column flex-md-row"
44+
role="navigation"
45+
style={{ cursor: 'pointer' }}
46+
variant="pills"
47+
>
48+
<div className="d-flex justify-content-between">
49+
<Nav.Item as="li">
50+
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.About)}>
51+
<FontAwesomeIcon icon={faQuestionCircle} /> {t('About')}
52+
</Nav.Link>
53+
</Nav.Item>
54+
<Nav.Item as="li">
55+
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Download)}>
56+
<FontAwesomeIcon icon={faDownload} /> {t('Download')}
57+
</Nav.Link>
58+
</Nav.Item>
59+
</div>
60+
<div className="d-flex justify-content-between">
61+
<Nav.Item as="li">
62+
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Documentation)}>
63+
<FontAwesomeIcon icon={faBook} /> {t('Documentation')}
64+
</Nav.Link>
65+
</Nav.Item>
66+
<Nav.Item as="li">
67+
<Nav.Link className="footer-link" onClick={() => setOpenTab(Tab.Contact)}>
68+
<FontAwesomeIcon icon={faEnvelope} /> {t('Contact')}
69+
</Nav.Link>
70+
</Nav.Item>
71+
</div>
6272
</Nav>
6373
);
6474
};
@@ -95,7 +105,7 @@ const Footer = ({
95105
<>
96106
<div className="d-flex flex-column container" ref={footerRef}>
97107
<div className="d-flex flex-column container">
98-
<div className="d-none d-md-flex flex-wrap flex-row justify-content-between position-relative row">
108+
<div className="d-md-flex flex-wrap flex-column flex-md-row justify-content-between position-relative row">
99109
<FooterNav setOpenTab={setOpenTab} />
100110

101111
<div className="mb-4 d-flex flex-column">
@@ -106,7 +116,7 @@ const Footer = ({
106116
</Button>
107117
</div>
108118
<a
109-
className="text-muted d-none d-lg-block version align-self-end"
119+
className="text-muted d-lg-block version align-self-end font-weigth-bold"
110120
href="https://github.com/apertium/apertium-html-tools"
111121
rel="noreferrer"
112122
target="_blank"
@@ -115,12 +125,6 @@ const Footer = ({
115125
</a>
116126
</div>
117127
</div>
118-
<div className="align-self-end card card-body d-block bg-light d-md-none my-2 p-2">
119-
<span>{t('Notice_Mistake')}</span>{' '}
120-
<Button className="p-0" onClick={() => setOpenTab(Tab.About)} tabIndex={0} variant="link">
121-
{t('Help_Improve')}
122-
</Button>
123-
</div>
124128
</div>
125129
</div>
126130

0 commit comments

Comments
 (0)