Skip to content

Commit fe82141

Browse files
committed
footer JS to TSX
1 parent 6afc2b5 commit fe82141

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

src/app/layouts/default/footer/footer.js renamed to src/app/layouts/default/footer/footer.tsx

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,34 @@ import {faYoutube} from '@fortawesome/free-brands-svg-icons/faYoutube';
1313
import usePortalContext from '~/contexts/portal';
1414
import './footer.scss';
1515

16-
1716
function Footer({
1817
data: {
19-
supporters, copyright, apStatement,
20-
facebookLink, twitterLink, linkedinLink
18+
supporters,
19+
copyright,
20+
apStatement,
21+
facebookLink,
22+
twitterLink,
23+
linkedinLink
2124
}
25+
}: {
26+
data: {
27+
supporters: string;
28+
copyright: string;
29+
apStatement: string;
30+
facebookLink: string;
31+
twitterLink: string;
32+
linkedinLink: string;
33+
};
2234
}) {
2335
const {rewriteLinks} = usePortalContext();
2436

25-
React.useLayoutEffect(() => rewriteLinks?.(document.querySelector('.page-footer')),
26-
[rewriteLinks]);
37+
React.useLayoutEffect(
38+
() =>
39+
rewriteLinks?.(
40+
document.querySelector('.page-footer') as HTMLElement
41+
),
42+
[rewriteLinks]
43+
);
2744

2845
return (
2946
<React.Fragment>
@@ -34,22 +51,28 @@ function Footer({
3451
<h3>Help</h3>
3552
<ListOfLinks>
3653
<a href="/contact">Contact Us</a>
37-
<a href="https://help.openstax.org/s/">Support Center</a>
54+
<a href="https://help.openstax.org/s/">
55+
Support Center
56+
</a>
3857
<a href="/faq">FAQ</a>
3958
</ListOfLinks>
4059
</div>
4160
<div className="column col2">
4261
<h3>OpenStax</h3>
4362
<ListOfLinks>
4463
<a href="/press">Press</a>
45-
<a href="http://www2.openstax.org/l/218812/2016-10-04/lvk">Newsletter</a>
64+
<a href="http://www2.openstax.org/l/218812/2016-10-04/lvk">
65+
Newsletter
66+
</a>
4667
<a href="/careers">Careers</a>
4768
</ListOfLinks>
4869
</div>
4970
<div className="column col3">
5071
<h3>Policies</h3>
5172
<ListOfLinks>
52-
<a href="/accessibility-statement">Accessibility Statement</a>
73+
<a href="/accessibility-statement">
74+
Accessibility Statement
75+
</a>
5376
<a href="/tos">Terms of Use</a>
5477
<a href="/license">Licensing</a>
5578
<a href="/privacy">Privacy Notice</a>
@@ -61,7 +84,10 @@ function Footer({
6184
<div className="bottom">
6285
<div className="boxed">
6386
<div className="copyrights">
64-
<Copyright copyright={copyright} apStatement={apStatement} />
87+
<Copyright
88+
copyright={copyright}
89+
apStatement={apStatement}
90+
/>
6591
</div>
6692
<ul className="social">
6793
<li>

0 commit comments

Comments
 (0)