Skip to content

Commit

Permalink
🐛 fix: Fix Setings Layout (lobehub#2340)
Browse files Browse the repository at this point in the history
* 🐛 fix: Fix TelemetryChat Config

* 🔧 chore: Move UserAvatar

* 💄 style: Update UserInfo
  • Loading branch information
canisminor1990 authored May 2, 2024
1 parent b353002 commit 6a2e9a9
Show file tree
Hide file tree
Showing 32 changed files with 141 additions and 49 deletions.
4 changes: 4 additions & 0 deletions locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "إدارة الفواتير",
"default": {
"nickname": "مستخدم المجتمع",
"username": "نسخة معاينة المجتمع"
},
"discord": "الدعم المجتمعي",
"docs": "وثائق الاستخدام",
"email": "الدعم عبر البريد الإلكتروني",
Expand Down
4 changes: 4 additions & 0 deletions locales/bg-BG/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Сметки",
"default": {
"nickname": "Потребител на общността",
"username": "Преглед на общността"
},
"discord": "Общностна поддръжка",
"docs": "Документация",
"email": "Имейл поддръжка",
Expand Down
4 changes: 4 additions & 0 deletions locales/de-DE/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Abrechnung",
"default": {
"nickname": "Community-Benutzer",
"username": "Community-Vorschauversion"
},
"discord": "Community-Support",
"docs": "Dokumentation",
"email": "E-Mail-Support",
Expand Down
4 changes: 4 additions & 0 deletions locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Billing",
"default": {
"nickname": "Community User",
"username": "Community Preview"
},
"discord": "Community Support",
"docs": "Documentation",
"email": "Email Support",
Expand Down
4 changes: 4 additions & 0 deletions locales/es-ES/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Gestión de facturación",
"default": {
"nickname": "Usuario de la comunidad",
"username": "Vista previa de la comunidad"
},
"discord": "Soporte comunitario",
"docs": "Documentación de uso",
"email": "Soporte por correo electrónico",
Expand Down
4 changes: 4 additions & 0 deletions locales/fr-FR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Gestion de la facturation",
"default": {
"nickname": "Utilisateur de la communauté",
"username": "Aperçu de la communauté"
},
"discord": "Support communautaire",
"docs": "Documentation d'utilisation",
"email": "Support par e-mail",
Expand Down
4 changes: 4 additions & 0 deletions locales/it-IT/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Gestione fatturazione",
"default": {
"nickname": "Utente della community",
"username": "Anteprima della community"
},
"discord": "Supporto comunità",
"docs": "Documentazione",
"email": "Supporto email",
Expand Down
4 changes: 4 additions & 0 deletions locales/ja-JP/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "請求管理",
"default": {
"nickname": "コミュニティユーザー",
"username": "コミュニティプレビュー"
},
"discord": "コミュニティサポート",
"docs": "ドキュメント",
"email": "メールサポート",
Expand Down
4 changes: 4 additions & 0 deletions locales/ko-KR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "청구서 관리",
"default": {
"nickname": "커뮤니티 사용자",
"username": "커뮤니티 미리보기"
},
"discord": "커뮤니티 지원",
"docs": "사용 설명서",
"email": "이메일 지원",
Expand Down
4 changes: 4 additions & 0 deletions locales/nl-NL/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "账单管理",
"default": {
"nickname": "Gemeenschapsgebruiker",
"username": "Gemeenschapsvoorbeeld"
},
"discord": "社区支持",
"docs": "使用文档",
"email": "邮件支持",
Expand Down
4 changes: 4 additions & 0 deletions locales/pl-PL/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Zarządzanie rachunkiem",
"default": {
"nickname": "Użytkownik społeczności",
"username": "Podgląd społeczności"
},
"discord": "Wsparcie społeczności",
"docs": "Dokumentacja",
"email": "Wsparcie mailowe",
Expand Down
4 changes: 4 additions & 0 deletions locales/pt-BR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "gerenciamento de faturas",
"default": {
"nickname": "Usuário da Comunidade",
"username": "Visualização da Comunidade"
},
"discord": "suporte da comunidade",
"docs": "documentação",
"email": "suporte por e-mail",
Expand Down
4 changes: 4 additions & 0 deletions locales/ru-RU/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Управление счетами",
"default": {
"nickname": "Пользователь сообщества",
"username": "Предварительная версия сообщества"
},
"discord": "Поддержка сообщества",
"docs": "Документация",
"email": "Поддержка по электронной почте",
Expand Down
4 changes: 4 additions & 0 deletions locales/tr-TR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Fatura Yönetimi",
"default": {
"nickname": "Topluluk Kullanıcısı",
"username": "Topluluk Önizlemesi"
},
"discord": "Topluluk Destek",
"docs": "Belgeler",
"email": "E-posta Destek",
Expand Down
4 changes: 4 additions & 0 deletions locales/vi-VN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "Quản lý thanh toán",
"default": {
"nickname": "Người dùng Cộng đồng",
"username": "Bản xem trước Cộng đồng"
},
"discord": "Hỗ trợ cộng đồng",
"docs": "Tài liệu sử dụng",
"email": "Hỗ trợ qua email",
Expand Down
4 changes: 4 additions & 0 deletions locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "账单管理",
"default": {
"nickname": "社区用户",
"username": "社区预览版"
},
"discord": "社区支持",
"docs": "使用文档",
"email": "邮件支持",
Expand Down
4 changes: 4 additions & 0 deletions locales/zh-TW/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
},
"userPanel": {
"billing": "帳單管理",
"default": {
"nickname": "社群使用者",
"username": "社群預覽版"
},
"discord": "社群支援",
"docs": "使用文件",
"email": "郵件支援",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/(mobile)/me/features/Cate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
import urlJoin from 'url-join';

import { useCategory } from '@/app/(main)/settings//hooks/useCategory';
import { useCategory } from '@/app/(main)/settings/hooks/useCategory';
import Cell from '@/components/Cell';
import Divider from '@/components/Cell/Divider';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/(mobile)/me/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { redirect } from 'next/navigation';
import { Center } from 'react-layout-kit';

import Avatar from '@/app/(main)/@nav/features/UserAvatar';
import BrandWatermark from '@/components/BrandWatermark';
import Avatar from '@/features/User/UserAvatar';
import { isMobileDevice } from '@/utils/responsive';

import AvatarBanner from './features/AvatarBanner';
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/@nav/_layout/Desktop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { SideNav } from '@lobehub/ui';
import { memo } from 'react';

import UserPanel from '@/app/(main)/@nav/features/UserPanel';
import UserAvatar from '@/features/User/UserAvatar';
import { useActiveTabKey } from '@/hooks/useActiveTabKey';

import Avatar from '../../features/UserAvatar';
import BottomActions from './BottomActions';
import TopActions from './TopActions';

Expand All @@ -16,7 +16,7 @@ const Nav = memo(() => {
<SideNav
avatar={
<UserPanel>
<Avatar />
<UserAvatar />
</UserPanel>
}
bottomActions={<BottomActions tab={sidebarKey} />}
Expand Down
3 changes: 2 additions & 1 deletion src/app/(main)/@nav/features/UserPanel/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Flexbox } from 'react-layout-kit';

import BrandWatermark from '@/components/BrandWatermark';
import Menu from '@/components/Menu';
import UserInfo from '@/features/User/UserInfo';

import LangButton from './LangButton';
import ThemeButton from './ThemeButton';
Expand All @@ -13,7 +14,7 @@ const PopoverContent = memo<{ closePopover: () => void }>(({ closePopover }) =>

return (
<Flexbox gap={2} style={{ minWidth: 300 }}>
{/*<UserInfo />*/}
<UserInfo />
<Menu items={mainItems} onClick={closePopover} />
<Flexbox
align={'center'}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/@nav/features/UserPanel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createStyles } from 'antd-style';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import UserAvatar from '../UserAvatar';
import UserAvatar from '@/features/User/UserAvatar';

const useStyles = createStyles(({ css, token }) => ({
nickname: css`
Expand Down
3 changes: 3 additions & 0 deletions src/app/(main)/@nav/features/UserPanel/useMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export const useMenu = () => {
];

const mainItems = [
{
type: 'divider',
},
...settings,
...exports,
...helps,
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/settings/@category/default.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UpgradeAlert from '@/app/(main)/settings//features/UpgradeAlert';
import UpgradeAlert from '@/app/(main)/settings/features/UpgradeAlert';

import CategoryContent from './features/CategoryContent';

Expand Down
19 changes: 12 additions & 7 deletions src/app/(main)/settings/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
'use client';

import { Logo, Tag } from '@lobehub/ui';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import Follow from '@//features/Follow';
import AboutList from '@/app/(main)/settings//about/features/AboutList';
import Analytics from '@/app/(main)/settings/about/features/Analytics';
import { getServerConfig } from '@/config/server';
import { CURRENT_VERSION } from '@/const/version';
import Follow from '@/features/Follow';
import { useServerConfigStore } from '@/store/serverConfig';
import { serverConfigSelectors } from '@/store/serverConfig/selectors';

const enabledTelemetryChat = getServerConfig().ENABLE_LANGFUSE;
import AboutList from './features/AboutList';
import Analytics from './features/Analytics';

const COPYRIGHT = `© 2023-${new Date().getFullYear()} LobeHub, LLC`;

const Page = ({ mobile }: { mobile?: boolean }) => {
const Page = memo(({ mobile }: { mobile?: boolean }) => {
const enabledTelemetryChat = useServerConfigStore(serverConfigSelectors.enabledTelemetryChat);

return (
<Flexbox align={'center'} gap={12} paddingBlock={36} width={'100%'}>
<Logo size={mobile ? 100 : 120} />
Expand All @@ -28,7 +33,7 @@ const Page = ({ mobile }: { mobile?: boolean }) => {
<div style={{ fontWeight: 400, opacity: 0.33 }}>{COPYRIGHT}</div>
</Flexbox>
);
};
});

Page.displayName = 'AboutSetting';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/settings/common/features/Common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { signIn, signOut } from 'next-auth/react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

import { useSyncSettings } from '@/app/(main)/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
6 changes: 5 additions & 1 deletion src/app/(main)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { redirect } from 'next/navigation';

import Common from './common';

const Page = () => {
return redirect('/settings/common');
redirect('/settings/common');

return <Common />;
};

export default Page;
32 changes: 0 additions & 32 deletions src/app/@modal/_layout/Desktop.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/app/@modal/_layout/Mobile.tsx

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 6a2e9a9

Please sign in to comment.