-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sharing button on sponsor spotlight page
- Loading branch information
Showing
7 changed files
with
70 additions
and
26 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
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
30 changes: 30 additions & 0 deletions
30
src/routes/(root)/sponsors/_components/ShareWithSponsor.svelte
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,30 @@ | ||
<script> | ||
export let partner; | ||
export let eventId; | ||
console.log('🦛 partner', partner); | ||
import { Standard as StandardButton } from '$elements/buttons'; | ||
import { Action as ActionModal } from '$elements/modals'; | ||
import { createEventDispatcher } from 'svelte'; | ||
import partnerLeadMutationApi from '$dataSources/api.that.tech/partner/leads/mutations'; | ||
const dispatch = createEventDispatcher(); | ||
const { companyName = '', id: partnerId } = partner; | ||
const { addLead } = partnerLeadMutationApi(); | ||
const actionTitle = `Share with ${companyName}`; | ||
const actionText = `By clicking the button below you agree to share your shared profile with <span class="font-bold">${companyName}</span>. | ||
See what you're sharing in your | ||
<a class="text-thatBlue-500 hover:text-thatOrange-500" href="/my/profiles/primary">Shared Profile</>.`; | ||
function shareWithSponsorAction() { | ||
if (partnerId) { | ||
return addLead(partnerId, eventId).then(() => dispatch('HIDE_SHARE_SPONSOR_MODAL')); | ||
} | ||
} | ||
</script> | ||
|
||
<ActionModal title={actionTitle} text={actionText}> | ||
<StandardButton on:click={() => shareWithSponsorAction()}>Share with Sponsor</StandardButton> | ||
<StandardButton on:click={() => dispatch('HIDE_SHARE_SPONSOR_MODAL')}>Cancel</StandardButton> | ||
</ActionModal> |
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