UX: Improve share modal consistency (#13689)

UX: Improve share modal consistency (#13689)

diff --git a/app/assets/javascripts/discourse/app/components/share-source.js b/app/assets/javascripts/discourse/app/components/share-source.js
index 1be7f58..ae9f407 100644
--- a/app/assets/javascripts/discourse/app/components/share-source.js
+++ b/app/assets/javascripts/discourse/app/components/share-source.js
@@ -1,7 +1,6 @@
 import Component from "@ember/component";
 export default Component.extend({
-  classNameBindings: [":social-link"],
-
+  tagName: "",
   actions: {
     share: function (source) {
       this.action(source);
diff --git a/app/assets/javascripts/discourse/app/initializers/sharing-sources.js b/app/assets/javascripts/discourse/app/initializers/sharing-sources.js
index 574c710..e577052 100644
--- a/app/assets/javascripts/discourse/app/initializers/sharing-sources.js
+++ b/app/assets/javascripts/discourse/app/initializers/sharing-sources.js
@@ -9,7 +9,7 @@ export default {
 
     Sharing.addSource({
       id: "twitter",
-      icon: "fab-twitter-square",
+      icon: "fab-twitter",
       generateUrl: function (link, title, quote = "") {
         const text = quote ? `"${quote}" -- ` : title;
         return `http://twitter.com/intent/tweet?url=${encodeURIComponent(
@@ -39,7 +39,7 @@ export default {
 
     Sharing.addSource({
       id: "email",
-      icon: "envelope-square",
+      icon: "envelope",
       title: I18n.t("share.email"),
       generateUrl: function (link, title, quote = "") {
         const body = quote ? `${quote} \n\n ${link}` : link;
diff --git a/app/assets/javascripts/discourse/app/templates/components/share-source.hbs b/app/assets/javascripts/discourse/app/templates/components/share-source.hbs
index eaee082..a2fdb3b 100644
--- a/app/assets/javascripts/discourse/app/templates/components/share-source.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/share-source.hbs
@@ -1,7 +1 @@
-<a href {{action "share" source}} title={{source.title}} aria-label={{source.title}}>
-  {{#if source.icon}}
-    {{d-icon source.icon}}
-  {{else}}
-    {{html-safe source.htmlIcon}}
-  {{/if}}
-</a>
+{{d-button action=(action "share" source) class=(concat "share-" source.id) translatedTitle=source.title translatedAriaLabel=source.title icon=(if source.icon source.icon source.htmlIcon)}}
diff --git a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
index 4df7297..7275238 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
@@ -19,7 +19,7 @@
       {{/each}}
 
       {{d-button
-        class="btn-primary"
+        class="btn-default"
         label="topic.share.notify_users.title"
         icon="hand-point-right"
         action=(action "toggleNotifyUsers")
@@ -27,7 +27,7 @@
 
       {{#if allowInvites}}
         {{d-button
-          class="btn-primary"
+          class="btn-default"
           label="topic.share.invite_users"
           icon="user-plus"
           action=(action "inviteUsers")
diff --git a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
index 0d8e4c0..fd0b5c0 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
@@ -30,15 +30,15 @@ acceptance("Share and Invite modal", function (needs) {
       "it shows the topic sharing url"
     );
 
-    assert.ok(count(".social-link") > 1, "it shows social sources");
+    assert.ok(count("button[class^='share-']") > 1, "it shows social sources");
 
     assert.ok(
-      exists(".btn-primary[aria-label='Notify']"),
+      exists(".btn[aria-label='Notify']"),
       "it shows the notify button"
     );
 
     assert.ok(
-      exists(".btn-primary[aria-label='Invite']"),
+      exists(".btn[aria-label='Invite']"),
       "it shows the invite button"
     );
   });
diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss
index c35dfa3..a74f4c1 100644
--- a/app/assets/stylesheets/common/base/modal.scss
+++ b/app/assets/stylesheets/common/base/modal.scss
@@ -969,31 +969,33 @@
 }
 
 .share-topic-modal {
+  form {
+    margin-bottom: 0;
+  }
   .sources {
-    align-items: center;
     display: flex;
     flex-wrap: wrap;
-    flex-direction: row;
-    margin-bottom: 1em;
-
-    .social-link {
-      font-size: $font-up-6;
-      margin-right: 8px;
+    align-items: stretch;
+    button {
+      margin-right: 0.5em;
+      margin-bottom: 0.5em;
     }
+  }
 
-    .btn-primary {
-      border-radius: 4px;
-      height: calc(#{$font-up-6} - 4px);
-      margin-bottom: 2px;
-      margin-right: 8px;
-      padding-left: 8px;
-      padding-right: 8px;
-
-      .d-icon {
-        font-size: $font-up-3;
-      }
+  .share-twitter {
+    .d-icon {
+      color: var(--twitter);
+    }
+  }
+  .share-facebook {
+    .d-icon {
+      color: var(--facebook);
     }
   }
+
+  .invite-users {
+    margin: 1em 0;
+  }
 }
 
 .group-add-members-modal {

GitHub sha: e2d04a85923a7d74c918797f1cb289162f0ca454

This commit appears in #13689 which was approved by CvX. It was merged by awesomerobot.