Skip to content

Commit 19fd4d5

Browse files
💄 style: remove r2 cdn url (lobehub#2878)
* 💄 style: Remove r2 cdn url * 💄 style: Update SettingContainer * 🔧 chore: Move share setting components
1 parent 093ac69 commit 19fd4d5

File tree

11 files changed

+55
-44
lines changed

11 files changed

+55
-44
lines changed

public/videos/feedback.mp4

1.44 MB
Binary file not shown.

public/videos/star.mp4

910 KB
Binary file not shown.

src/app/(main)/chat/settings/_layout/Desktop/index.tsx

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
import { PropsWithChildren } from 'react';
2-
import { Flexbox } from 'react-layout-kit';
32

43
import SafeSpacing from '@/components/SafeSpacing';
54
import { HEADER_HEIGHT } from '@/const/layoutTokens';
5+
import Footer from '@/features/Setting/Footer';
6+
import SettingContainer from '@/features/Setting/SettingContainer';
67

78
import Header from './Header';
89

910
const Layout = ({ children }: PropsWithChildren) => (
1011
<>
1112
<Header />
12-
<Flexbox
13-
align={'center'}
14-
height={'100%'}
15-
style={{ overflowX: 'hidden', overflowY: 'auto' }}
16-
width={'100%'}
17-
>
18-
<SafeSpacing height={HEADER_HEIGHT - 16} />
19-
<Flexbox gap={64} style={{ maxWidth: 1024, padding: '32px 24px' }} width={'100%'}>
20-
{children}
21-
</Flexbox>
22-
</Flexbox>
13+
<SettingContainer addonAfter={<Footer />} addonBefore={<SafeSpacing height={HEADER_HEIGHT} />}>
14+
{children}
15+
</SettingContainer>
2316
</>
2417
);
2518

src/app/(main)/chat/settings/_layout/Mobile/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
import { PropsWithChildren } from 'react';
44

55
import MobileContentLayout from '@/components/server/MobileNavLayout';
6+
import Footer from '@/features/Setting/Footer';
67

78
import Header from './Header';
89

910
const Layout = ({ children }: PropsWithChildren) => (
10-
<MobileContentLayout header={<Header />}>{children}</MobileContentLayout>
11+
<MobileContentLayout header={<Header />}>
12+
{children}
13+
<Footer />
14+
</MobileContentLayout>
1115
);
1216

1317
Layout.displayName = 'MobileSessionSettingsLayout';

src/app/(main)/settings/_layout/Desktop/index.tsx

+4-21
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { memo, useRef } from 'react';
66
import { useTranslation } from 'react-i18next';
77
import { Flexbox } from 'react-layout-kit';
88

9-
import Footer from '@/app/(main)/settings/features/Footer';
9+
import SettingContainer from '@/features/Setting//SettingContainer';
10+
import Footer from '@/features/Setting/Footer';
1011
import { useActiveSettingsKey } from '@/hooks/useActiveSettingsKey';
1112
import { SettingsTabs } from '@/store/global/initialState';
1213

@@ -16,7 +17,7 @@ import SideBar from './SideBar';
1617

1718
const Layout = memo<LayoutProps>(({ children, category }) => {
1819
const ref = useRef<any>(null);
19-
const { md = true, mobile = false } = useResponsive();
20+
const { md = true } = useResponsive();
2021
const { t } = useTranslation('setting');
2122
const activeKey = useActiveSettingsKey();
2223

@@ -43,25 +44,7 @@ const Layout = memo<LayoutProps>(({ children, category }) => {
4344
{category}
4445
</Header>
4546
)}
46-
<Flexbox
47-
align={'center'}
48-
height={'100%'}
49-
paddingBlock={mobile ? undefined : 32}
50-
style={{ overflowX: 'hidden', overflowY: 'auto' }}
51-
width={'100%'}
52-
>
53-
<Flexbox
54-
gap={64}
55-
paddingInline={mobile ? undefined : 24}
56-
style={{
57-
maxWidth: 1024,
58-
}}
59-
width={'100%'}
60-
>
61-
{children}
62-
</Flexbox>
63-
<Footer />
64-
</Flexbox>
47+
<SettingContainer addonAfter={<Footer />}>{children}</SettingContainer>
6548
</Flexbox>
6649
);
6750
});

src/app/(main)/settings/_layout/Mobile/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Footer from '@/app/(main)/settings/features/Footer';
21
import MobileContentLayout from '@/components/server/MobileNavLayout';
2+
import Footer from '@/features/Setting/Footer';
33

