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

ui: Added privacy policy and terms of service link in the footer #1216

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
ui: Added privacy policy and terms of service link in the footer( sol…
…ved #1187)
Mindslayer001 authored and sy-records committed Dec 30, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 4324eece92035cade141c4db0f8885f1b305f1e1
2 changes: 2 additions & 0 deletions i18n/en_US.yaml
Original file line number Diff line number Diff line change
@@ -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...
33 changes: 25 additions & 8 deletions ui/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete text-secondary in class

<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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Use the Link component of react-router-dom to replace the a tag.
  2. Remove target and rel attributes.

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);