Skip to content

Commit

Permalink
💄 style: add user panel and refactor the next-auth (lobehub#2349)
Browse files Browse the repository at this point in the history
* ♻️ refactor: refactor the next-auth

* ✨ feat: Add User Panel

* 💄 style: Update User Avatar on mobile

* 🚸 style: fix data importer hot zone

* 🚸 style: add migration guide

* 🎨 chore:  clean code

* ✅ test: add test

* 🌐 chore: update locale

* 💄 style: improve style

* ✅ test: fix test

* 💄 style: improve locale switch

* ♻️ refactor: use middleware redirect instead of page

---------

Co-authored-by: canisminor1990 <i@canisminor.cc>
  • Loading branch information
arvinxx and canisminor1990 committed May 3, 2024
1 parent 6026481 commit 5cecee0
Show file tree
Hide file tree
Showing 48 changed files with 1,146 additions and 209 deletions.
14 changes: 14 additions & 0 deletions locales/ar/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "ترقية",
"hasNew": "يوجد تحديث متاح",
"newVersion": "هناك إصدار جديد متاح: {{version}}"
},
"userPanel": {
"billing": "إدارة الفواتير",
"defaultNickname": "مستخدم النسخة المجتمعية",
"discord": "الدعم المجتمعي",
"docs": "وثائق الاستخدام",
"email": "الدعم عبر البريد الإلكتروني",
"feedback": "تقديم ملاحظات واقتراحات",
"help": "مركز المساعدة",
"moveGuide": "تم نقل زر الإعدادات إلى هنا",
"plans": "خطط الاشتراك",
"profile": "إدارة الحساب",
"setting": "إعدادات التطبيق",
"usages": "إحصاءات الاستخدام"
}
}
14 changes: 14 additions & 0 deletions locales/bg-BG/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Надстрой",
"hasNew": "Налична е нова актуализация",
"newVersion": "Налична е нова версия: {{version}}"
},
"userPanel": {
"billing": "Управление на сметките",
"defaultNickname": "Потребител на общността",
"discord": "Поддръжка на общността",
"docs": "Документация",
"email": "Поддръжка по имейл",
"feedback": "Обратна връзка и предложения",
"help": "Център за помощ",
"moveGuide": "Бутонът за настройки е преместен тук",
"plans": "Планове за абонамент",
"profile": "Управление на профила",
"setting": "Настройки на приложението",
"usages": "Статистика за използване"
}
}
14 changes: 14 additions & 0 deletions locales/de-DE/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Aktualisieren",
"hasNew": "Neue Version verfügbar",
"newVersion": "Neue Version verfügbar: {{version}}"
},
"userPanel": {
"billing": "Abrechnung verwalten",
"defaultNickname": "Community User",
"discord": "Community-Support",
"docs": "Dokumentation",
"email": "E-Mail-Support",
"feedback": "Feedback und Vorschläge",
"help": "Hilfezentrum",
"moveGuide": "Die Einstellungen wurden hierher verschoben.",
"plans": "Abonnementpläne",
"profile": "Kontoverwaltung",
"setting": "App-Einstellungen",
"usages": "Nutzungsstatistiken"
}
}
14 changes: 14 additions & 0 deletions locales/en-US/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Upgrade",
"hasNew": "New update available",
"newVersion": "New version available: {{version}}"
},
"userPanel": {
"billing": "Billing Management",
"defaultNickname": "Community User",
"discord": "Community Support",
"docs": "Documentation",
"email": "Email Support",
"feedback": "Feedback and Suggestions",
"help": "Help Center",
"moveGuide": "The settings button has been moved here",
"plans": "Subscription Plans",
"profile": "Account Management",
"setting": "App Settings",
"usages": "Usage Statistics"
}
}
14 changes: 14 additions & 0 deletions locales/es-ES/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Actualizar",
"hasNew": "Hay una nueva actualización disponible",
"newVersion": "Nueva versión disponible: {{version}}"
},
"userPanel": {
"billing": "Gestión de facturación",
"defaultNickname": "Usuario de la comunidad",
"discord": "Soporte de la comunidad",
"docs": "Documentación de uso",
"email": "Soporte por correo electrónico",
"feedback": "Comentarios y sugerencias",
"help": "Centro de ayuda",
"moveGuide": "El botón de configuración se ha movido aquí",
"plans": "Planes de suscripción",
"profile": "Gestión de cuenta",
"setting": "Configuración de la aplicación",
"usages": "Estadísticas de uso"
}
}
14 changes: 14 additions & 0 deletions locales/fr-FR/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Mettre à jour",
"hasNew": "Nouvelle mise à jour disponible",
"newVersion": "Nouvelle version disponible : {{version}}"
},
"userPanel": {
"billing": "Gestion de la facturation",
"defaultNickname": "Utilisateur de la version communautaire",
"discord": "Support de la communauté",
"docs": "Documentation d'utilisation",
"email": "Support par e-mail",
"feedback": "Retours et suggestions",
"help": "Centre d'aide",
"moveGuide": "Le bouton de configuration a été déplacé ici",
"plans": "Forfaits d'abonnement",
"profile": "Gestion du compte",
"setting": "Paramètres de l'application",
"usages": "Statistiques d'utilisation"
}
}
14 changes: 14 additions & 0 deletions locales/it-IT/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Aggiorna",
"hasNew": "Nuovo aggiornamento disponibile",
"newVersion": "Nuova versione disponibile: {{version}}"
},
"userPanel": {
"billing": "Gestione fatturazione",
"defaultNickname": "Utente Community",
"discord": "Supporto della community",
"docs": "Documentazione",
"email": "Supporto via email",
"feedback": "Feedback e suggerimenti",
"help": "Centro assistenza",
"moveGuide": "Il pulsante delle impostazioni è stato spostato qui",
"plans": "Piani di abbonamento",
"profile": "Gestione account",
"setting": "Impostazioni app",
"usages": "Statistiche di utilizzo"
}
}
14 changes: 14 additions & 0 deletions locales/ja-JP/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "アップグレード",
"hasNew": "利用可能な更新があります",
"newVersion": "新しいバージョンが利用可能です:{{version}}"
},
"userPanel": {
"billing": "請求管理",
"defaultNickname": "コミュニティユーザー",
"discord": "コミュニティサポート",
"docs": "使用文書",
"email": "メールサポート",
"feedback": "フィードバックと提案",
"help": "ヘルプセンター",
"moveGuide": "設定ボタンがこちらに移動しました",
"plans": "サブスクリプションプラン",
"profile": "アカウント管理",
"setting": "アプリ設定",
"usages": "利用量統計"
}
}
14 changes: 14 additions & 0 deletions locales/ko-KR/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "업그레이드",
"hasNew": "사용 가능한 업데이트가 있습니다",
"newVersion": "새 버전 사용 가능: {{version}}"
},
"userPanel": {
"billing": "결제 관리",
"defaultNickname": "커뮤니티 사용자",
"discord": "커뮤니티 지원",
"docs": "사용 설명서",
"email": "이메일 지원",
"feedback": "피드백 및 제안",
"help": "도움말 센터",
"moveGuide": "설정 버튼을 여기로 이동했습니다",
"plans": "요금제",
"profile": "계정 관리",
"setting": "앱 설정",
"usages": "사용량 통계"
}
}
14 changes: 14 additions & 0 deletions locales/nl-NL/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "升级",
"hasNew": "有可用更新",
"newVersion": "有新版本可用:{{version}}"
},
"userPanel": {
"billing": "账单管理",
"defaultNickname": "Standaardgebruiker",
"discord": "社区支持",
"docs": "使用文档",
"email": "邮件支持",
"feedback": "反馈与建议",
"help": "帮助中心",
"moveGuide": "De instellingenknop is hierheen verplaatst",
"plans": "订阅方案",
"profile": "账户管理",
"setting": "应用设置",
"usages": "用量统计"
}
}
14 changes: 14 additions & 0 deletions locales/pl-PL/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Aktualizuj",
"hasNew": "Dostępna jest nowa aktualizacja",
"newVersion": "Dostępna jest nowa wersja: {{version}}"
},
"userPanel": {
"billing": "Zarządzanie rachunkami",
"defaultNickname": "Użytkownik Wersji Społecznościowej",
"discord": "Wsparcie społeczności",
"docs": "Dokumentacja",
"email": "Wsparcie mailowe",
"feedback": "Opinie i sugestie",
"help": "Centrum pomocy",
"moveGuide": "Przenieś przycisk ustawień tutaj",
"plans": "Plan abonamentu",
"profile": "Zarządzanie kontem",
"setting": "Ustawienia aplikacji",
"usages": "Statystyki użycia"
}
}
14 changes: 14 additions & 0 deletions locales/pt-BR/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Atualizar",
"hasNew": "Nova atualização disponível",
"newVersion": "Nova versão disponível: {{version}}"
},
"userPanel": {
"billing": "Gerenciamento de faturas",
"defaultNickname": "Usuário da Comunidade",
"discord": "Suporte da Comunidade",
"docs": "Documentação",
"email": "Suporte por E-mail",
"feedback": "Feedback e Sugestões",
"help": "Central de Ajuda",
"moveGuide": "O botão de configurações foi movido para cá",
"plans": "Planos de Assinatura",
"profile": "Gerenciamento de Conta",
"setting": "Configurações do Aplicativo",
"usages": "Estatísticas de Uso"
}
}
14 changes: 14 additions & 0 deletions locales/ru-RU/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "обновить",
"hasNew": "Доступно обновление",
"newVersion": "Доступна новая версия: {{version}}"
},
"userPanel": {
"billing": "Управление счетами",
"defaultNickname": "Пользователь сообщества",
"discord": "Поддержка сообщества",
"docs": "Документация",
"email": "Поддержка по электронной почте",
"feedback": "Обратная связь и предложения",
"help": "Центр помощи",
"moveGuide": "Кнопка настроек перемещена сюда",
"plans": "Планы подписки",
"profile": "Управление аккаунтом",
"setting": "Настройки приложения",
"usages": "Статистика использования"
}
}
14 changes: 14 additions & 0 deletions locales/tr-TR/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Güncelle",
"hasNew": "Yeni güncelleme mevcut",
"newVersion": "Yeni sürüm mevcut: {{version}}"
},
"userPanel": {
"billing": "Fatura Yönetimi",
"defaultNickname": "Topluluk Kullanıcısı",
"discord": "Topluluk Destek",
"docs": "Belgeler",
"email": "E-posta Destek",
"feedback": "Geribildirim ve Öneriler",
"help": "Yardım Merkezi",
"moveGuide": "Ayarlar düğmesini buraya taşıyın",
"plans": "Planlar",
"profile": "Hesap Yönetimi",
"setting": "Uygulama Ayarları",
"usages": "Kullanım İstatistikleri"
}
}
14 changes: 14 additions & 0 deletions locales/vi-VN/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "Nâng cấp",
"hasNew": "Có bản cập nhật mới",
"newVersion": "Có phiên bản mới: {{version}}"
},
"userPanel": {
"billing": "Quản lý hóa đơn",
"defaultNickname": "Người dùng phiên bản cộng đồng",
"discord": "Hỗ trợ cộng đồng",
"docs": "Tài liệu sử dụng",
"email": "Hỗ trợ qua email",
"feedback": "Phản hồi và đề xuất",
"help": "Trung tâm trợ giúp",
"moveGuide": "Đã di chuyển nút cài đặt đến đây",
"plans": "Kế hoạch đăng ký",
"profile": "Quản lý tài khoản",
"setting": "Cài đặt ứng dụng",
"usages": "Thống kê sử dụng"
}
}
14 changes: 14 additions & 0 deletions locales/zh-CN/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "升级",
"hasNew": "有可用更新",
"newVersion": "有新版本可用:{{version}}"
},
"userPanel": {
"billing": "账单管理",
"defaultNickname": "社区版用户",
"discord": "社区支持",
"docs": "使用文档",
"email": "邮件支持",
"feedback": "反馈与建议",
"help": "帮助中心",
"moveGuide": "设置按钮搬到这里啦",
"plans": "订阅方案",
"profile": "账户管理",
"setting": "应用设置",
"usages": "用量统计"
}
}
14 changes: 14 additions & 0 deletions locales/zh-TW/common.json
Expand Up @@ -157,5 +157,19 @@
"action": "升級",
"hasNew": "有可用更新",
"newVersion": "有新版本可用:{{version}}"
},
"userPanel": {
"billing": "帳單管理",
"defaultNickname": "社群版使用者",
"discord": "社區支援",
"docs": "使用文件",
"email": "郵件支援",
"feedback": "反饋與建議",
"help": "幫助中心",
"moveGuide": "設置按鈕搬到這裡啦",
"plans": "訂閱方案",
"profile": "帳戶管理",
"setting": "應用設定",
"usages": "用量統計"
}
}
7 changes: 7 additions & 0 deletions next.config.mjs
Expand Up @@ -30,6 +30,13 @@ const nextConfig = {

output: buildWithDocker ? 'standalone' : undefined,

redirects: async () => [
{
source: '/settings',
permanent: true,
destination: '/settings/common',
},
],
rewrites: async () => [
// due to google api not work correct in some countries
// we need a proxy to bypass the restriction
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/(mobile)/me/page.tsx
Expand Up @@ -2,7 +2,7 @@ import { redirect } from 'next/navigation';
import { Center } from 'react-layout-kit';

import BrandWatermark from '@/components/BrandWatermark';
import Avatar from '@/features/AvatarWithUpload';
import UserAvatar from '@/features/User/UserAvatar';
import { isMobileDevice } from '@/utils/responsive';

import AvatarBanner, { AVATAR_SIZE } from './features/AvatarBanner';
Expand All @@ -17,7 +17,7 @@ const Page = () => {
return (
<>
<AvatarBanner>
<Avatar size={AVATAR_SIZE} />
<UserAvatar size={AVATAR_SIZE} />
</AvatarBanner>
<Cate />
<ExtraCate />
Expand Down

0 comments on commit 5cecee0

Please sign in to comment.