Share modal (#74)

* Creation of the share modal

* Update package.json

* Addressed comments

* Fixed dependency

* Update ShareModal.vue

* Fixed url

* Update ShareModal.vue

* Adressed changes
This commit is contained in:
Adrian O.V
2023-06-28 11:44:47 -04:00
committed by GitHub
parent 227652de2e
commit 42f97f63d5
12 changed files with 345 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ export default {
{ text: 'Markdown', link: '/components/markdown' },
{ text: 'Copy Code', link: '/components/copy-code' },
{ text: 'Notifications', link: '/components/notifications' },
{ text: 'Share Modal', link: '/components/share-modal' },
],
},
],

View File

@@ -0,0 +1,44 @@
# Share Modal
<DemoContainer>
<Button @click="$refs.shareContent.show('This is content')">
<EditIcon/>
Share Content
</Button>
<Button @click="$refs.shareLink.show('https://modrinth.com')">
<GlobeIcon/>
Share Link
</Button>
<ShareModal
ref="shareContent"
share-title="This is the title for the content"
share-text="Share this content"
/>
<ShareModal
ref="shareLink"
share-title="This is the title for the link"
share-text="Share this link"
link
/>
</DemoContainer>
```vue
<ShareModal
ref="shareContent"
share-title="This is the title for the content"
share-text="Share this content"
/>
<ShareModal
ref="shareLink"
share-title="This is the title for the link"
share-text="Share this link"
link
/>
```
You can use ref to open the modal, calling the show method
`content` is what will be shown in the text of the input for sharing
```text
$refs.shareContent.show(content)
```