44
import { LayoutProps } from '../type';
55
import Header from './Header';

src/app/(main)/settings/about/features/Version.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ const Version = memo<{ mobile?: boolean }>(({ mobile }) => {
2727
<Flexbox
2828
align={'center'}
2929
gap={16}
30-
horizontal
30+
horizontal={!mobile}
3131
justify={'space-between'}
3232
width={'100%'}
33-
wrap={'wrap'}
3433
>
3534
<Flexbox align={'center'} flex={'none'} gap={16} horizontal>
3635
<Link href={OFFICIAL_SITE} target={'_blank'}>

src/app/@modal/_layout/SettingModalLayout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Flexbox } from 'react-layout-kit';
66

77
import Header from '@/app/(main)/settings/_layout/Desktop/Header';
88
import SideBar from '@/app/(main)/settings/_layout/Desktop/SideBar';
9-
import Footer from '@/app/(main)/settings/features/Footer';
9+
import Footer from '@/features/Setting/Footer';
1010

1111
interface SettingLayoutProps {
1212
activeTitle?: ReactNode;

src/const/url.ts

-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,4 @@ export const MEDIDUM = 'https://medium.com/@lobehub';
5656
export const X = 'https://x.com/lobehub';
5757
export const RELEASES_URL = urlJoin(GITHUB, 'releases');
5858

59-
export const R2_CDN_URL = 'https://hub-apac-1.lobeobjects.space/';
60-
61-
export const getR2Url = (filename: string) => urlJoin(R2_CDN_URL, filename);
6259
export const mailTo = (email: string) => `mailto:${email}`;

src/app/(main)/settings/features/Footer.tsx src/features/Setting/Footer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Center, Flexbox } from 'react-layout-kit';
1010

1111
import GuideModal from '@/components/GuideModal';
1212
import GuideVideo from '@/components/GuideVideo';
13-
import { GITHUB, GITHUB_ISSUES, getR2Url } from '@/const/url';
13+
import { GITHUB, GITHUB_ISSUES } from '@/const/url';
1414
import { isOnServerSide } from '@/utils/env';
1515

1616
const useStyles = createStyles(
@@ -65,7 +65,7 @@ const Footer = memo<PropsWithChildren>(() => {
6565
</Flexbox>
6666
<GuideModal
6767
cancelText={t('footer.later')}
68-
cover={<GuideVideo height={269} src={getR2Url('/assets/star.mp4')} width={358} />}
68+
cover={<GuideVideo height={269} src={'/videos/star.mp4'} width={358} />}
6969
desc={t('footer.star.desc')}
7070
okText={t('footer.star.action')}
7171
onCancel={() => setOpenStar(false)}
@@ -78,7 +78,7 @@ const Footer = memo<PropsWithChildren>(() => {
7878
/>
7979
<GuideModal
8080
cancelText={t('footer.later')}
81-
cover={<GuideVideo height={269} src={getR2Url('/assets/feedback.mp4')} width={358} />}
81+
cover={<GuideVideo height={269} src={'/videos/feedback.mp4'} width={358} />}
8282
desc={t('footer.feedback.desc')}
8383
okText={t('footer.feedback.action')}
8484
onCancel={() => setOpenFeedback(false)}
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use client';
2+
3+
import { useResponsive } from 'antd-style';
4+
import { PropsWithChildren, ReactNode, memo } from 'react';
5+
import { Flexbox } from 'react-layout-kit';
6+
7+
const SettingContainer = memo<
8+
PropsWithChildren<{ addonAfter?: ReactNode; addonBefore?: ReactNode }>
9+
>(({ children, addonAfter, addonBefore }) => {
10+
const { mobile = false } = useResponsive();
11+
return (
12+
<Flexbox
13+
align={'center'}
14+
height={'100%'}
15+
paddingBlock={mobile ? undefined : 32}
16+
style={{ overflowX: 'hidden', overflowY: 'auto' }}
17+
width={'100%'}
18+
>
19+
{addonBefore}
20+
<Flexbox
21+
gap={64}
22+
paddingInline={mobile ? undefined : 24}
23+
style={{
24+
maxWidth: 1024,
25+
}}
26+
width={'100%'}
27+
>
28+
{children}
29+
</Flexbox>
30+
{addonAfter}
31+
</Flexbox>
32+
);
33+
});
34+
35+
export default SettingContainer;

0 commit comments

Comments
 (0)