mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #3193 from appwrite/fix-new-console-banner-tablet
fix(console): make the new Console banner responsive and snoozeable
This commit is contained in:
5 files changed
+26
-13
No files matched your search
@@ -90,6 +90,7 @@
|
||||
},
|
||||
"overrides": {
|
||||
"brace-expansion": ">=5.0.9",
|
||||
"browserslist": ">=4.28.7",
|
||||
"cookie": "^0.7.0",
|
||||
"devalue": "^5.8.1",
|
||||
"flatted": "^3.4.2",
|
||||
@@ -642,7 +643,7 @@
|
||||
|
||||
"balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
|
||||
|
||||
"baseline-browser-mapping": ["baseline-browser-mapping@2.10.8", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-PCLz/LXGBsNTErbtB6i5u4eLpHeMfi93aUv5duMmj6caNu6IphS4q6UevDnL36sZQv9lrP11dbPKGMaXPwMKfQ=="],
|
||||
"baseline-browser-mapping": ["baseline-browser-mapping@2.11.20", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw=="],
|
||||
|
||||
"bidi-js": ["bidi-js@1.0.3", "", { "dependencies": { "require-from-string": "^2.0.2" } }, "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw=="],
|
||||
|
||||
@@ -654,7 +655,7 @@
|
||||
|
||||
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
|
||||
|
||||
"browserslist": ["browserslist@4.28.1", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="],
|
||||
"browserslist": ["browserslist@4.28.8", "", { "dependencies": { "baseline-browser-mapping": "^2.11.12", "caniuse-lite": "^1.0.30001809", "electron-to-chromium": "^1.5.402", "node-releases": "^2.0.53", "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA=="],
|
||||
|
||||
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
|
||||
|
||||
@@ -666,7 +667,7 @@
|
||||
|
||||
"camera-controls": ["camera-controls@3.1.2", "", { "peerDependencies": { "three": ">=0.126.1" } }, "sha512-xkxfpG2ECZ6Ww5/9+kf4mfg1VEYAoe9aDSY+IwF0UEs7qEzwy0aVRfs2grImIECs/PoBtWFrh7RXsQkwG922JA=="],
|
||||
|
||||
"caniuse-lite": ["caniuse-lite@1.0.30001779", "", {}, "sha512-U5og2PN7V4DMgF50YPNtnZJGWVLFjjsN3zb6uMT5VGYIewieDj1upwfuVNXf4Kor+89c3iCRJnSzMD5LmTvsfA=="],
|
||||
"caniuse-lite": ["caniuse-lite@1.0.30001810", "", {}, "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg=="],
|
||||
|
||||
"ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="],
|
||||
|
||||
@@ -822,7 +823,7 @@
|
||||
|
||||
"echarts": ["echarts@5.6.0", "", { "dependencies": { "tslib": "2.3.0", "zrender": "5.6.1" } }, "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA=="],
|
||||
|
||||
"electron-to-chromium": ["electron-to-chromium@1.5.313", "", {}, "sha512-QBMrTWEf00GXZmJyx2lbYD45jpI3TUFnNIzJ5BBc8piGUDwMPa1GV6HJWTZVvY/eiN3fSopl7NRbgGp9sZ9LTA=="],
|
||||
"electron-to-chromium": ["electron-to-chromium@1.5.420", "", {}, "sha512-2yD6XreGusOfNV+dUcvipJEXc3n/n7fgr7996aszTG+YY5E4mqM4tOq/3uhP129cazL9YHbVWSpc79ePotWtPA=="],
|
||||
|
||||
"emoji-regex-xs": ["emoji-regex-xs@1.0.0", "", {}, "sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg=="],
|
||||
|
||||
@@ -1138,7 +1139,7 @@
|
||||
|
||||
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
|
||||
|
||||
"node-releases": ["node-releases@2.0.36", "", {}, "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA=="],
|
||||
"node-releases": ["node-releases@2.0.54", "", {}, "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ=="],
|
||||
|
||||
"normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="],
|
||||
|
||||
@@ -1424,7 +1425,7 @@
|
||||
|
||||
"unplugin": ["unplugin@1.0.1", "", { "dependencies": { "acorn": "^8.8.1", "chokidar": "^3.5.3", "webpack-sources": "^3.2.3", "webpack-virtual-modules": "^0.5.0" } }, "sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA=="],
|
||||
|
||||
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
|
||||
"update-browserslist-db": ["update-browserslist-db@1.3.2", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw=="],
|
||||
|
||||
"uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
|
||||
|
||||
|
||||
+2
-1
@@ -113,6 +113,7 @@
|
||||
"cookie": "^0.7.0",
|
||||
"ws": "^8.21.0",
|
||||
"postcss": "^8.5.18",
|
||||
"nanoid": "^3.3.18"
|
||||
"nanoid": "^3.3.18",
|
||||
"browserslist": ">=4.28.7"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,8 @@
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
import { hideNotification } from '$lib/helpers/notifications';
|
||||
import { headerAlert } from '$lib/stores/headerAlert';
|
||||
import { activeHeaderAlert } from '$routes/(console)/store';
|
||||
import GradientBanner from './billing/gradientBanner.svelte';
|
||||
@@ -13,13 +14,18 @@
|
||||
|
||||
function handleClose() {
|
||||
const { id } = $activeHeaderAlert;
|
||||
localStorage.setItem(id, new Date().getTime().toString());
|
||||
|
||||
trackEvent('close_new_console_banner', { source: 'new_console_banner' });
|
||||
|
||||
// Clear the store entry, not just this component. headerAlert.get() picks the highest
|
||||
// importance and breaks ties by registration order, so an entry left visible keeps
|
||||
// winning the importance-1 tie and hides the next eligible promo behind an empty slot.
|
||||
headerAlert.updateShow(id, false);
|
||||
|
||||
// A migration runs for months, so dismissal is a snooze rather than a permanent opt-out:
|
||||
// a week at first, doubling each time. Someone who keeps closing it stops seeing it, but a
|
||||
// single stray click on the X does not remove the message for the whole rollout.
|
||||
hideNotification(id, { coolOffPeriod: 24 * 7, exponentialBackoff: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -28,15 +34,15 @@
|
||||
gap="m"
|
||||
alignItems="center"
|
||||
alignContent="center"
|
||||
direction={$isSmallViewport ? 'column' : 'row'}>
|
||||
<Typography.Text>
|
||||
justifyContent="center"
|
||||
direction={$isTabletViewport ? 'column' : 'row'}>
|
||||
<Typography.Text align={$isTabletViewport ? 'center' : 'start'}>
|
||||
Introducing the new Appwrite Console, rebuilt from the ground up.
|
||||
</Typography.Text>
|
||||
|
||||
<Button
|
||||
secondary
|
||||
external
|
||||
fullWidthMobile
|
||||
class="u-line-height-1"
|
||||
{href}
|
||||
on:click={() => trackEvent('click_new_console', { source: 'new_console_banner' })}>
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
afterNavigate(() => setNavigationHeight());
|
||||
</script>
|
||||
|
||||
<!-- The stack owns the shell offset for every alert inside it, so it has to re-measure when
|
||||
the viewport changes and an alert reflows to a different height. -->
|
||||
<svelte:window on:resize={setNavigationHeight} />
|
||||
|
||||
<div bind:this={container} class="alert-stack">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
import { UsageRates } from '$lib/components/billing';
|
||||
import { canSeeProjects } from '$lib/stores/roles';
|
||||
import { BottomModalAlert, NewConsoleBanner } from '$lib/components';
|
||||
import { shouldShowNotification } from '$lib/helpers/notifications';
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import {
|
||||
IconAnnotation,
|
||||
@@ -328,7 +329,7 @@
|
||||
onMount(() => {
|
||||
// Same shape as newDevUpgradePro: promo tier (importance 1) so it can never outrank a
|
||||
// payment or usage warning, dismissal keyed on the alert id in localStorage.
|
||||
if (isCloud && !localStorage.getItem('newConsoleBanner')) {
|
||||
if (isCloud && shouldShowNotification('newConsoleBanner')) {
|
||||
headerAlert.add({
|
||||
id: 'newConsoleBanner',
|
||||
component: NewConsoleBanner,
|
||||
|
||||
Reference in new issue
Block a user