Răsfoiți Sursa

✨ feat(mobile): add global toast notification component

- import and add Toaster component to mobile app root for consistent notifications

🐛 fix(mobile): correct profile edit save button state

- fix save button disabled state to properly reflect both user and profile update status
- update loading text condition to check both mutations' pending states
- remove unnecessary submit type from button to prevent form submission issues
yourname 7 luni în urmă
părinte
comite
c006a8329c

+ 2 - 0
src/client/mobile/index.tsx

@@ -6,6 +6,7 @@ import { RouterProvider } from 'react-router-dom'
 import { router } from './routes'
 import { ToastContainer } from 'react-toastify'
 import 'react-toastify/dist/ReactToastify.css'
+import { Toaster } from '../components/ui/sonner'
 
 // 创建QueryClient实例
 const queryClient = new QueryClient();
@@ -28,6 +29,7 @@ const App = () => {
           pauseOnHover
           theme="light"
         />
+        <Toaster />
       </AuthProvider>
     </QueryClientProvider>
   )

+ 6 - 6
src/client/mobile/pages/ProfileEditPage.tsx

@@ -491,13 +491,13 @@ const ProfileEditPage: React.FC = () => {
 
             {/* 保存按钮 */}
             <div className="pt-4">
-              <Button 
-                type="submit" 
-                className="w-full" 
-                size="lg" 
-                disabled={loading}
+              <Button
+                // type="submit"
+                className="w-full"
+                size="lg"
+                disabled={updateUserMutation.isPending || updateProfileMutation.isPending}
               >
-                {loading ? '保存中...' : '保存修改'}
+                {updateUserMutation.isPending || updateProfileMutation.isPending ? '保存中...' : '保存修改'}
               </Button>
             </div>
           </form>