forked from snapshot-labs/snapshot-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Show sub proposals on custom domain (snapshot-labs#3485)
* Show sub proposals on custom domain * Cleanup * Fix warnings * Fix warnings
- Loading branch information
Showing
16 changed files
with
392 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import domains from '@/../snapshot-spaces/spaces/domains.json'; | ||
import { useApp } from '@/composables'; | ||
const props = defineProps<{ | ||
spaceId: string; | ||
}>(); | ||
const { domain } = useApp(); | ||
const spaceLink = computed(() => { | ||
// Check if proposal space id is a value in the domains.json file | ||
if (domain && Object.values(domains).includes(props.spaceId)) { | ||
// If so, find the key that matches the value | ||
const key = Object.keys(domains).find( | ||
key => domains[key] === props.spaceId | ||
); | ||
return `https://${key}`; | ||
} | ||
if (domain) return `https://snapshot.org/#/${props.spaceId}`; | ||
return { | ||
name: 'spaceProposals', | ||
params: { key: props.spaceId } | ||
}; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<BaseLink :link="spaceLink" hide-external-icon> | ||
<slot /> | ||
</BaseLink> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.