mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-04-06 01:25:33 +00:00
added external profile url
This commit is contained in:
parent
2baabe7940
commit
db3535b698
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
||||||
/* eslint-disable import/no-relative-parent-imports */
|
/* eslint-disable import/no-relative-parent-imports */
|
||||||
/* eslint-disable array-callback-return */
|
/* eslint-disable array-callback-return */
|
||||||
/* eslint-disable new-cap */
|
/* eslint-disable new-cap */
|
||||||
@ -47,7 +47,7 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
|
|||||||
setApis((current) => [
|
setApis((current) => [
|
||||||
...current,
|
...current,
|
||||||
{
|
{
|
||||||
id: layer.id!,
|
id: layer.id,
|
||||||
api: new itemsApi<Place>('items', layer.id, undefined, {
|
api: new itemsApi<Place>('items', layer.id, undefined, {
|
||||||
_or: [
|
_or: [
|
||||||
{
|
{
|
||||||
@ -115,7 +115,11 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
|
|||||||
<PopupView>
|
<PopupView>
|
||||||
{layer.itemType.show_start_end && <StartEndView></StartEndView>}
|
{layer.itemType.show_start_end && <StartEndView></StartEndView>}
|
||||||
{layer.itemType.show_profile_button && (
|
{layer.itemType.show_profile_button && (
|
||||||
<PopupButton url={'/item'} parameterField={'id'} text={'Profile'} />
|
<PopupButton
|
||||||
|
url={layer.itemType.custom_profile_url ?? '/item'}
|
||||||
|
parameterField={'extended.external_profile_id'}
|
||||||
|
text={'Profile'}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{layer.itemType.show_text && <TextView truncate></TextView>}
|
{layer.itemType.show_text && <TextView truncate></TextView>}
|
||||||
</PopupView>
|
</PopupView>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const __dirname = path.dirname(new URL(import.meta.url).pathname)
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
port: 5174,
|
port: 5175,
|
||||||
/**
|
/**
|
||||||
* https: {
|
* https: {
|
||||||
* key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
|
* key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
|
import { get } from 'radash'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
import { useGetItemTags } from '#components/Map/hooks/useTags'
|
import { useGetItemTags } from '#components/Map/hooks/useTags'
|
||||||
@ -22,9 +23,10 @@ export const PopupButton = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const params = new URLSearchParams(window.location.search)
|
const params = new URLSearchParams(window.location.search)
|
||||||
const getItemTags = useGetItemTags()
|
const getItemTags = useGetItemTags()
|
||||||
|
const parameter = get(item, parameterField ?? 'id')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to={`${url}/${parameterField ? item?.id : ''}?${params}`}>
|
<Link to={`${url}/${parameter || item?.id}?${params}`}>
|
||||||
<button
|
<button
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: `${item?.color ?? (item && (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color ? getItemTags(item)[0].color : (item?.layer?.markerDefaultColor ?? '#000')))}`,
|
backgroundColor: `${item?.color ?? (item && (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color ? getItemTags(item)[0].color : (item?.layer?.markerDefaultColor ?? '#000')))}`,
|
||||||
|
|||||||
1
lib/src/types/Item.d.ts
vendored
1
lib/src/types/Item.d.ts
vendored
@ -61,6 +61,7 @@ export interface Item {
|
|||||||
gallery?: GalleryItem[]
|
gallery?: GalleryItem[]
|
||||||
openCollectiveSlug?: string
|
openCollectiveSlug?: string
|
||||||
secrets?: ItemSecret[]
|
secrets?: ItemSecret[]
|
||||||
|
extended?: JSON
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// coordinates: [number, number]
|
// coordinates: [number, number]
|
||||||
|
|||||||
1
lib/src/types/ItemType.d.ts
vendored
1
lib/src/types/ItemType.d.ts
vendored
@ -16,4 +16,5 @@ export interface ItemType {
|
|||||||
relations: boolean
|
relations: boolean
|
||||||
template: string
|
template: string
|
||||||
questlog: boolean
|
questlog: boolean
|
||||||
|
custom_profile_url: string
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user