From 42f97f63d52a15cc1869ea167892c4af0962df24 Mon Sep 17 00:00:00 2001 From: "Adrian O.V" <83074853+CodexAdrian@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:44:47 -0400 Subject: [PATCH] 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 --- docs/.vitepress/config.js | 1 + docs/components/share-modal.md | 44 +++++ lib/assets/external/mastodon.svg | 1 + lib/assets/external/reddit.svg | 1 + lib/assets/external/twitter.svg | 1 + lib/assets/icons/mail.svg | 1 + lib/assets/icons/share.svg | 1 + lib/assets/styles/classes.scss | 6 +- lib/components/base/ShareModal.vue | 270 +++++++++++++++++++++++++++++ lib/components/index.js | 7 + package.json | 3 +- pnpm-lock.yaml | 11 ++ 12 files changed, 345 insertions(+), 2 deletions(-) create mode 100644 docs/components/share-modal.md create mode 100644 lib/assets/external/mastodon.svg create mode 100644 lib/assets/external/reddit.svg create mode 100644 lib/assets/external/twitter.svg create mode 100644 lib/assets/icons/mail.svg create mode 100644 lib/assets/icons/share.svg create mode 100644 lib/components/base/ShareModal.vue diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index e3f6014b8..f246dae7c 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -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' }, ], }, ], diff --git a/docs/components/share-modal.md b/docs/components/share-modal.md new file mode 100644 index 000000000..44f48d34d --- /dev/null +++ b/docs/components/share-modal.md @@ -0,0 +1,44 @@ +# Share Modal + + + + + + + + +```vue + + + +``` +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) +``` diff --git a/lib/assets/external/mastodon.svg b/lib/assets/external/mastodon.svg new file mode 100644 index 000000000..9e96c9410 --- /dev/null +++ b/lib/assets/external/mastodon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/assets/external/reddit.svg b/lib/assets/external/reddit.svg new file mode 100644 index 000000000..5cfd11243 --- /dev/null +++ b/lib/assets/external/reddit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/assets/external/twitter.svg b/lib/assets/external/twitter.svg new file mode 100644 index 000000000..a43d68d9f --- /dev/null +++ b/lib/assets/external/twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/assets/icons/mail.svg b/lib/assets/icons/mail.svg new file mode 100644 index 000000000..536e7c2c7 --- /dev/null +++ b/lib/assets/icons/mail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/assets/icons/share.svg b/lib/assets/icons/share.svg new file mode 100644 index 000000000..f7be8a132 --- /dev/null +++ b/lib/assets/icons/share.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/assets/styles/classes.scss b/lib/assets/styles/classes.scss index 025c4459e..dfaef406a 100644 --- a/lib/assets/styles/classes.scss +++ b/lib/assets/styles/classes.scss @@ -623,10 +623,14 @@ a, .resizable-textarea-wrapper { display: block; + flex-grow: 1; + width: 100%; + margin-bottom: 0; + height: 10rem !important; textarea { + height: 100%; border-radius: var(--radius-sm); - min-height: 10rem; width: calc(100% - var(--gap-xl) - var(--gap-sm)); resize: vertical; } diff --git a/lib/components/base/ShareModal.vue b/lib/components/base/ShareModal.vue new file mode 100644 index 000000000..c6eef33f4 --- /dev/null +++ b/lib/components/base/ShareModal.vue @@ -0,0 +1,270 @@ + + +