Skip to content

Commit

Permalink
♻️ refactor(layout): Refactor settings layout
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Oct 9, 2023
1 parent 26e1c41 commit bd48121
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/settings/(desktop)/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from '../common/page';
export { default } from '../common/index';
2 changes: 2 additions & 0 deletions src/app/settings/(desktop)/layout.desktop.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { PropsWithChildren, memo } from 'react';
import { Center, Flexbox } from 'react-layout-kit';

Expand Down
5 changes: 2 additions & 3 deletions src/app/settings/(mobile)/mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { AVATAR } from '@/store/session/slices/chat/actions/share';

import List from '../../features/SideBar/List';
import ExtraList from '../features/ExtraList';
import Layout from '../layout.mobile';

const useStyles = createStyles(({ css, token }) => ({
divider: css`
Expand All @@ -33,7 +32,7 @@ const Setting = memo(() => {
const { styles } = useStyles();

return (
<Layout>
<>
<AgentCardBanner
mask
meta={{ avatar: avatar || AVATAR }}
Expand All @@ -54,7 +53,7 @@ const Setting = memo(() => {
</Divider>
</Center>
</div>
</Layout>
</>
);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { PropsWithChildren, memo } from 'react';
import { Flexbox } from 'react-layout-kit';

Expand Down
2 changes: 0 additions & 2 deletions src/app/settings/common/Common.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import { Form, type ItemGroup, SelectWithImg, SliderWithInput } from '@lobehub/ui';
import { Form as AntForm, App, Button, Input, Select } from 'antd';
import isEqual from 'fast-deep-equal';
Expand Down
5 changes: 3 additions & 2 deletions src/app/settings/common/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOn
import { SettingsTabs } from '@/store/global/initialState';
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';

import Layout from '../layout.responsive';
import Common from './Common';

export default memo(() => {
useSwitchSideBarOnInit(SettingsTabs.Common);
const { t } = useTranslation('setting');
const pageTitle = genSiteHeadTitle(t('header.global'));
return (
<>
<Layout>
<PageTitle title={pageTitle} />
<Common />
</>
</Layout>
);
});
1 change: 0 additions & 1 deletion src/app/settings/common/layout.tsx

This file was deleted.

0 comments on commit bd48121

Please sign in to comment.