Skip to content

Commit

Permalink
Merge pull request #331 from WelcometoMyGarden/fix/home-nav-bug
Browse files Browse the repository at this point in the history
Fix/home nav bug (2nd try)
  • Loading branch information
th0rgall authored Jul 26, 2023
2 parents 797db27 + a42534e commit 5f16bfc
Show file tree
Hide file tree
Showing 29 changed files with 804 additions and 378 deletions.
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@google-cloud/firestore": "^6.4.1",
"@sendgrid/client": "^7.7.0",
"@sendgrid/mail": "^7.1.1",
"firebase-admin": "^11.7.0",
"firebase-functions": "^4.3.1",
"firebase-admin": "^11.9.0",
"firebase-functions": "^4.4.1",
"json2csv": "^5.0.6",
"lodash.groupby": "^4.6.0",
"node-fetch": "^2",
Expand Down
30 changes: 15 additions & 15 deletions api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1414,15 +1414,15 @@ __metadata:
languageName: node
linkType: hard

"@google-cloud/firestore@npm:^6.5.0":
version: 6.5.0
resolution: "@google-cloud/firestore@npm:6.5.0"
"@google-cloud/firestore@npm:^6.6.0":
version: 6.6.1
resolution: "@google-cloud/firestore@npm:6.6.1"
dependencies:
fast-deep-equal: ^3.1.1
functional-red-black-tree: ^1.0.1
google-gax: ^3.5.7
protobufjs: ^7.0.0
checksum: dd9cf4eee263a976239232143d5caf213c34850a352c6b6cb15b7b17cfddc2c6bee5e72eed0d188f4317eb5cb6a898372d02c54be8a30bbdc7ffbd360e138cb7
checksum: 9f3838e07d74da34ba4cf322efd3f82e3b8f5b330ae01c0e51d717aacafe2a84caa2869989bbff87fe020086f5b8591baaaf8c643dc93c20fd3f6f2adfd67a24
languageName: node
linkType: hard

Expand Down Expand Up @@ -3103,14 +3103,14 @@ __metadata:
languageName: node
linkType: hard

"firebase-admin@npm:^11.7.0":
version: 11.7.0
resolution: "firebase-admin@npm:11.7.0"
"firebase-admin@npm:^11.9.0":
version: 11.9.0
resolution: "firebase-admin@npm:11.9.0"
dependencies:
"@fastify/busboy": ^1.2.1
"@firebase/database-compat": ^0.3.4
"@firebase/database-types": ^0.10.4
"@google-cloud/firestore": ^6.5.0
"@google-cloud/firestore": ^6.6.0
"@google-cloud/storage": ^6.9.5
"@types/node": ">=12.12.47"
jsonwebtoken: ^9.0.0
Expand All @@ -3122,7 +3122,7 @@ __metadata:
optional: true
"@google-cloud/storage":
optional: true
checksum: 796c7f80eeeaadb6fe9e31b942de99aaab926f5dd0b5eb7ba650c24c3bc6da3ff1f031976e99ecc9ae886f619c0d317345dd20b95c9041feb85c73112636feaa
checksum: c07ec5e9fb4242df904941d9def5bfca0633e6a2378d87a4857fff0d2349252c0f0fdaaa37221c327366a9284f3b44260d18ae94cefa202fbf514d680ccf4da4
languageName: node
linkType: hard

Expand All @@ -3141,9 +3141,9 @@ __metadata:
languageName: node
linkType: hard

"firebase-functions@npm:^4.3.1":
version: 4.3.1
resolution: "firebase-functions@npm:4.3.1"
"firebase-functions@npm:^4.4.1":
version: 4.4.1
resolution: "firebase-functions@npm:4.4.1"
dependencies:
"@types/cors": ^2.8.5
"@types/express": 4.17.3
Expand All @@ -3155,7 +3155,7 @@ __metadata:
firebase-admin: ^10.0.0 || ^11.0.0
bin:
firebase-functions: lib/bin/firebase-functions.js
checksum: 813ff6b43a00f65678f8e34160627a06de37bbf93f3f1d9f95be53d615aa341892449fd227acf7afebba3dfdd6dac136b27e31f5679c61c77ec834c009197a2c
checksum: 27e912228b7604de860abae071083af9531ef90ff5f14d3ff5559f1d8cc375d8ef77c85b65cb85ac2486a1f2fe61768172c8c8b21994bff3a05370646bfe46a0
languageName: node
linkType: hard

