updated to utopia-ui@3.0.0-alpha.75

This commit is contained in:
Anton Tranelis 2024-02-16 08:10:46 +01:00
parent 3c0481cbfc
commit a10eccd4ee
9 changed files with 1580 additions and 137 deletions

View File

@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/3markers-globe.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-visual" />
<meta name="description" content="Utopia is a cooperative real life manifestation game">
<title>Utopia Game</title>
<meta property="og:title" content="Utopia Game" />

1653
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
@ -16,7 +16,8 @@
"axios": "^1.6.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2"
"react-router-dom": "^6.11.2",
"utopia-ui": "^3.0.0-alpha.75"
},
"devDependencies": {
"@types/react": "^18.0.28",

View File

@ -7,6 +7,3 @@
height: calc(100dvh - 64px);
}
.Toastify__toast-container--top-right {
top: 5em !important;
}

View File

@ -1,4 +1,4 @@
import { AppShell, SideBar, Content, AuthProvider, UserSettings, ProfileSettings, Modal, LoginPage, SignupPage, Quests, RequestPasswordPage, SetNewPasswordPage } from 'utopia-ui'
import { AppShell, SideBar, Content, AuthProvider, Modal, LoginPage, SignupPage, Quests, RequestPasswordPage, SetNewPasswordPage, OverlayProfile, OverlayProfileSettings, OverlayUserSettings } from 'utopia-ui'
import { bottomRoutes, routes } from './routes/sidebar'
import { Route, Routes } from 'react-router-dom'
import MapContainer from "./pages/MapContainer"
@ -9,7 +9,6 @@ import Projects from './pages/Projects'
import { ProjectView } from './pages/ProjectView'
import { assetsApi } from './api/assetsApi'
import { ModalContent } from './ModalContent'
import { ProfileView } from './pages/ProfileView'
function App() {
@ -31,13 +30,13 @@ function App() {
<Route path='signup' element={<SignupPage />}/>
<Route path='reset-password' element={<RequestPasswordPage reset_url="https://utopia-game.org/set-new-password/"/>}/>
<Route path='set-new-password' element={<SetNewPasswordPage />}/>
<Route path="profile/*" element={<OverlayProfile/>} />
<Route path="profile-settings" element={<OverlayProfileSettings/>} />
<Route path="user-settings" element={<OverlayUserSettings />} />
</Route>
<Route path="/settings" element={<UserSettings />} />
<Route path="/profile" element={<ProfileSettings />} />
<Route path="/concept" element={<Concept/>} />
<Route path="/projects" element={<Projects/>} />
<Route path="/projects/*" element={<ProjectView/>} />
<Route path="/profile/*" element={<ProfileView/>} />
</Routes>
</Content>
</AppShell>

View File

@ -28,7 +28,7 @@ export class itemsApi<T> implements ItemsApi<T>{
async getItems() {
try {
return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', { user_created: ['*'] }], filter: this.filter, limit: 500 }));
return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', { user_created: ['*', {offers: ['*'], needs: ['*']}] }], filter: this.filter, limit: 500 }));
} catch (error: any) {
console.log(error);
if (error.errors[0]?.message)

View File

@ -41,7 +41,7 @@ export class userApi implements UserApi {
async getUser(): Promise<any> {
try {
let user = await directusClient.request(readMe());
let user = await directusClient.request(readMe({ fields: ['*', { offers: ['*'], needs: ['*'] }] }));
return user;
} catch (error: any) {
console.log(error);
@ -66,7 +66,7 @@ export class userApi implements UserApi {
async updateUser(user: UserItem): Promise<any> {
const { id, ...userRest } = user;
try {
const res = await directusClient.request(updateMe(userRest))
const res = await directusClient.request(updateMe(userRest,{ fields: ['*', { offers: ['*'], needs: ['*'] }] }))
return res as any;
} catch (error: any) {
console.log(error);

View File

@ -79,12 +79,15 @@ function MapContainer() {
itemTextField='user_created.description'
itemAvatarField='user_created.avatar'
itemColorField='user_created.color'
itemOwnerField="user_created.id"
itemOwnerField="user_created"
itemOffersField='user_created.offers'
itemNeedsField='user_created.needs'
customEditLink='/profile-settings'
onlyOnePerOwner={true}
// data={places}
api={updatesApiInstance}>
<ItemView>
<PopupButton url={'/profile'} parameterField={'user_created.id'} text={'Profile'} colorField={'user_created.color'} />
<PopupButton url={'/profile'} parameterField={'id'} text={'Profile'} colorField={'user_created.color'} />
<TextView truncate></TextView>
</ItemView>
<ItemForm title='Place yor Profile'>

View File

@ -2,43 +2,53 @@ import { Item, Tag } from "utopia-ui/dist/types";
export const tags : Tag[] = [
{
"id": "Activism",
"id": "423423423423",
"name": "Activism",
"color": "#6d398b"
},
{
"id": "Art",
"id": "4234423",
"name": "Art",
"color": "#fdc60b"
},
{
"id": "Community",
"id": "4231223423",
"name": "Community",
"color": "#FFA439"
},
{
"id": "Culture",
{
"id": "429803423423",
"name": "Culture",
"color": "#f18e1c"
},
{
"id": "Education",
"id": "42423423",
"name": "Education",
"color": "#444e99"
},
{
"id": "Gardening",
"id": "4565654423",
"name": "Gardening",
"color": "#008e5b"
},
{
"id": "Healing",
"id": "4234gfh423",
"name": "Healing",
"color": "#c4037d"
},
{
"id": "Market",
"id": "4223423",
"name": "Market",
"color": "#2a71b0"
},
{
"id": "Nature",
"id": "42342gd3423",
"name": "Nature",
"color": "#8cbb26"
},
{
"id": "Technology",
"id": "423123423",
"name": "Technology",
"color": "#0696bb"
}
]