updated to utopia-ui@3.0.0-alpha.8

This commit is contained in:
Anton 2023-09-02 10:25:55 +02:00
parent aa6dcf5223
commit 055b285704
6 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />

8
package-lock.json generated
View File

@ -14,7 +14,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2",
"utopia-ui": "^3.0.0-alpha.6"
"utopia-ui": "^3.0.0-alpha.8"
},
"devDependencies": {
"@types/react": "^18.0.28",
@ -6458,9 +6458,9 @@
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
"node_modules/utopia-ui": {
"version": "3.0.0-alpha.6",
"resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.0-alpha.6.tgz",
"integrity": "sha512-HibKxHWRDvmbdfg7LXjpDlcnIB3UlH4VUthIEyQZSUbHX2AcfUYLNeyJ4dge9ub8iaoO4AgKZqhR2fuqWqgGig==",
"version": "3.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.0-alpha.8.tgz",
"integrity": "sha512-a8w7mJxNPoVcG8GPbQNaIj64Sbj69lWtaxh7W62hpmg/PxgFmmU1pwxuRunUqalEUh3WYMvQIJxzNlHISZyIsg==",
"dependencies": {
"@heroicons/react": "^2.0.17",
"leaflet": "^1.9.4",

View File

@ -16,7 +16,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2",
"utopia-ui": "^3.0.0-alpha.6"
"utopia-ui": "^3.0.0-alpha.8"
},
"devDependencies": {
"@types/react": "^18.0.28",

View File

@ -1,4 +1,4 @@
import { AppShell, SideBar, Content, AuthProvider, useAuth, Settings, Modal, Quests, LoginPage, SignupPage } from 'utopia-ui'
import { AppShell, SideBar, Content, AuthProvider, useAuth, Settings, Modal, LoginPage, SignupPage } from 'utopia-ui'
import { routes } from './routes/sidebar'
import { Route, Routes } from 'react-router-dom'
import MapContainer from "./pages/MapContainer"
@ -20,7 +20,7 @@ function App() {
<Modal/>
<SideBar routes={routes} />
<Content>
<Quests />
{/** <Quests /> */}
<Routes>
<Route path="/" element={<MapContainer />} />
<Route path="/settings" element={<Settings useAuth={useAuth} />} />

View File

@ -54,7 +54,7 @@ export type Place = {
return auth!.refresh_token;
}
export const directusClient = createDirectus<MyCollections>("https://map.api.free-planet-earth.org/")
export const directusClient = createDirectus<MyCollections>("https://api.utopia-lab.org/")
.with(authentication())
.with(rest())
.with(authentication('json', { // add this if you want to use authentication, json is important, it's type of your authentication usage, here JWT

View File

@ -15,10 +15,9 @@ export class itemsApi<T> implements ItemsApi<T>{
async getItems() {
try {
return await directusClient.request(readItems(this.collectionName as never,{limit: 500 }));
} catch (error) {
console.log(error);
throw new Error("Failed while loading items");
}
} catch (error: any) {
console.log(error.errors[0].message);
throw new Error(error.errors[0].message); }
}
async createItem(item: T & { id?: string }) {