Move api client to a hook and allow .env api url config
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { client } from "./api";
|
||||
import { useApi } from "./api";
|
||||
import { useNavigate } from "@remix-run/react";
|
||||
import { createContext, useContext, useEffect, useState } from "react";
|
||||
|
||||
@@ -37,6 +37,8 @@ function useProvideAuth() {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const client = useApi();
|
||||
|
||||
const handleUser = (rawUser: string | null) => {
|
||||
if (rawUser) {
|
||||
setUser(rawUser);
|
||||
|
||||
Reference in New Issue
Block a user