mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-03-01 12:44:17 +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-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable import/no-relative-parent-imports */
|
||||
/* eslint-disable array-callback-return */
|
||||
/* eslint-disable new-cap */
|
||||
@ -47,7 +47,7 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
|
||||
setApis((current) => [
|
||||
...current,
|
||||
{
|
||||
id: layer.id!,
|
||||
id: layer.id,
|
||||
api: new itemsApi<Place>('items', layer.id, undefined, {
|
||||
_or: [
|
||||
{
|
||||
@ -115,7 +115,11 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
|
||||
<PopupView>
|
||||
{layer.itemType.show_start_end && <StartEndView></StartEndView>}
|
||||
{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>}
|
||||
</PopupView>
|
||||
|
||||
@ -11,7 +11,7 @@ const __dirname = path.dirname(new URL(import.meta.url).pathname)
|
||||
export default defineConfig({
|
||||
server: {
|
||||
host: true,
|
||||
port: 5174,
|
||||
port: 5175,
|
||||
/**
|
||||
* https: {
|
||||
* key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
import { get } from 'radash'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import { useGetItemTags } from '#components/Map/hooks/useTags'
|
||||
@ -22,9 +23,10 @@ export const PopupButton = ({
|
||||
}) => {
|
||||
const params = new URLSearchParams(window.location.search)
|
||||
const getItemTags = useGetItemTags()
|
||||
const parameter = get(item, parameterField ?? 'id')
|
||||
|
||||
return (
|
||||
<Link to={`${url}/${parameterField ? item?.id : ''}?${params}`}>
|
||||
<Link to={`${url}/${parameter || item?.id}?${params}`}>
|
||||
<button
|
||||
style={{
|
||||
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[]
|
||||
openCollectiveSlug?: string
|
||||
secrets?: ItemSecret[]
|
||||
extended?: JSON
|
||||
|
||||
// {
|
||||
// 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
|
||||
template: string
|
||||
questlog: boolean
|
||||
custom_profile_url: string
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user