Skip to content

Commit 98bfc7a

Browse files
Revamp GDevelop Homepage
* New "Get Started" section, to guide newcomers on where to start with GDevelop * New "Build" section, the entry point for your projects * New "Learn" section, the entry point to tutorials and future help tools * New "Play" section, the entry point for all games created with GDevelop * New "Community" section, the entry point to stay informed with the GDevelop world
1 parent cef3522 commit 98bfc7a

File tree

102 files changed

+2185
-1072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2185
-1072
lines changed
124 KB
Loading
61.9 KB
Loading
1.42 KB
Loading
41.6 KB
Loading

newIDE/app/src/AssetStore/AssetDetails.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const AssetDetails = ({
217217
<Line justifyContent="space-between" noMargin>
218218
<Column>
219219
<Line alignItems="baseline" noMargin>
220-
<Text size="title" displayInlineAsSpan>
220+
<Text size="block-title" displayInlineAsSpan>
221221
{assetShortHeader.name}
222222
</Text>
223223
<Spacer />
@@ -234,6 +234,7 @@ export const AssetDetails = ({
234234
Window.openExternalURL(author.website);
235235
event.preventDefault();
236236
}}
237+
color="secondary"
237238
>
238239
{author.name}
239240
</Link>
@@ -426,6 +427,7 @@ export const AssetDetails = ({
426427
Window.openExternalURL(assetLicense.website);
427428
event.preventDefault();
428429
}}
430+
color="secondary"
429431
>
430432
{assetLicense.name}
431433
</Link>
@@ -450,7 +452,7 @@ export const AssetDetails = ({
450452
{asset && (
451453
<Column expand>
452454
<Line noMargin>
453-
<Text size="title" displayInlineAsSpan>
455+
<Text size="block-title" displayInlineAsSpan>
454456
<Trans>You might like</Trans>
455457
</Text>
456458
</Line>

newIDE/app/src/AssetStore/ExampleStore/ExampleDialog.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ export function ExampleDialog({
136136
)}
137137
<Line alignItems="center" noMargin>
138138
{hasIcon ? (
139-
<ExampleIcon exampleShortHeader={exampleShortHeader} size={40} />
139+
<ExampleIcon
140+
exampleShortHeader={exampleShortHeader}
141+
type="thumbnail"
142+
/>
140143
) : null}
141144
<Column expand noMargin={!hasIcon}>
142-
<Text noMargin size="title">
145+
<Text noMargin size="block-title">
143146
{exampleShortHeader.name}
144147
</Text>
145148
</Column>

newIDE/app/src/AssetStore/ExampleStore/ExampleIcon.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,36 @@ const styles = {
1616
},
1717
};
1818

19+
const ICON_SIZES = {
20+
preview: 120,
21+
thumbnail: 40,
22+
};
23+
1924
type Props = {|
2025
exampleShortHeader: ExampleShortHeader,
21-
size: number,
26+
type: 'thumbnail' | 'preview',
2227
|};
2328

24-
export const ExampleIcon = ({ exampleShortHeader, size }: Props) => {
29+
export const ExampleIcon = ({ exampleShortHeader, type }: Props) => {
30+
const size = type === 'thumbnail' ? ICON_SIZES.thumbnail : ICON_SIZES.preview;
31+
let iconUrl = exampleShortHeader.previewImageUrls[0];
32+
if (type === 'thumbnail') {
33+
const thumbnailUrl = exampleShortHeader.previewImageUrls.find(url =>
34+
url.endsWith('thumbnail.png')
35+
);
36+
if (thumbnailUrl) iconUrl = thumbnailUrl;
37+
}
38+
if (type === 'preview') {
39+
const previewUrl = exampleShortHeader.previewImageUrls.find(url =>
40+
url.endsWith('preview.png')
41+
);
42+
if (previewUrl) iconUrl = previewUrl;
43+
}
2544
return (
2645
<div style={styles.iconBackground}>
2746
<CorsAwareImage
2847
style={{ ...styles.icon, height: size }}
29-
src={
30-
exampleShortHeader.previewImageUrls.find(url =>
31-
url.endsWith('thumbnail.png')
32-
) || exampleShortHeader.previewImageUrls[0]
33-
}
48+
src={iconUrl}
3449
alt={exampleShortHeader.name}
3550
/>
3651
</div>

newIDE/app/src/AssetStore/ExampleStore/ExampleListItem.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ export const ExampleListItem = ({
103103
<Line noMargin expand>
104104
<ButtonBase style={styles.button} onClick={onChoose} focusRipple>
105105
{!!exampleShortHeader.previewImageUrls.length && (
106-
<ExampleIcon exampleShortHeader={exampleShortHeader} size={64} />
106+
<ExampleIcon
107+
exampleShortHeader={exampleShortHeader}
108+
type="preview"
109+
/>
107110
)}
108111
<Column expand>
109112
<Text noMargin>{renderExampleField('name')} </Text>

newIDE/app/src/AssetStore/ExampleStore/ExampleStoreContext.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export const ExampleStoreStateProvider = ({
135135
chosenFilters,
136136
excludedTiers,
137137
defaultFirstSearchItemIds: firstExampleIds,
138+
shuffleResults: false,
138139
});
139140

140141
const exampleStoreState = React.useMemo(

newIDE/app/src/AssetStore/ExampleStore/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@ import { type SearchMatch } from '../../UI/Search/UseSearchStructuredItem';
1515
import { sendExampleDetailsOpened } from '../../Utils/Analytics/EventSender';
1616
import { t } from '@lingui/macro';
1717

18+
// When showing examples, always put the starters first.
19+
const prepareExamples = (examples: Array<ExampleShortHeader>) =>
20+
examples.sort((example1, example2) =>
21+
example1.tags.includes('Starter') && !example2.tags.includes('Starter')
22+
? 1
23+
: 0
24+
);
25+
26+
const getExampleName = (exampleShortHeader: ExampleShortHeader) =>
27+
exampleShortHeader.name;
28+
1829
type Props = {|
1930
isOpening: boolean,
2031
onOpen: ExampleShortHeader => Promise<void>,
2132
focusOnMount?: boolean,
2233
|};
2334

24-
const getExampleName = (exampleShortHeader: ExampleShortHeader) =>
25-
exampleShortHeader.name;
26-
2735
export const ExampleStore = ({ isOpening, onOpen, focusOnMount }: Props) => {
2836
const [
2937
selectedExampleShortHeader,
@@ -106,7 +114,8 @@ export const ExampleStore = ({ isOpening, onOpen, focusOnMount }: Props) => {
106114
onRetry={fetchExamplesAndFilters}
107115
error={error}
108116
searchItems={
109-
searchResults && searchResults.map(({ item }) => item)
117+
searchResults &&
118+
prepareExamples(searchResults.map(({ item }) => item))
110119
}
111120
getSearchItemUniqueId={getExampleName}
112121
renderSearchItem={(exampleShortHeader, onHeightComputed) => (

0 commit comments

Comments
 (0)