Skip to content

Commit

Permalink
chore: add shims, add class to profile follow button
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Oct 20, 2024
1 parent 18459ec commit 1fb4838
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module 'flarum/common/models/User' {
export default interface User {
followed(): boolean;
blocksFollow(): boolean;
canBeFollowed(): boolean;
followingCount(): number;
followerCount(): number;
}
}
4 changes: 2 additions & 2 deletions js/src/forum/addFollowControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function addFollowControls() {

items.add(
'follow',
<Button icon={icon} onclick={openFollowLevelModal.bind(this, user)}>
<Button className="Button" icon={icon} onclick={openFollowLevelModal.bind(this, user)}>
{app.translator.trans(`ianm-follow-users.forum.user_controls.${user.followed() ? 'change_button' : 'follow_button'}`)}
</Button>
);
Expand All @@ -70,7 +70,7 @@ export default function addFollowControls() {
}

const followButton = (
<Button className="Button" icon="fas fa-user-friends" onclick={openFollowLevelModal.bind(this, user)}>
<Button className="Button Button--follow-profile" icon="fas fa-user-friends" onclick={openFollowLevelModal.bind(this, user)}>
{user.followed()
? app.translator.trans(`ianm-follow-users.forum.badge.label.${user.followed()}`)
: app.translator.trans('ianm-follow-users.forum.user_controls.follow_button')}
Expand Down

0 comments on commit 1fb4838

Please sign in to comment.