Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve login & signup dialogs #7152

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useResponsiveWindowSize } from '../../../UI/Responsive/ResponsiveWindow
import SaveProjectIcon from '../../SaveProjectIcon';
import Mobile from '../../../UI/CustomSvgIcons/Mobile';
import Desktop from '../../../UI/CustomSvgIcons/Desktop';
import AuthenticatedUserContext from '../../../Profile/AuthenticatedUserContext';
const electron = optionalRequire('electron');

type Props = {|
Expand All @@ -38,6 +39,7 @@ export const HomePageHeader = ({
canSave,
}: Props) => {
const { isMobile } = useResponsiveWindowSize();
const { profile } = React.useContext(AuthenticatedUserContext);

return (
<I18n>
Expand Down Expand Up @@ -92,7 +94,7 @@ export const HomePageHeader = ({
/>
))}
<UserChip onOpenProfile={onOpenProfile} />
<NotificationChip />
{profile && <NotificationChip />}
{isMobile ? (
<IconButton size="small" onClick={onOpenLanguageDialog}>
<TranslateIcon fontSize="small" />
Expand Down
37 changes: 7 additions & 30 deletions newIDE/app/src/Profile/CreateAccountDialog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow
import React from 'react';
import { Trans } from '@lingui/macro';
import { t } from '@lingui/macro';

import FlatButton from '../UI/FlatButton';
import Dialog, { DialogPrimaryButton } from '../UI/Dialog';
Expand All @@ -12,23 +11,21 @@ import {
} from '../Utils/GDevelopServices/Authentication';
import { type UsernameAvailability } from '../Utils/GDevelopServices/User';
import LeftLoader from '../UI/LeftLoader';
import BackgroundText from '../UI/BackgroundText';
import { ColumnStackLayout, LineStackLayout } from '../UI/Layout';
import { MarkdownText } from '../UI/MarkdownText';
import { ColumnStackLayout } from '../UI/Layout';
import { isUsernameValid } from './UsernameField';
import HelpButton from '../UI/HelpButton';
import Text from '../UI/Text';
import GDevelopGLogo from '../UI/CustomSvgIcons/GDevelopGLogo';
import { Column } from '../UI/Grid';
import Link from '../UI/Link';
import { useResponsiveWindowSize } from '../UI/Responsive/ResponsiveWindowMeasurer';
import CreateAccountForm from './CreateAccountForm';

const getStyles = ({ isMobile }) => {
return {
formContainer: {
width: isMobile ? '95%' : '60%',
display: 'flex',
width: isMobile ? '95%' : '90%',
marginTop: 10,
flexDirection: 'column',
},
};
};
Expand Down Expand Up @@ -182,7 +179,7 @@ const CreateAccountDialog = ({
onRequestClose={() => {
if (!createAccountInProgress) onClose();
}}
maxWidth="sm"
maxWidth="md"
open
flexColumnBody
>
Expand All @@ -194,24 +191,8 @@ const CreateAccountDialog = ({
>
<GDevelopGLogo fontSize="large" />
<Text size="section-title" align="center" noMargin>
<Trans>Sign up for free!</Trans>
<Trans>Welcome to GDevelop!</Trans>
</Text>
<Column noMargin alignItems="center">
<LineStackLayout noMargin>
<Text size="body2" noMargin align="center">
<Trans>Already a member?</Trans>
</Text>
<Link
href="#"
onClick={onGoToLogin}
disabled={createAccountInProgress}
>
<Text size="body2" noMargin color="inherit">
<Trans>Log in to your account</Trans>
</Text>
</Link>
</LineStackLayout>
</Column>
<div style={styles.formContainer}>
<CreateAccountForm
onCreateAccount={createAccount}
Expand All @@ -230,13 +211,9 @@ const CreateAccountDialog = ({
onChangeUsernameAvailability={setUsernameAvailability}
isValidatingUsername={isValidatingUsername}
onChangeIsValidatingUsername={setIsValidatingUsername}
onGoToLogin={onGoToLogin}
/>
</div>
<BackgroundText>
<MarkdownText
translatableSource={t`By creating an account and using GDevelop, you agree to the [Terms and Conditions](https://gdevelop.io/page/terms-and-conditions).`}
/>
</BackgroundText>
</ColumnStackLayout>
</Dialog>
);
Expand Down
Loading
Loading