Skip to content

Commit

Permalink
refactor: update ThemeToggle import paths and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
typeWolffo committed Jul 19, 2024
1 parent 070b41a commit 49e48ee
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 21 deletions.
3 changes: 3 additions & 0 deletions examples/common_nestjs_remix/apps/web/app/api/api-client.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useAuthStore } from "~/modules/Auth/authStore";
import { API } from "./generated-api";

export const ApiClient = new API({
Expand All @@ -9,10 +10,12 @@ export const ApiClient = new API({
ApiClient.instance.interceptors.response.use(
(response) => response,
async (error) => {
const isLoggedIn = useAuthStore.getState().isLoggedIn;
const originalRequest = error.config;

if (error.response?.status === 401 && !originalRequest._retry) {
originalRequest._retry = true;
if (!isLoggedIn) return;

try {
await ApiClient.auth.authControllerRefreshTokens();
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions examples/common_nestjs_remix/apps/web/app/components/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "~/components/ui/dropdown-menu";
import { useAuthEffect } from "../Auth/authEffect";
import { authGuard } from "../Auth/authGuard";
import { ThemeToggle } from "~/components";
import ThemeToggle from "~/components/ThemeToggle/ThemeToggle";

export function clientLoader() {
return authGuard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import {
navigationMenuTriggerStyle,
} from "~/components/ui/navigation-menu";
import { useLandingStore } from "./landingStore";
import { ThemeToggle } from "~/components";
import ThemeToggle from "~/components/ThemeToggle/ThemeToggle";

export default function LandingLayout() {
const { setIsSheetOpen } = useLandingStore();
const setIsSheetOpen = useLandingStore((state) => state.setIsSheetOpen);

return (
<main className="p-4 relative">
<Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { MetaFunction } from "@remix-run/node";
import { Link, useLoaderData } from "@remix-run/react";
import { SheetMenu } from "~/components";
import SheetMenu from "~/components/SheetMenu/SheetMenu";
import { useLandingStore } from "~/modules/Landing/landingStore";

export const meta: MetaFunction = () => {
Expand Down
13 changes: 0 additions & 13 deletions examples/common_nestjs_remix/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 49e48ee

Please sign in to comment.