Skip to content

Commit

Permalink
fix: Replace lenster with hey (#4287)
Browse files Browse the repository at this point in the history
* fix: Replace lenster with hey

* Fix hey svg eyes

* Fix color
  • Loading branch information
samuveth authored Oct 17, 2023
1 parent c64625e commit 0a7eae0
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 35 deletions.
24 changes: 24 additions & 0 deletions src/assets/icons/hey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions src/assets/icons/lenster.svg

This file was deleted.

12 changes: 6 additions & 6 deletions src/components/ModalPostVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { getChoiceString } from '@/helpers/utils';
import { ExtendedSpace, Proposal } from '@/helpers/interfaces';
const { shareVote, shareProposalTwitter, shareProposalLenster } = useSharing();
const { shareVote, shareProposalTwitter, shareProposalHey } = useSharing();
const { web3Account } = useWeb3();
const { userState } = useEmailSubscription();
Expand All @@ -27,7 +27,7 @@ const imgPath = computed(() => {
: '/stickers/hooray.png';
});
function share(shareTo: 'twitter' | 'lenster') {
function share(shareTo: 'twitter' | 'hey') {
shareVote(shareTo, {
space: props.space,
proposal: props.proposal,
Expand Down Expand Up @@ -78,12 +78,12 @@ function share(shareTo: 'twitter' | 'lenster') {
class="flex !h-[42px] w-full items-center justify-center gap-2"
@click="
props.waitingForSigners
? shareProposalLenster(space, proposal)
: share('lenster')
? shareProposalHey(space, proposal)
: share('hey')
"
>
<i-s-lenster class="text-[#8B5CF6]" />
{{ $t('shareOnLenster') }}
<i-s-hey class="text-[#FB3A5D]" />
{{ $t('shareOnHey') }}
</BaseButton>

<BaseButton
Expand Down
11 changes: 4 additions & 7 deletions src/components/SpaceProposalHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function deleteProposal() {
const {
shareProposalTwitter,
shareProposalLenster,
shareProposalHey,
shareToClipboard,
shareProposal,
sharingIsSupported,
Expand Down Expand Up @@ -80,8 +80,8 @@ async function handleSelect(e) {
}
function handleSelectShare(e: string) {
if (e === 'shareProposalLenster')
return shareProposalLenster(props.space, props.proposal);
if (e === 'shareProposalHey')
return shareProposalHey(props.space, props.proposal);
if (sharingIsSupported.value)
return shareProposal(props.space, props.proposal);
Expand Down Expand Up @@ -142,10 +142,7 @@ watch(
<template #item="{ item }">
<div class="flex items-center gap-2">
<i-s-twitter v-if="item.extras.icon === 'twitter'" />
<i-s-lenster
v-if="item.extras.icon === 'lenster'"
class="mr-1 text-sm text-skin-text"
/>
<i-s-hey v-if="item.extras.icon === 'hey'" class="mr-1 text-sm" />
<i-ho-link v-if="item.extras.icon === 'link'" />
{{ item.text }}
</div>
Expand Down
24 changes: 12 additions & 12 deletions src/composables/useSharing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export function useSharing() {
extras: { icon: 'twitter' }
},
{
text: 'Lenster',
action: 'shareProposalLenster',
extras: { icon: 'lenster' }
text: 'Hey',
action: 'shareProposalHey',
extras: { icon: 'hey' }
},
{
text: t('copyLink'),
Expand All @@ -40,12 +40,12 @@ export function useSharing() {
}

function shareVote(
shareTo: 'twitter' | 'lenster',
shareTo: 'twitter' | 'hey',
payload: { space: ExtendedSpace; proposal: Proposal; choices: string }
) {
const postText = getSharingText(shareTo, payload);

if (window && shareTo === 'lenster') return shareLenster(postText);
if (window && shareTo === 'hey') return shareHey(postText);
if (isSupported.value)
return share({
title: '',
Expand All @@ -55,7 +55,7 @@ export function useSharing() {
if (window && shareTo === 'twitter') return shareTwitter(postText);
}

function getSharingText(shareTo: 'twitter' | 'lenster', payload): string {
function getSharingText(shareTo: 'twitter' | 'hey', payload): string {
const isSingleChoice =
payload.proposal.type === 'single-choice' ||
payload.proposal.type === 'basic';
Expand All @@ -69,7 +69,7 @@ export function useSharing() {
? `@${payload.space.twitter}`
: payload.space.name;

if (shareTo === 'lenster')
if (shareTo === 'hey')
return `${encodeURIComponent(votedText)}%20"${encodeURIComponent(
payload.proposal.title
)}"%20${encodedProposalUrl(
Expand All @@ -94,8 +94,8 @@ export function useSharing() {
window.open(url, '_blank')?.focus();
}

function shareLenster(text) {
const url = `https://lenster.xyz/?text=${text}`;
function shareHey(text) {
const url = `https://hey.xyz/?text=${text}`;
window.open(url, '_blank')?.focus();
}

Expand All @@ -109,8 +109,8 @@ export function useSharing() {
);
}

function shareProposalLenster(space, proposal) {
shareLenster(
function shareProposalHey(space, proposal) {
shareHey(
`${encodeURIComponent(proposal.title)}%20${encodedProposalUrl(
space.id,
proposal
Expand All @@ -126,7 +126,7 @@ export function useSharing() {

return {
shareProposalTwitter,
shareProposalLenster,
shareProposalHey,
shareToClipboard,
proposalUrl,
shareProposal,
Expand Down
2 changes: 1 addition & 1 deletion src/locales/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"or": "or",
"share": "Share",
"shareOnTwitter": "Share on Twitter",
"shareOnLenster": "Share on Lenster",
"shareOnHey": "Share on Hey",
"createButton": "Create",
"discussion": "Discussion",
"changeWallet": "Change wallet",
Expand Down

1 comment on commit 0a7eae0

@vercel
Copy link

@vercel vercel bot commented on 0a7eae0 Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.