Expand Down Expand Up @@ -3265,8 +3265,8 @@ __metadata:
eslint-config-prettier: ^8.5.0
eslint-plugin-import: ^2.22.1
eslint-plugin-prettier: ^4.2.1
firebase-admin: ^11.7.0
firebase-functions: ^4.3.1
firebase-admin: ^11.9.0
firebase-functions: ^4.4.1
firebase-functions-test: ^3.0.0
json2csv: ^5.0.6
lodash.groupby: ^4.6.0
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@firebase/rules-unit-testing": "^2.0.5",
"@playwright/test": "^1.29.2",
"@stripe/stripe-js": "^1.46.0",
"@sveltejs/adapter-static": "^1.0.0-next.48",
"@sveltejs/kit": "^1.0.11",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.22.3",
"@tmcw/togeojson": "^5.5.0",
"@turf/turf": "^6.5.0",
"@types/lodash-es": "^4.17.7",
Expand All @@ -53,19 +53,19 @@
"maplibre-gl": "^1",
"nprogress": "^0.2.0",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"prettier-plugin-svelte": "^2.10.1",
"smoothscroll-polyfill": "^0.4.4",
"svelte": "^3.55.0",
"svelte-check": "^3.0.1",
"svelte-i18n": "^3.3.9",
"svelte-preprocess": "^5.0.0",
"svelte": "^4.1.1",
"svelte-check": "^3.4.6",
"svelte-i18n": "^3.7.0",
"svelte-preprocess": "^5.0.4",
"svelte-stripe": "^0.0.21",
"svg-inline-loader": "^0.8.2",
"tslib": "^2.3.1",
"typescript": "^4.9.4",
"vite": "^4.0.4",
"typescript": "^5.0.0",
"vite": "^4.4.7",
"vite-bundle-visualizer": "0.6.0",
"vitest": "^0.28.2"
"vitest": "^0.33.0"
},
"type": "module",
"packageManager": "yarn@3.5.0"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { page } from '$app/stores';
import { isActiveContains } from '../util/isActive';
import type { Garden } from '../types/Garden';
import type { User as FirebaseUser } from 'firebase/auth';
import trackEvent from '$lib/util/track-event';
import { trackEvent } from '$lib/util';
import { PlausibleEvent } from '$lib/types/Plausible';

// These are not Svelte stores, because we do not wish to listen to updates on them.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { doc, DocumentReference, getDoc, updateDoc } from 'firebase/firestore';
import { db } from './firebase';

