Skip to content

Commit 5c7338d

Browse files
authored
Merge pull request #767 from StioStudio/fix-ste-follow-btn-in-compact-buttons
fix ste follow button when using compact buttons
2 parents 59c5a68 + 5ae05c6 commit 5c7338d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

features/compact-buttons/project.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* remix button */
2+
.preview .ste-follow-btn.button {
3+
padding: 11px !important;
4+
}
5+
.preview .ste-follow-btn.button:before {
6+
margin-right: 0 !important;
7+
}
8+
.preview .ste-follow-btn.button span {
9+
display: none;
10+
}
11+
112
/* remix button */
213
.preview .remix-button {
314
padding: 11px !important;

features/follow-on-projects/script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ export default async function ({ feature, console }) {
1818
let button = document.createElement("button");
1919
button.className =
2020
"ste-follow-btn button " + (following ? "following" : "notfollowing");
21-
button.textContent = (following ? "Unfollow" : "Follow") + " " + username;
21+
let span = document.createElement("span");
22+
span.textContent = (following ? "Unfollow" : "Follow") + " " + username;
23+
button.append(span)
2224
button.addEventListener("click", async function () {
2325
if (following) {
2426
following = false;
2527
button.className =
2628
"ste-follow-btn button " + (following ? "following" : "notfollowing");
27-
button.textContent =
29+
span.textContent =
2830
(following ? "Unfollow" : "Follow") + " " + username;
2931
let data = await (
3032
await fetch(
@@ -47,7 +49,7 @@ export default async function ({ feature, console }) {
4749
following = true;
4850
button.className =
4951
"ste-follow-btn button " + (following ? "following" : "notfollowing");
50-
button.textContent =
52+
span.textContent =
5153
(following ? "Unfollow" : "Follow") + " " + username;
5254
let data = await (
5355
await fetch(

0 commit comments

Comments
 (0)