Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau committed Nov 25, 2024
1 parent ae27abb commit ed5b165
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ const ExampleInformationPage = ({ exampleShortHeader }: Props) => {
{!isCompatible && (
<AlertMessage kind="error">
<Trans>
Unfortunately, this example requires a newer version of GDevelop to
work. Update GDevelop to be able to open this example.
Download the latest version of GDevelop to check out this example!
</Trans>
</AlertMessage>
)}
Expand Down
2 changes: 1 addition & 1 deletion newIDE/app/src/AssetStore/ExampleStore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useShouldAutofocusInput } from '../../UI/Responsive/ScreenTypeMeasurer'
import { type PrivateGameTemplateListingData } from '../../Utils/GDevelopServices/Shop';
import AuthenticatedUserContext from '../../Profile/AuthenticatedUserContext';
import { PrivateGameTemplateStoreContext } from '../PrivateGameTemplates/PrivateGameTemplateStoreContext';
import { GridList } from '@material-ui/core';
import GridList from '@material-ui/core/GridList';
import { getExampleAndTemplateTiles } from '../../MainFrame/EditorContainers/HomePage/BuildSection/utils';
import BackgroundText from '../../UI/BackgroundText';
import { ColumnStackLayout } from '../../UI/Layout';
Expand Down
4 changes: 2 additions & 2 deletions newIDE/app/src/MainFrame/UseNewProjectDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Props = {|
storageProviders: Array<StorageProvider>,
|};

const useExampleOrGameTemplateDialogs = ({
const useNewProjectDialog = ({
isProjectOpening,
newProjectSetupDialogOpen,
setNewProjectSetupDialogOpen,
Expand Down Expand Up @@ -238,4 +238,4 @@ const useExampleOrGameTemplateDialogs = ({
};
};

export default useExampleOrGameTemplateDialogs;
export default useNewProjectDialog;
3 changes: 1 addition & 2 deletions newIDE/app/src/ProjectCreation/AIPromptField.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ const AIPromptField = ({
);
const generateProject = React.useCallback(
async () => {
if (disabled) return;
if (!profile) return;
if (disabled || !profile) return;

onGenerationStarted();
try {
Expand Down
14 changes: 4 additions & 10 deletions newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { ExampleTile } from '../AssetStore/ShopTiles';
import { ExampleStoreContext } from '../AssetStore/ExampleStore/ExampleStoreContext';
import { type ExampleShortHeader } from '../Utils/GDevelopServices/Example';
import { useResponsiveWindowSize } from '../UI/Responsive/ResponsiveWindowMeasurer';
import { GridList, GridListTile } from '@material-ui/core';
import GridList from '@material-ui/core/GridList';
import GridListTile from '@material-ui/core/GridListTile';
import { shouldValidate } from '../UI/KeyboardShortcuts/InteractionKeys';
import classes from './EmptyAndStartingPointProjects.module.css';
import classNames from 'classnames';
import { getItemsColumns } from './NewProjectSetupDialog';

const getStyles = (theme: GDevelopTheme) => ({
Expand Down Expand Up @@ -43,15 +43,9 @@ const EmptyProjectTile = ({
const { isMobile } = useResponsiveWindowSize();
return (
<GridListTile style={style}>
<div
className={classNames({
[classes.container]: true,
})}
>
<div className={classes.container}>
<div
className={classNames({
[classes.emptyProject]: true,
})}
className={classes.emptyProject}
onClick={disabled ? undefined : onSelectEmptyProject}
tabIndex={0}
onKeyPress={(event: SyntheticKeyboardEvent<HTMLLIElement>): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

.emptyProject:hover {
background-color: var(--theme-hover-background-color);
transition: background-color 0.2s;
}

.emptyProject:focus {
background-color: var(--theme-hover-background-color)
background-color: var(--theme-hover-background-color);
transition: background-color 0.2s;
}

10 changes: 5 additions & 5 deletions newIDE/app/src/ProjectCreation/NewProjectSetupDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const NewProjectSetupDialog = ({
receivedGameTemplates,
]
);
const isSelectedGameTemplateOwned =
const noGameTemplateSelectedOrSelectedAndOwned =
!selectedPrivateGameTemplateListingData ||
!!selectedGameTemplatePurchaseUsageType;

Expand All @@ -288,7 +288,7 @@ const NewProjectSetupDialog = ({
const shouldAllowCreatingProject =
!isLoading &&
(!isOnHomePage &&
isSelectedGameTemplateOwned &&
noGameTemplateSelectedOrSelectedAndOwned &&
!needUserAuthenticationForStorage &&
!hasTooManyCloudProjects &&
(hasSelectedAStorageProvider || shouldAllowCreatingProjectWithoutSaving));
Expand Down Expand Up @@ -461,7 +461,7 @@ const NewProjectSetupDialog = ({
fullHeight={
isOnHomePage ||
(!!selectedPrivateGameTemplateListingData &&
!isSelectedGameTemplateOwned)
!noGameTemplateSelectedOrSelectedAndOwned)
}
flexColumnBody
forceScrollVisible
Expand Down Expand Up @@ -535,7 +535,7 @@ const NewProjectSetupDialog = ({
)}
{!isOnHomePage &&
selectedPrivateGameTemplateListingData &&
!isSelectedGameTemplateOwned && (
!noGameTemplateSelectedOrSelectedAndOwned && (
<PrivateGameTemplateInformationPage
privateGameTemplateListingData={
selectedPrivateGameTemplateListingData
Expand All @@ -546,7 +546,7 @@ const NewProjectSetupDialog = ({
onGameTemplateOpen={onSelectPrivateGameTemplateListingData}
/>
)}
{!isOnHomePage && isSelectedGameTemplateOwned && (
{!isOnHomePage && noGameTemplateSelectedOrSelectedAndOwned && (
<ColumnStackLayout noMargin>
{selectedExampleShortHeader ? (
<ExampleInformationPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { I18n } from '@lingui/react';
import { ExampleStoreContext } from '../AssetStore/ExampleStore/ExampleStoreContext';
import { ExampleTile } from '../AssetStore/ShopTiles';
import { GridList } from '@material-ui/core';
import GridList from '@material-ui/core/GridList';
import { type ExampleShortHeader } from '../Utils/GDevelopServices/Example';
import { useResponsiveWindowSize } from '../UI/Responsive/ResponsiveWindowMeasurer';
import { type QuickCustomizationRecommendation } from '../Utils/GDevelopServices/User';
Expand Down

0 comments on commit ed5b165

Please sign in to comment.