import { getUser } from '$lib/stores/auth';
import trackEvent from '$lib/util/track-event';
import { trackEvent } from '$lib/util';
import { PlausibleEvent } from '$lib/types/Plausible';
import type { UserPublic } from '$lib/models/User';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import WtmgLogo from './UI/WTMGLogo.svelte';
import PaddedSection from '$routes/(marketing)/_components/PaddedSection.svelte';
import { user } from '$lib/stores/auth';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
const donationUrlParams = new URLSearchParams({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Garden/Filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
waterIcon,
tentIcon
} from '$lib/images/icons';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let filteredGardens;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Garden/FilterLocation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { clickOutside } from '$lib/directives';
import { TextInput } from '$lib/components/UI';
import { markerIcon } from '$lib/images/icons';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let isSearching;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Garden/GardenDrawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import routes from '$lib/routes';
import type { Garden } from '$lib/types/Garden';
import Icon from '$lib/components/UI/Icon.svelte';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
import { anchorText } from '$lib/util/translation-helpers';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/LayersAndTools/GardensTools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { _ } from 'svelte-i18n';
import { LabeledRadioButton } from '$lib/components/UI';
import { bookmarkEmptyIcon, hideIcon, tentIcon } from '$lib/images/icons';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let showGardens: boolean;
export let showSavedGardens: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/LayersAndTools/LayersAndTools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import TransportModal from '$lib/components/LayersAndTools/TransportModal.svelte';
import TrailsTool from '$lib/components/LayersAndTools/TrailsTool.svelte';
import TransportTools from '$lib/components/LayersAndTools/TransportTools.svelte';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let showHiking = false;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Map/FileTrailModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { cleanName } from '$lib/util/slugify';
import { humanFileSize } from '$lib/util/humanFileSize';
import notification from '$lib/stores/notification';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let show = false;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Nav/Mobile/MobileNav/SideDrawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import NewBadge from '../../NewBadge.svelte';
import { anchorText } from '$lib/util/translation-helpers';
import { PlausibleEvent } from '$lib/types/Plausible';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
const dispatch = createEventDispatcher();
export let isOpen = false;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Nav/Top/TopNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import NewBadge from '../NewBadge.svelte';
import { anchorText } from '$lib/util/translation-helpers';
import { PlausibleEvent } from '$lib/types/Plausible';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
$: firstName = $user ? $user.firstName : '';
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/UI/Anchor.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { createEventDispatcher } from 'svelte';
export let href: string;
Expand Down
1 change: 1 addition & 0 deletions src/lib/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export { parse, pick } from './accept-language-parser';
export { slugify } from './slugify';
export { default as getFileExtension } from './getFileExtension';
export { default as fetchFrom } from './fetchFrom';
export { default as trackEvent } from './track-plausible';
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// NOTE: the filename of this file used to be "track-event.ts", but in some @sveltejs/kit@>1.0.0 version,
// this started bundling to /_app/immutable/chunks/track-event.edc71b85.js (or similar), which is blocked by the EasyPrivacy rule "/track-event.":
// https://github.com/easylist/easylist/blob/55a90a03050c5a278c1497d8443143dfd3d8810f/easyprivacy/easyprivacy_general.txt#L3150
// Previously, the chuck would have been named /track-event-edc71b85.js, which doesn't match the rule due to the '-' instead of the '.'
//
// Do not name it track-event again.
import { dev } from '$app/environment';
import { user } from '$lib/stores/auth';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/translation-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type MessageFormatter = Flatten<typeof _>;
import { UTM_MEMBERSHIP_CAMPAIGN, WTMG_BLOG_BASE_URL } from '$lib/constants';
import createUrl from './create-url';
import { goto } from './navigate';
import trackEvent from './track-event';
import trackEvent from './track-plausible';

if (window) {
// This function is referenced below in the inline onclick handler.
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(marketing)/(home)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { user } from '$lib/stores/auth';
import createUrl from '$lib/util/create-url';
import { goto } from '$lib/util/navigate';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
const contentOf = (quoteNumber: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
PlausibleEvent,
type PlausiblePricingSectionSourceProperties
} from '$lib/types/Plausible';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import createUrl from '$lib/util/create-url';
/**
Expand Down
2 changes: 1 addition & 1 deletion src/routes/account/AccountDeletionModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getUser } from '$lib/stores/auth';
import { auth } from '$lib/api/firebase';
import isFirebaseError from '$lib/util/types/isFirebaseError';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
export let show = false;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/chat/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { onDestroy } from 'svelte';
import nProgress from 'nprogress';
import type { LocalChat } from '$lib/types/Chat';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
import createUrl from '$lib/util/create-url';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/chat/[name]/[chatId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import routes from '$lib/routes';
import { formatDate } from '$lib/util';
import chevronRight from '$lib/images/icons/chevron-right.svg';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
import type { LocalChat } from '$lib/types/Chat';
import MembershipModal from '$routes/(marketing)/(membership)/MembershipModal.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/explore/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import { savedGardens as savedGardenStore } from '$lib/stores/savedGardens';
import TrainconnectionsLayer from '$lib/components/Map/TrainconnectionsLayer.svelte';
import TrainAndRails from '$lib/components/Map/TrainAndRails.svelte';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
import { setExpiringCookie } from '$lib/util/set-cookie';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/garden/add/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Form from '$lib/components/Garden/Form.svelte';
import routes from '$lib/routes';
import type { Garden } from '$lib/types/Garden';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
if ($user && $user.garden) goto(routes.MANAGE_GARDEN);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/garden/manage/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Form from '$lib/components/Garden/Form.svelte';
import routes from '$lib/routes';
import { checkAndHandleUnverified } from '$lib/api/auth';
import trackEvent from '$lib/util/track-event';
import trackEvent from '$lib/util/track-plausible';
import { PlausibleEvent } from '$lib/types/Plausible';
if (!$user) {
Expand Down
7 changes: 5 additions & 2 deletions src/routes/request-password-reset/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
isSending = false;
}
};
// Coordinate the transition duration to prevent both stages to be visible at the same time.
// See below.
const transitionDuration = 300;
</script>

<svelte:head>
Expand All @@ -34,7 +37,7 @@
<div slot="form">
{#if !done}
<p class="description">{$_('request-password-reset.description')}</p>
<form transition:fade on:submit|preventDefault={submit}>
<form transition:fade={{duration: transitionDuration}} on:submit|preventDefault={submit}>
<div>
<label for="email">{$_('generics.email')}</label>
<TextInput
Expand All @@ -53,7 +56,7 @@
</div>
</form>
{:else}
<div transition:fade>
<div in:fade={{delay: transitionDuration}}>
<p>{$_('request-password-reset.set', { values: { email: $formEmailValue } })}</p>
<p>
{@html $_('request-password-reset.trouble', {
Expand Down
6 changes: 4 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-static'; // https://www.npmjs.com/package/@sveltejs/adapter-static
// https://kit.svelte.dev/docs/adapter-static
import adapter from '@sveltejs/adapter-static';

import preprocess from 'svelte-preprocess';

Expand All @@ -16,7 +17,8 @@ const config = {
},
adapter: adapter({
pages: 'dist',
assets: 'dist'
assets: 'dist',
fallback: 'index.html'
}),

prerender: {
Expand Down
Loading

0 comments on commit 5f16bfc

Please sign in to comment.