feat: add WebSocket URL for client and update GoogleLoginButton text to 'Loading...' for better user feedback
This commit is contained in:
@@ -187,7 +187,7 @@ class GoogleLoginButton extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { disabled, style, className, text = (this.props.t ? this.props.t('auth.loginWithGoogle') : 'Mit Google anmelden') } = this.props;
|
||||
const { disabled, style, className, text = 'Loading...'} = this.props;
|
||||
const { isInitializing, isPrompting } = this.state;
|
||||
const isLoading = isInitializing || isPrompting || (this.context && !this.context.isLoaded);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import CartSyncDialog from './CartSyncDialog.js';
|
||||
import { localAndArchiveServer, mergeCarts } from '../utils/cartUtils.js';
|
||||
import config from '../config.js';
|
||||
import { withI18n } from '../i18n/withTranslation.js';
|
||||
import GoogleIcon from '@mui/icons-material/Google';
|
||||
|
||||
// Lazy load GoogleAuthProvider
|
||||
const GoogleAuthProvider = lazy(() => import('../providers/GoogleAuthProvider.js'));
|
||||
@@ -614,27 +615,26 @@ export class LoginComponent extends Component {
|
||||
)}
|
||||
|
||||
{showGoogleAuth && (
|
||||
<div>
|
||||
<Suspense fallback={
|
||||
<Button
|
||||
<Button
|
||||
variant="contained"
|
||||
startIcon={<PersonIcon />}
|
||||
sx={{ width: '100%', backgroundColor: '#4285F4', color: 'white' }}
|
||||
startIcon={<GoogleIcon />}
|
||||
disabled
|
||||
fullWidth
|
||||
style={{backgroundColor: '#4285F4', color: 'white' }}
|
||||
>
|
||||
Mit Google anmelden
|
||||
Loading...
|
||||
</Button>
|
||||
}>
|
||||
<GoogleAuthProvider clientId={config.googleClientId}>
|
||||
<GoogleLoginButton
|
||||
onSuccess={this.handleGoogleLoginSuccess}
|
||||
onError={this.handleGoogleLoginError}
|
||||
text="Mit Google anmelden"
|
||||
style={{ width: '100%', backgroundColor: '#4285F4' }}
|
||||
autoInitiate={true}
|
||||
/>
|
||||
</GoogleAuthProvider>
|
||||
</Suspense>
|
||||
</div>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
|
||||
@@ -679,6 +679,7 @@ export default {
|
||||
},
|
||||
client: {
|
||||
logging: 'verbose',
|
||||
webSocketURL: 'wss://dev.seedheads.de/ws',
|
||||
overlay: {
|
||||
errors: true,
|
||||
warnings: true, // Disable warnings overlay to reduce noise
|
||||
|
||||
Reference in New Issue
Block a user