Skip to content

Commit

Permalink
♻️ refactor: move app page to the (main) layout group (#2297)
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 authored Apr 29, 2024
1 parent dafafa8 commit 6cc2c38
Show file tree
Hide file tree
Showing 215 changed files with 24 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { createStyles } from 'antd-style';
import dynamic from 'next/dynamic';
import { memo } from 'react';

import TopicListContent from '@/app/chat/features/TopicListContent';
import SafeSpacing from '@/components/SafeSpacing';
import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
import { useGlobalStore } from '@/store/global';
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useSessionStore } from '@/store/session';
import { sessionSelectors } from '@/store/session/selectors';

import TopicListContent from '../../../features/TopicListContent';

const SystemRole = dynamic(() => import('./SystemRole'));

const useStyles = createStyles(({ css, token }) => ({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import HeaderContent from '@/app/chat/settings/features/HeaderContent';
import HeaderContent from '@/app/(main)/chat/settings/features/HeaderContent';
import { pathString } from '@/utils/url';

const Header = memo(() => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Skeleton } from 'antd';
import { Suspense, memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import Inner from '@/app/market/features/TagList/Inner';
import Inner from './Inner';

const TagList = memo(() => {
return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import { useStyles } from '@/app/settings/about/style';
import { useUserStore } from '@/store/user';
import { preferenceSelectors } from '@/store/user/selectors';

import { useStyles } from './style';

const Analytics = memo(() => {
const { t } = useTranslation('setting');
const { styles } = useStyles();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { signIn, signOut } from 'next-auth/react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

import { useSyncSettings } from '@/app/settings/hooks/useSyncSettings';
import { useSyncSettings } from '@/app/(main)/settings/hooks/useSyncSettings';
import { FORM_STYLE } from '@/const/layoutTokens';
import { DEFAULT_SETTINGS } from '@/const/settings';
import { useOAuthSession } from '@/hooks/useOAuthSession';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Monitor, Moon, Palette, Sun } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { useSyncSettings } from '@/app/settings/hooks/useSyncSettings';
import { useSyncSettings } from '@/app/(main)/settings/hooks/useSyncSettings';
import { FORM_STYLE } from '@/const/layoutTokens';
import { imageUrl } from '@/const/url';
import AvatarWithUpload from '@/features/AvatarWithUpload';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { debounce } from 'lodash-es';
import { ReactNode, memo } from 'react';
import { useTranslation } from 'react-i18next';

import { useSyncSettings } from '@/app/settings/hooks/useSyncSettings';
import { useSyncSettings } from '@/app/(main)/settings/hooks/useSyncSettings';
import {
LLMProviderApiTokenKey,
LLMProviderBaseUrlKey,
LLMProviderConfigKey,
LLMProviderModelListKey,
} from '@/app/settings/llm/const';
} from '@/app/(main)/settings/llm/const';
import { FORM_STYLE } from '@/const/layoutTokens';
import { useUserStore } from '@/store/user';
import { modelConfigSelectors } from '@/store/user/selectors';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LucideDices } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { generateRandomRoomName } from '@/app/settings/sync/util';
import { generateRandomRoomName } from '../util';

interface ChannelNameInputProps extends Omit<InputProps, 'form'> {
form: FormInstance;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GridShowcase } from '@lobehub/ui';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import Banner from '@/app/welcome/features/Banner';
import Banner from '@/app/(main)/welcome/features/Banner';

const Showcase = memo(() => (
<Flexbox
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { memo } from 'react';
import { Center, Flexbox } from 'react-layout-kit';

import Banner from '@/app/welcome/features/Banner';
import Banner from '../features/Banner';

const Showcase = memo(() => (
<Flexbox align={'center'} justify={'center'} style={{ height: 'calc(100% - 44px)' }}>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 11 additions & 9 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ import { Metadata } from 'next';

import { getCanonicalUrl } from '@/const/url';

import Page from './home';
import Redirect from './home/Redirect';
import Client from './(loading)/Client';
import Redirect from './(loading)/Redirect';

const Index = () => (
<>
<Page />
<Redirect />
</>
);
const Page = () => {
return (
<>
<Client />
<Redirect />
</>
);
};

export default Index;
export default Page;

export const metadata: Metadata = {
alternates: { canonical: getCanonicalUrl('/') },
Expand Down

0 comments on commit 6cc2c38

Please sign in to comment.