|
2 | 2 | import { trackEvent } from '$lib/actions/analytics'; |
3 | 3 | import { Button } from '$lib/elements/forms'; |
4 | 4 | import { Layout, Typography } from '@appwrite.io/pink-svelte'; |
5 | | - import { isSmallViewport } from '$lib/stores/viewport'; |
| 5 | + import { isTabletViewport } from '$lib/stores/viewport'; |
| 6 | + import { hideNotification } from '$lib/helpers/notifications'; |
6 | 7 | import { headerAlert } from '$lib/stores/headerAlert'; |
7 | 8 | import { activeHeaderAlert } from '$routes/(console)/store'; |
8 | 9 | import GradientBanner from './billing/gradientBanner.svelte'; |
|
13 | 14 |
|
14 | 15 | function handleClose() { |
15 | 16 | const { id } = $activeHeaderAlert; |
16 | | - localStorage.setItem(id, new Date().getTime().toString()); |
| 17 | +
|
17 | 18 | trackEvent('close_new_console_banner', { source: 'new_console_banner' }); |
18 | 19 |
|
19 | 20 | // Clear the store entry, not just this component. headerAlert.get() picks the highest |
20 | 21 | // importance and breaks ties by registration order, so an entry left visible keeps |
21 | 22 | // winning the importance-1 tie and hides the next eligible promo behind an empty slot. |
22 | 23 | headerAlert.updateShow(id, false); |
| 24 | +
|
| 25 | + // A migration runs for months, so dismissal is a snooze rather than a permanent opt-out: |
| 26 | + // a week at first, doubling each time. Someone who keeps closing it stops seeing it, but a |
| 27 | + // single stray click on the X does not remove the message for the whole rollout. |
| 28 | + hideNotification(id, { coolOffPeriod: 24 * 7, exponentialBackoff: true }); |
23 | 29 | } |
24 | 30 | </script> |
25 | 31 |
|
|
28 | 34 | gap="m" |
29 | 35 | alignItems="center" |
30 | 36 | alignContent="center" |
31 | | - direction={$isSmallViewport ? 'column' : 'row'}> |
32 | | - <Typography.Text> |
| 37 | + justifyContent="center" |
| 38 | + direction={$isTabletViewport ? 'column' : 'row'}> |
| 39 | + <Typography.Text align={$isTabletViewport ? 'center' : 'start'}> |
33 | 40 | Introducing the new Appwrite Console, rebuilt from the ground up. |
34 | 41 | </Typography.Text> |
35 | 42 |
|
36 | 43 | <Button |
37 | 44 | secondary |
38 | 45 | external |
39 | | - fullWidthMobile |
40 | 46 | class="u-line-height-1" |
41 | 47 | {href} |
42 | 48 | on:click={() => trackEvent('click_new_console', { source: 'new_console_banner' })}> |
|
0 commit comments