diff --git a/.env b/.env index bb9f877ac46a..b760ccbbbc3d 100644 --- a/.env +++ b/.env @@ -1,6 +1,7 @@ VITE_HUB_URL=https://testnet.snapshot.org VITE_RELAYER_URL=https://testnet.snapshot.org VITE_SCORES_URL=https://score.snapshot.org +VITE_ENVELOP_URL=https://core.envelop.fyi VITE_SIDEKICK_URL=https://sh5.co VITE_BROVIDER_URL=https://rpc.snapshot.org VITE_IPFS_GATEWAY=snapshot.mypinata.cloud diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 22443e167abb..4237cc3451dc 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -116,6 +116,8 @@ "watchTxStatus": true, "toValue": true, "useFlaggedMessageStatus": true, + "useEmailSubscription": true, + "useEmailFetchClient": true, "useStatement": true } } diff --git a/src/components/MenuAccount.vue b/src/components/MenuAccount.vue index 220a9e58a9ae..31e60aceeeaf 100644 --- a/src/components/MenuAccount.vue +++ b/src/components/MenuAccount.vue @@ -4,10 +4,20 @@ const props = defineProps<{ }>(); const emit = defineEmits(['switchWallet']); - +const { t } = useI18n(); const { domain } = useApp(); const { logout } = useWeb3(); const router = useRouter(); +const { userState, loadEmailSubscriptions } = useEmailSubscription(); + +const showModalEmail = ref(false); + +onMounted(loadEmailSubscriptions); +watch(showModalEmail, () => { + if (!showModalEmail.value) { + loadEmailSubscriptions(); + } +}); function handleAction(e) { if (e === 'viewProfile') @@ -19,6 +29,10 @@ function handleAction(e) { params: { address: props.address } }); if (e === 'switchWallet') return emit('switchWallet'); + if (e === 'subscribeEmail') { + showModalEmail.value = true; + return true; + } return logout(); } @@ -38,6 +52,11 @@ function handleAction(e) { action: 'switchWallet', extras: { icon: 'switch' } }, + { + text: t('emailSubscription.title'), + action: 'subscribeEmail', + extras: { icon: 'mail' } + }, { text: 'Log out', action: 'logout', extras: { icon: 'logout' } } ]" @select="handleAction($event)" @@ -57,6 +76,7 @@ function handleAction(e) { class="ml-[2px]" /> + + + + + + + diff --git a/src/components/ModalEmailManagement.vue b/src/components/ModalEmailManagement.vue new file mode 100644 index 000000000000..55fd2e8ad87f --- /dev/null +++ b/src/components/ModalEmailManagement.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/components/ModalEmailResend.vue b/src/components/ModalEmailResend.vue new file mode 100644 index 000000000000..d78069931eea --- /dev/null +++ b/src/components/ModalEmailResend.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/ModalEmailSubscription.vue b/src/components/ModalEmailSubscription.vue new file mode 100644 index 000000000000..619b5b224ef7 --- /dev/null +++ b/src/components/ModalEmailSubscription.vue @@ -0,0 +1,101 @@ + + + diff --git a/src/components/ModalPostVote.vue b/src/components/ModalPostVote.vue index c541ad06c67d..09bc69fb0419 100644 --- a/src/components/ModalPostVote.vue +++ b/src/components/ModalPostVote.vue @@ -5,6 +5,7 @@ import { ExtendedSpace, Proposal } from '@/helpers/interfaces'; const { isGnosisSafe } = useClient(); const { shareVote, shareProposalTwitter, shareProposalLenster } = useSharing(); const { web3Account } = useWeb3(); +const { userState } = useEmailSubscription(); const props = defineProps<{ open: boolean; @@ -13,7 +14,12 @@ const props = defineProps<{ selectedChoices: any; }>(); -const emit = defineEmits(['close']); +const emit = defineEmits(['close', 'subscribeEmail']); + +const subscribeEmail = () => { + emit('subscribeEmail'); + emit('close'); +}; const imgPath = computed(() => { return isGnosisSafe.value @@ -80,6 +86,15 @@ function share(shareTo: 'twitter' | 'lenster') { {{ $t('shareOnLenster') }} + + + {{ $t('proposal.postVoteModal.subscribe') }} + +
{