Skip to content

Commit ffd5862

Browse files
authored
Merge pull request #2077 from appwrite/multiple-promos
2 parents 51f2c9d + 67be453 commit ffd5862

File tree

4 files changed

+38
-17
lines changed

4 files changed

+38
-17
lines changed

src/lib/components/bottomModalAlert.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
<button
209209
aria-label="Previous"
210210
class="icon-cheveron-left"
211+
style:cursor={currentIndex !== 0 ? 'pointer' : undefined}
211212
on:click={showPrevious}
212213
disabled={currentIndex === 0}
213214
class:active={currentIndex > 0}></button>
@@ -216,6 +217,10 @@
216217
aria-label="Next"
217218
class="icon-cheveron-right"
218219
on:click={showNext}
220+
style:cursor={currentIndex !==
221+
filteredModalAlerts.length - 1
222+
? 'pointer'
223+
: undefined}
219224
disabled={currentIndex === filteredModalAlerts.length - 1}
220225
class:active={currentIndex !==
221226
filteredModalAlerts.length - 1}></button>
@@ -314,6 +319,9 @@
314319
<button
315320
aria-label="Previous"
316321
class="icon-cheveron-left"
322+
style:cursor={currentIndex !== 0
323+
? 'pointer'
324+
: undefined}
317325
on:click={showPrevious}
318326
disabled={currentIndex === 0}
319327
class:active={currentIndex > 0}></button>
@@ -322,6 +330,10 @@
322330
aria-label="Next"
323331
class="icon-cheveron-right"
324332
on:click={showNext}
333+
style:cursor={currentIndex !==
334+
filteredModalAlerts.length - 1
335+
? 'pointer'
336+
: undefined}
325337
disabled={currentIndex ===
326338
filteredModalAlerts.length - 1}
327339
class:active={currentIndex !==
371 KB
Loading
181 KB
Loading

src/routes/(console)/bottomAlerts.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
import { isCloud } from '$lib/system';
22
import { isSameDay } from '$lib/helpers/date';
3-
import {
4-
type BottomModalAlertItem,
5-
showBottomModalAlert,
6-
setMobileSingleAlertLayout
7-
} from '$lib/stores/bottom-alerts';
3+
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
84

95
import BulkApiDark from '$lib/images/promos/bulk-api-dark.png';
106
import BulkApiLight from '$lib/images/promos/bulk-api-light.png';
117

8+
import CSVImportDark from '$lib/images/promos/csv-import-placeholder-dark.png';
9+
import CSVImportLight from '$lib/images/promos/csv-import-placeholder-light.png';
10+
1211
const listOfPromotions: BottomModalAlertItem[] = [];
1312

1413
if (isCloud) {
14+
const csvImportPromo: BottomModalAlertItem = {
15+
id: 'modal:csv_import_announcement',
16+
src: {
17+
dark: CSVImportDark,
18+
light: CSVImportLight
19+
},
20+
title: 'Introducing CSV import',
21+
message:
22+
"We're introducing a new way to populate your Appwrite databases: document imports from CSV files.",
23+
plan: 'free',
24+
importance: 8,
25+
scope: 'everywhere',
26+
cta: {
27+
text: 'Read announcement',
28+
link: () => 'https://appwrite.io/blog/post/announcing-csv-imports',
29+
external: true,
30+
hideOnClick: true
31+
},
32+
show: true
33+
};
34+
1535
const bulkApiPromo: BottomModalAlertItem = {
1636
id: 'modal:bulk_api_announcement',
1737
src: {
@@ -33,18 +53,7 @@ if (isCloud) {
3353
show: true
3454
};
3555

36-
listOfPromotions.push(bulkApiPromo);
37-
38-
setMobileSingleAlertLayout({
39-
title: bulkApiPromo.title,
40-
message: bulkApiPromo.message,
41-
enabled: true,
42-
cta: {
43-
link: bulkApiPromo.cta.link,
44-
external: bulkApiPromo.cta.external,
45-
hideOnClick: bulkApiPromo.cta.hideOnClick
46-
}
47-
});
56+
listOfPromotions.push(bulkApiPromo, csvImportPromo);
4857
}
4958

5059
export function addBottomModalAlerts() {

0 commit comments

Comments
 (0)