sy-records commented on code in PR #1217:
URL: https://github.com/apache/incubator-answer/pull/1217#discussion_r1899447466
##########
ui/src/components/Footer/index.tsx:
##########
@@ -18,35 +18,48 @@
*/
import React from 'react';
+import { Link } from 'react-router-dom';
import { Container } from 'react-bootstrap';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import dayjs from 'dayjs';
import { siteInfoStore } from '@/stores';
-const Index = () => {
+const Footer = () => {
+ const { t } = useTranslation('translation', { keyPrefix: 'footer' }); //
Scoped translations for footer
const fullYear = dayjs().format('YYYY');
const siteName = siteInfoStore((state) => state.siteInfo.name);
const cc = `${fullYear} ${siteName}`;
+
return (
<footer className="bg-light">
<Container className="py-3">
- <p className="text-center mb-0 small text-secondary">
- <Trans i18nKey="footer.build_on" values={{ cc }}>
- Powered by
- {/* eslint-disable-next-line react/jsx-no-target-blank */}
- <a href="https://answer.apache.org" target="_blank">
+ <p className="text-center mb-0 p-3 small">
+ {/* Link to Privacy Policy with right margin for spacing */}
+ <Link to="/privacy" className="me-3">
+ {t('privacy')}
+ </Link>
+ {/* Link to Terms of Service with right margin */}
+ <Link to="/tos">{t('terms_of_service')}</Link>
Review Comment:
I'm not sure we can reuse these translations?
```suggestion
<Link to="/privacy" className="me-3">
{t('label', { keyPrefix: 'admin.legal.privacy_policy' })}
</Link>
{/* Link to Terms of Service with right margin */}
<Link to="/tos">
{t('label', { keyPrefix: 'admin.legal.terms_of_service' })}
</Link>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]