Skip to content

Commit

Permalink
ui: Added privacy policy and terms of service link in the footer( sol…
Browse files Browse the repository at this point in the history
…ved #1187)
  • Loading branch information
Mindslayer001 authored and sy-records committed Dec 30, 2024
1 parent 4f3db7e commit 4324eec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions i18n/en_US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,8 @@ ui:
build_on: >-
Powered by <1> Apache Answer </1>- the open-source software that powers Q&A
communities.<br />Made with love © {{cc}}.
privacy: Privacy Policy
terms_of_service: Terms of Service
upload_img:
name: Change
loading: loading...
Expand Down
33 changes: 25 additions & 8 deletions ui/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,51 @@

import React from 'react';
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">
<a
className="me-2"
href="/privacy"
target="_blank"
rel="noopener noreferrer">
{t('privacy')} {/* Fetch translated Privacy Policy text */}
</a>
<a href="/tos" target="_blank" rel="noopener noreferrer">
{t('terms_of_service')}{' '}
{/* Fetch translated Terms of Service text */}
</a>
</p>
<p className="text-center mb-0 small text-secondary">
<Trans i18nKey="build_on" values={{ cc }}>
Powered by{' '}
<a
href="https://answer.apache.org"
target="_blank"
rel="noopener noreferrer">
Apache Answer
</a>
- the open-source software that powers Q&A communities.
<br />
Made with love. © 2022 Answer.
Made with love © 2022 Answer.
</Trans>
</p>
</Container>
</footer>
);
};

export default React.memo(Index);
export default React.memo(Footer);

0 comments on commit 4324eec

Please sign in to comment.