mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
updated to utopia-ui@3.0.0-alpha.75
This commit is contained in:
parent
3c0481cbfc
commit
a10eccd4ee
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/3markers-globe.svg" />
|
<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">
|
<meta name="description" content="Utopia is a cooperative real life manifestation game">
|
||||||
<title>Utopia Game</title>
|
<title>Utopia Game</title>
|
||||||
<meta property="og:title" content="Utopia Game" />
|
<meta property="og:title" content="Utopia Game" />
|
||||||
|
|||||||
1653
package-lock.json
generated
1653
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite --host",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
@ -16,7 +16,8 @@
|
|||||||
"axios": "^1.6.5",
|
"axios": "^1.6.5",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^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": {
|
"devDependencies": {
|
||||||
"@types/react": "^18.0.28",
|
"@types/react": "^18.0.28",
|
||||||
|
|||||||
@ -7,6 +7,3 @@
|
|||||||
height: calc(100dvh - 64px);
|
height: calc(100dvh - 64px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.Toastify__toast-container--top-right {
|
|
||||||
top: 5em !important;
|
|
||||||
}
|
|
||||||
@ -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 { bottomRoutes, routes } from './routes/sidebar'
|
||||||
import { Route, Routes } from 'react-router-dom'
|
import { Route, Routes } from 'react-router-dom'
|
||||||
import MapContainer from "./pages/MapContainer"
|
import MapContainer from "./pages/MapContainer"
|
||||||
@ -9,7 +9,6 @@ import Projects from './pages/Projects'
|
|||||||
import { ProjectView } from './pages/ProjectView'
|
import { ProjectView } from './pages/ProjectView'
|
||||||
import { assetsApi } from './api/assetsApi'
|
import { assetsApi } from './api/assetsApi'
|
||||||
import { ModalContent } from './ModalContent'
|
import { ModalContent } from './ModalContent'
|
||||||
import { ProfileView } from './pages/ProfileView'
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
@ -31,13 +30,13 @@ function App() {
|
|||||||
<Route path='signup' element={<SignupPage />}/>
|
<Route path='signup' element={<SignupPage />}/>
|
||||||
<Route path='reset-password' element={<RequestPasswordPage reset_url="https://utopia-game.org/set-new-password/"/>}/>
|
<Route path='reset-password' element={<RequestPasswordPage reset_url="https://utopia-game.org/set-new-password/"/>}/>
|
||||||
<Route path='set-new-password' element={<SetNewPasswordPage />}/>
|
<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>
|
||||||
<Route path="/settings" element={<UserSettings />} />
|
|
||||||
<Route path="/profile" element={<ProfileSettings />} />
|
|
||||||
<Route path="/concept" element={<Concept/>} />
|
<Route path="/concept" element={<Concept/>} />
|
||||||
<Route path="/projects" element={<Projects/>} />
|
<Route path="/projects" element={<Projects/>} />
|
||||||
<Route path="/projects/*" element={<ProjectView/>} />
|
<Route path="/projects/*" element={<ProjectView/>} />
|
||||||
<Route path="/profile/*" element={<ProfileView/>} />
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</Content>
|
</Content>
|
||||||
</AppShell>
|
</AppShell>
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export class itemsApi<T> implements ItemsApi<T>{
|
|||||||
|
|
||||||
async getItems() {
|
async getItems() {
|
||||||
try {
|
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) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if (error.errors[0]?.message)
|
if (error.errors[0]?.message)
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class userApi implements UserApi {
|
|||||||
|
|
||||||
async getUser(): Promise<any> {
|
async getUser(): Promise<any> {
|
||||||
try {
|
try {
|
||||||
let user = await directusClient.request(readMe());
|
let user = await directusClient.request(readMe({ fields: ['*', { offers: ['*'], needs: ['*'] }] }));
|
||||||
return user;
|
return user;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -66,7 +66,7 @@ export class userApi implements UserApi {
|
|||||||
async updateUser(user: UserItem): Promise<any> {
|
async updateUser(user: UserItem): Promise<any> {
|
||||||
const { id, ...userRest } = user;
|
const { id, ...userRest } = user;
|
||||||
try {
|
try {
|
||||||
const res = await directusClient.request(updateMe(userRest))
|
const res = await directusClient.request(updateMe(userRest,{ fields: ['*', { offers: ['*'], needs: ['*'] }] }))
|
||||||
return res as any;
|
return res as any;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
@ -79,12 +79,15 @@ function MapContainer() {
|
|||||||
itemTextField='user_created.description'
|
itemTextField='user_created.description'
|
||||||
itemAvatarField='user_created.avatar'
|
itemAvatarField='user_created.avatar'
|
||||||
itemColorField='user_created.color'
|
itemColorField='user_created.color'
|
||||||
itemOwnerField="user_created.id"
|
itemOwnerField="user_created"
|
||||||
|
itemOffersField='user_created.offers'
|
||||||
|
itemNeedsField='user_created.needs'
|
||||||
|
customEditLink='/profile-settings'
|
||||||
onlyOnePerOwner={true}
|
onlyOnePerOwner={true}
|
||||||
// data={places}
|
// data={places}
|
||||||
api={updatesApiInstance}>
|
api={updatesApiInstance}>
|
||||||
<ItemView>
|
<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>
|
<TextView truncate></TextView>
|
||||||
</ItemView>
|
</ItemView>
|
||||||
<ItemForm title='Place yor Profile'>
|
<ItemForm title='Place yor Profile'>
|
||||||
|
|||||||
@ -2,43 +2,53 @@ import { Item, Tag } from "utopia-ui/dist/types";
|
|||||||
|
|
||||||
export const tags : Tag[] = [
|
export const tags : Tag[] = [
|
||||||
{
|
{
|
||||||
"id": "Activism",
|
"id": "423423423423",
|
||||||
|
"name": "Activism",
|
||||||
"color": "#6d398b"
|
"color": "#6d398b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Art",
|
"id": "4234423",
|
||||||
|
"name": "Art",
|
||||||
"color": "#fdc60b"
|
"color": "#fdc60b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Community",
|
"id": "4231223423",
|
||||||
|
"name": "Community",
|
||||||
"color": "#FFA439"
|
"color": "#FFA439"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Culture",
|
"id": "429803423423",
|
||||||
|
"name": "Culture",
|
||||||
"color": "#f18e1c"
|
"color": "#f18e1c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Education",
|
"id": "42423423",
|
||||||
|
"name": "Education",
|
||||||
"color": "#444e99"
|
"color": "#444e99"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Gardening",
|
"id": "4565654423",
|
||||||
|
"name": "Gardening",
|
||||||
"color": "#008e5b"
|
"color": "#008e5b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Healing",
|
"id": "4234gfh423",
|
||||||
|
"name": "Healing",
|
||||||
"color": "#c4037d"
|
"color": "#c4037d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Market",
|
"id": "4223423",
|
||||||
|
"name": "Market",
|
||||||
"color": "#2a71b0"
|
"color": "#2a71b0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Nature",
|
"id": "42342gd3423",
|
||||||
|
"name": "Nature",
|
||||||
"color": "#8cbb26"
|
"color": "#8cbb26"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Technology",
|
"id": "423123423",
|
||||||
|
"name": "Technology",
|
||||||
"color": "#0696bb"
|
"color": "#0696bb"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user