Skip to content

Commit

Permalink
Enabling Hal Plugin
Browse files Browse the repository at this point in the history
matteoscurati committed Dec 16, 2021
1 parent 2e17646 commit 6148f4c
Showing 4 changed files with 63 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/components/Plugin/Hal/CustomBlock.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<script setup>
const props = defineProps({
space: Object
});
const getSpaceId = () => {
const spaceId = props.space.id;
return spaceId;
};
const getSpaceName = () => {
const spaceName = props.space.name;
return spaceName;
};
const getHalUrl = () => {
const spaceId = getSpaceId();
return `https://9000.staging.hal.xyz/recipes/snapshot-follow-new-proposals?space-id=${spaceId}&status=end`;
};
const getLogoUrl = () => {
return `https://hal-snapshot-plugin.s3.eu-west-1.amazonaws.com/hal_bell.svg`;
};
</script>

<template>
<Block
:title="$t('hal.title', { spaceName: getSpaceName() })"
:loading="loading"
>
<div class="flex flex-col items-center">
<div>
<a :href="getHalUrl()" target="_blank">
<img
class="
rounded-full
border-2 border-transparent
hover:border-white
mx-auto
mb-2
"
:src="getLogoUrl()"
alt="Hal"
width="100"
height="100"
/>
</a>
</div>
<div class="link-color text-center mb-2">{{ $t('hal.text') }}</div>
<a :href="getHalUrl()" target="_blank">
<UiButton>Be notified</UiButton>
</a>
</div>
</Block>
</template>
3 changes: 3 additions & 0 deletions src/components/Plugin/config.json
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
"gnosis": {
"proposalParams": true
},
"hal": {
"proposalParams": false
},
"poap": {
"proposalParams": false
},
1 change: 1 addition & 0 deletions src/components/ProposalPluginsSidebar.vue
Original file line number Diff line number Diff line change
@@ -41,5 +41,6 @@ defineProps({
:votes="votes"
:strategies="strategies"
/>
<PluginHalCustomBlock v-if="space.plugins?.hal" :space="space" />
</div>
</template>
4 changes: 4 additions & 0 deletions src/locales/default.json
Original file line number Diff line number Diff line change
@@ -393,5 +393,9 @@
"strategy": "{key} strategy",
"delegate": "Delegate"
}
},
"hal": {
"title": "Track proposals for {spaceName}",
"text": "Receive notifications every time a new proposal is created or ends"
}
}

0 comments on commit 6148f4c

Please sign in to comment.