2021-11-11 23:37:42 +01:00
|
|
|
<script lang="ts">
|
|
|
|
import { Link, useLocation } from "svelte-navigator";
|
|
|
|
import type { Address, VALUE_TYPE } from "upend/types";
|
|
|
|
export let to: IPointer;
|
|
|
|
|
|
|
|
interface IPointer {
|
|
|
|
entity?: Address;
|
|
|
|
attribute?: string;
|
|
|
|
value?: { t: VALUE_TYPE; c: string };
|
|
|
|
}
|
|
|
|
|
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
let routerTo = "#";
|
|
|
|
|
|
|
|
if ($location.pathname.startsWith("/browse") && to.entity) {
|
|
|
|
routerTo = `${$location.pathname},${to.entity}`;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-11-30 20:59:53 +01:00
|
|
|
<Link class="uplink" to={routerTo}>
|
2021-11-11 23:37:42 +01:00
|
|
|
<slot />
|
|
|
|
</Link>
|
2021-11-30 20:59:53 +01:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
:global(.uplink) {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
</style>
|