diff --git a/dashboard/src/lib/group/Body.svelte b/dashboard/src/lib/group/Body.svelte index 6d280180..db35b329 100644 --- a/dashboard/src/lib/group/Body.svelte +++ b/dashboard/src/lib/group/Body.svelte @@ -8,7 +8,7 @@ import twemoji from 'twemoji'; import Privacy from './Privacy.svelte'; import MemberEdit from './MemberEdit.svelte'; - import { Link } from 'svelte-navigator'; + import { Link, useLocation } from 'svelte-navigator'; import { Member, Group } from '../../api/types'; @@ -50,6 +50,21 @@ await tick(); el.focus(); } + + let location = useLocation() + let pathName = $location.pathname; + + function getGroupPageUrl(randomizer?: boolean) { + let str: string; + if (pathName.startsWith("/dash/")) str = "/dash"; + else str = "/profile"; + + str += `/g/${group.id}`; + + if (randomizer) str += "/random"; + + return str; + } @@ -120,11 +135,11 @@ {/if} {#if !isPage} - + {:else if !isPublic} {/if} - + {:else if editMode} diff --git a/dashboard/src/lib/member/Body.svelte b/dashboard/src/lib/member/Body.svelte index 413edf50..f15111df 100644 --- a/dashboard/src/lib/member/Body.svelte +++ b/dashboard/src/lib/member/Body.svelte @@ -12,7 +12,7 @@ import ProxyTags from './ProxyTags.svelte'; import { Member, Group } from '../../api/types'; - import { Link } from 'svelte-navigator'; + import { Link, useLocation } from 'svelte-navigator'; export let groups: Group[] = []; export let member: Member; @@ -67,6 +67,31 @@ await tick(); el.focus(); } + + let location = useLocation() + let pathName = $location.pathname; + + function getMemberPageUrl() { + let str: string; + if (pathName.startsWith("/dash/")) str = "/dash"; + else str = "/profile"; + + str += `/m/${member.id}`; + + return str; + } + + function getSystemPageUrl() { + let str: string; + if (pathName.startsWith("/dash/")) str = "/dash"; + else { + str = "/profile"; + str += `/s/${member.system}`; + } + str += "?tab=members"; + + return str; + } @@ -156,9 +181,9 @@ {#if isMainDash}{/if} {/if} {#if !isPage} - + {:else} - + {/if} {:else if editMode}