Skip to content

Commit 72bf3ce

Browse files
committed
fix(frontend): revalidate routes
Fixes #883
1 parent 622c397 commit 72bf3ce

File tree

6 files changed

+47
-44
lines changed

6 files changed

+47
-44
lines changed

apps/frontend/app/routes/_dashboard.collections.$id._index.tsx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,33 @@ export const loader = unstable_defineLoader(async ({ request, params }) => {
8888
{ input: { collectionId: id, take: 0 } },
8989
await getAuthorizationHeader(request),
9090
);
91-
const { collectionContents: contents } = await gqlClient.request(
92-
CollectionContentsDocument,
93-
{
94-
input: {
95-
collectionId: id,
96-
filter: {
97-
entityType: query.entityLot,
98-
metadataLot: query.metadataLot,
99-
},
100-
sort: { by: query.sortBy, order: query.orderBy },
101-
search: {
102-
page: query.page,
103-
query: query.query,
104-
},
105-
},
106-
},
107-
await getAuthorizationHeader(request),
108-
);
109-
const [coreDetails, userPreferences, userDetails] = await Promise.all([
91+
const [
92+
coreDetails,
93+
userPreferences,
94+
userDetails,
95+
{ collectionContents: contents },
96+
] = await Promise.all([
11097
getCoreDetails(request),
11198
getUserPreferences(request),
11299
getUserDetails(request),
100+
gqlClient.request(
101+
CollectionContentsDocument,
102+
{
103+
input: {
104+
collectionId: id,
105+
filter: {
106+
entityType: query.entityLot,
107+
metadataLot: query.metadataLot,
108+
},
109+
sort: { by: query.sortBy, order: query.orderBy },
110+
search: {
111+
page: query.page,
112+
query: query.query,
113+
},
114+
},
115+
},
116+
await getAuthorizationHeader(request),
117+
),
113118
]);
114119
return {
115120
id,

apps/frontend/app/routes/_dashboard.tsx

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ import {
2020
} from "@mantine/core";
2121
import { upperFirst, useDisclosure, useLocalStorage } from "@mantine/hooks";
2222
import { unstable_defineLoader } from "@remix-run/node";
23-
import {
24-
Form,
25-
Link,
26-
NavLink,
27-
Outlet,
28-
type ShouldRevalidateFunction,
29-
useLoaderData,
30-
} from "@remix-run/react";
23+
import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
3124
import { UserLot } from "@ryot/generated/graphql/backend/graphql";
3225
import { changeCase } from "@ryot/ts-utils";
3326
import {
@@ -163,19 +156,10 @@ export const loader = unstable_defineLoader(async ({ request }) => {
163156
settingsLinks,
164157
shouldHaveUmami,
165158
currentColorScheme,
166-
userPreferences: {
167-
media: userPreferences.featuresEnabled.media,
168-
fitness: userPreferences.featuresEnabled.fitness,
169-
disableNavigationAnimation:
170-
userPreferences.general.disableNavigationAnimation,
171-
collectionsEnabled: userPreferences.featuresEnabled.others.collections,
172-
calendarEnabled: userPreferences.featuresEnabled.others.calendar,
173-
},
159+
userPreferences,
174160
};
175161
});
176162

177-
export const shouldRevalidate: ShouldRevalidateFunction = () => false;
178-
179163
export default function Layout() {
180164
const loaderData = useLoaderData<typeof loader>();
181165
const [parent] = useAutoAnimate();
@@ -230,7 +214,7 @@ export default function Layout() {
230214
toggle={toggle}
231215
setOpened={() => {}}
232216
/>
233-
{loaderData.userPreferences.media.enabled ? (
217+
{loaderData.userPreferences.featuresEnabled.media.enabled ? (
234218
<LinksGroup
235219
label="Media"
236220
icon={IconDeviceSpeaker}
@@ -246,7 +230,7 @@ export default function Layout() {
246230
}
247231
/>
248232
) : undefined}
249-
{loaderData.userPreferences.fitness.enabled ? (
233+
{loaderData.userPreferences.featuresEnabled.fitness.enabled ? (
250234
<LinksGroup
251235
label="Fitness"
252236
icon={IconStretching}
@@ -262,7 +246,7 @@ export default function Layout() {
262246
links={loaderData.fitnessLinks}
263247
/>
264248
) : undefined}
265-
{loaderData.userPreferences.calendarEnabled ? (
249+
{loaderData.userPreferences.featuresEnabled.others.calendar ? (
266250
<LinksGroup
267251
label="Calendar"
268252
icon={IconCalendar}
@@ -272,7 +256,7 @@ export default function Layout() {
272256
setOpened={() => {}}
273257
/>
274258
) : null}
275-
{loaderData.userPreferences.collectionsEnabled ? (
259+
{loaderData.userPreferences.featuresEnabled.others.collections ? (
276260
<LinksGroup
277261
label="Collections"
278262
icon={IconArchive}
@@ -376,7 +360,7 @@ export default function Layout() {
376360
pb={40}
377361
mih="90%"
378362
ref={
379-
loaderData.userPreferences.disableNavigationAnimation
363+
loaderData.userPreferences.general.disableNavigationAnimation
380364
? undefined
381365
: parent
382366
}

apps/landing/src/components/Icon.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { Icon } from "@/config/landing.interface";
33
import GithubIcon from "@/icons/socials/GithubIcon.astro";
44
import TwitterIcon from "@/icons/socials/TwitterIcon.astro";
5+
import DiscordIcon from "@/icons/socials/DiscordIcon.astro";
56
67
interface Props {
78
icon: Icon;
@@ -10,7 +11,7 @@ interface Props {
1011
1112
const { icon, class: className } = Astro.props;
1213
13-
const icons = [GithubIcon, TwitterIcon];
14+
const icons = [GithubIcon, TwitterIcon, DiscordIcon];
1415
1516
const figures: Record<string, (_props: Record<string, unknown>) => unknown> =
1617
{};

apps/landing/src/data/landing.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
],
8585
"socials": [
8686
{ "icon": "TwitterIcon", "href": "https://x.com/IgnisDa" },
87-
{ "icon": "GithubIcon", "href": "https://github.com/IgnisDa/ryot" }
87+
{ "icon": "GithubIcon", "href": "https://github.com/IgnisDa/ryot" },
88+
{ "icon": "DiscordIcon", "href": "https://discord.gg/D9XTg2a7R8" }
8889
]
8990
}
9091
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<svg class="w-8 h-8" fill="currentColor" viewBox="0 0 24 24"
2+
><path
3+
d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"
4+
></path></svg
5+
>

apps/landing/src/sections/Pricing.astro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ const { data } = Astro.props;
1515
<SectionTitle>
1616
{data.title}
1717
</SectionTitle>
18+
<div class="text-center mt-10 md:w-2/3 mx-auto">
19+
<p>
20+
These prices are not final. Discussions are ongoing to arrive at something
21+
users will be happy with. To participate in the discussion, please join
22+
the Discord server.
23+
</p>
24+
</div>
1825
<div
1926
class="my-20 grid grid-cols-1 md:grid-cols-3 gap-y-10 place-items-center"
2027
>

0 commit comments

Comments
 (0)