Skip to content

Commit 480474d

Browse files
shuashuaiLinkinStars
authored andcommitted
fix: footer layout adjustment
1 parent d15d55a commit 480474d

File tree

5 files changed

+36
-34
lines changed

5 files changed

+36
-34
lines changed

i18n/en_US.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,7 @@ ui:
12081208
search:
12091209
placeholder: Search
12101210
footer:
1211-
build_on: >-
1212-
Powered by <1> Apache Answer </1>- the open-source software that powers Q&A
1213-
communities.<br />Made with love © {{cc}}.
1211+
build_on: Powered by <1> Apache Answer </1>
12141212
upload_img:
12151213
name: Change
12161214
loading: loading...
@@ -1807,6 +1805,7 @@ ui:
18071805
branding: Branding
18081806
legal: Legal
18091807
write: Write
1808+
terms: Terms
18101809
tos: Terms of Service
18111810
privacy: Privacy
18121811
seo: SEO

i18n/zh_CN.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,8 +1190,7 @@ ui:
11901190
search:
11911191
placeholder: 搜索
11921192
footer:
1193-
build_on: >-
1194-
由 <1>Apache Answer</1> 提供动力 - 驱动问答社区的开源软件。<br />用爱制造 © {{cc}}.
1193+
build_on: 由 <1>Apache Answer</1> 提供动力
11951194
upload_img:
11961195
name: 更改
11971196
loading: 加载中...
@@ -1768,6 +1767,7 @@ ui:
17681767
branding: 品牌
17691768
legal: 法律条款
17701769
write: 撰写
1770+
terms: 服务条款
17711771
tos: 服务条款
17721772
privacy: 隐私政策
17731773
seo: SEO

ui/src/components/Footer/index.tsx

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import React from 'react';
2121
import { Link } from 'react-router-dom';
2222
import { Trans, useTranslation } from 'react-i18next';
2323

24+
import Row from 'react-bootstrap/Row';
2425
import dayjs from 'dayjs';
2526

2627
import { siteInfoStore } from '@/stores';
@@ -29,34 +30,37 @@ const Index = () => {
2930
const { t } = useTranslation('translation', { keyPrefix: 'footer' }); // Scoped translations for footer
3031
const fullYear = dayjs().format('YYYY');
3132
const siteName = siteInfoStore((state) => state.siteInfo.name);
32-
const cc = `${fullYear} ${siteName}`;
33+
const cc = `${siteName} © ${fullYear}`;
3334

3435
return (
35-
<footer className="py-3 w-100">
36-
<p className="text-center mb-0 small">
37-
{/* Link to Terms of Service with right margin */}
38-
<Link to="/tos" className="me-3">
39-
{t('label', { keyPrefix: 'admin.legal.terms_of_service' })}
40-
</Link>
41-
42-
{/* Link to Privacy Policy with right margin for spacing */}
43-
<Link to="/privacy">
44-
{t('label', { keyPrefix: 'admin.legal.privacy_policy' })}
45-
</Link>
46-
</p>
47-
<p className="text-center mb-0 small">
48-
<Trans i18nKey="footer.build_on" values={{ cc }}>
49-
Powered by
50-
{/* eslint-disable-next-line react/jsx-no-target-blank */}
51-
<a href="https://answer.apache.org" target="_blank">
52-
Apache Answer
53-
</a>
54-
- the open-source software that powers Q&A communities.
55-
<br />
56-
Made with love. © 2022 Answer.
57-
</Trans>
58-
</p>
59-
</footer>
36+
<Row>
37+
<footer className="py-3 d-flex flex-wrap align-items-center justify-content-between text-secondary small">
38+
<div className="d-flex align-items-center">
39+
<div className="me-3">{cc}</div>
40+
41+
<Link to="/tos" className="me-3 link-secondary">
42+
{t('terms', { keyPrefix: 'nav_menus' })}
43+
</Link>
44+
45+
{/* Link to Privacy Policy with right margin for spacing */}
46+
<Link to="/privacy" className="link-secondary">
47+
{t('privacy', { keyPrefix: 'nav_menus' })}
48+
</Link>
49+
</div>
50+
<div>
51+
<Trans i18nKey="footer.build_on" values={{ cc }}>
52+
Powered by
53+
<a
54+
href="https://answer.apache.org"
55+
target="_blank"
56+
className="link-secondary"
57+
rel="noreferrer">
58+
Apache Answer
59+
</a>
60+
</Trans>
61+
</div>
62+
</footer>
63+
</Row>
6064
);
6165
};
6266

ui/src/index.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ img[src=''] {
127127
margin-top: auto !important;
128128
padding-bottom: constant(safe-area-inset-bottom);
129129
padding-bottom: env(safe-area-inset-bottom);
130-
padding-left: 12px !important;
131-
padding-right: 12px !important;
132130
}
133131

134132
.bg-f5 {

ui/src/pages/SideNavLayout/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ const Index: FC = () => {
3636
<div className="d-flex justify-content-center px-0 px-md-4">
3737
<div className="answer-container">
3838
<Outlet />
39+
40+
<Footer />
3941
</div>
4042
</div>
41-
<Footer />
4243
</div>
4344
</div>
4445
);

0 commit comments

Comments
 (0)