You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by lu...@apache.org on 2024/12/31 09:20:49 UTC

(incubator-answer) branch dev updated: feat: Add "Privacy Policy" and "Terms of Service" link in footer (#1217)

This is an automated email from the ASF dual-hosted git repository.

lufei pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 96efad2c feat: Add "Privacy Policy" and "Terms of Service" link in footer (#1217)
96efad2c is described below

commit 96efad2c5ab9466f8434380bdd0cdecbdfecb551
Author: Mani Sankar Chintagunti <ma...@gmail.com>
AuthorDate: Tue Dec 31 14:50:45 2024 +0530

    feat: Add "Privacy Policy" and "Terms of Service" link in footer (#1217)
    
    Co-authored-by: LinkinStars <li...@foxmail.com>
---
 internal/migrations/migrations.go  |  2 +-
 ui/src/components/Footer/index.tsx | 20 +++++++++++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/internal/migrations/migrations.go b/internal/migrations/migrations.go
index 00e44198..6160ca88 100644
--- a/internal/migrations/migrations.go
+++ b/internal/migrations/migrations.go
@@ -99,7 +99,7 @@ var migrations = []Migration{
 	NewMigration("v1.3.6", "add hot score to question table", addQuestionHotScore, true),
 	NewMigration("v1.4.0", "add badge/badge_group/badge_award table", addBadges, true),
 	NewMigration("v1.4.1", "add question link", addQuestionLink, true),
-	NewMigration("v1.4.2", "add the number of question links", addQuestionLinkedCount, false),
+	NewMigration("v1.4.2", "add the number of question links", addQuestionLinkedCount, true),
 }
 
 func GetMigrations() []Migration {
diff --git a/ui/src/components/Footer/index.tsx b/ui/src/components/Footer/index.tsx
index 506e0cad..d5aeaf03 100644
--- a/ui/src/components/Footer/index.tsx
+++ b/ui/src/components/Footer/index.tsx
@@ -18,21 +18,35 @@
  */
 
 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 { 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">
+      <Container>
+        <p className="text-center mb-0 small">
+          {/* Link to Terms of Service with right margin */}
+          <Link to="/tos" className="me-2">
+            {t('label', { keyPrefix: 'admin.legal.terms_of_service' })}
+          </Link>
+
+          {/* Link to Privacy Policy with right margin for spacing */}
+          <Link to="/privacy">
+            {t('label', { keyPrefix: 'admin.legal.privacy_policy' })}
+          </Link>
+        </p>
+        <p className="text-center mb-0 small">
           <Trans i18nKey="footer.build_on" values={{ cc }}>
             Powered by
             {/* eslint-disable-next-line react/jsx-no-target-blank */}