Skip to content

Commit

Permalink
Add PostUser name to to rankings-info (#104)
Browse files Browse the repository at this point in the history
* Do not use h3 tag for PostUser name.

* Restore h3.
  • Loading branch information
rob006 authored Oct 7, 2024
1 parent cf5a922 commit 5815635
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
],
"require": {
"flarum/core": "^1.3.1",
"flarum/core": "^1.7",
"fof/extend": "^1.0.0",
"ext-json": "*"
},
Expand Down
6 changes: 1 addition & 5 deletions js/src/forum/addUserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export default function () {
return (node) => node && node.attrs && node.attrs.className && String(node.attrs.className).split(' ').includes(className);
};

const matchTag = (tagName) => {
return (node) => node && node.tag && node.tag === tagName;
};

const findMatchClass = function (node, className) {
const arr = [];

Expand Down Expand Up @@ -101,7 +97,7 @@ export default function () {
return vnode;
}

const header_node = vnode.children.find(matchTag('h3'));
const header_node = vnode.children.find(matchClass('PostUser-name'));
const amt = Number(setting('rankAmt')) ?? user.ranks().length;

header_node.children = header_node.children
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/RankingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class RankingsPage extends Page {
{i < 4 ? <RankingImage place={i} /> : <td className="rankings-4 rankings-mobile">{this.addOrdinalSuffix(i)}</td>}
<td>
<div className="PostUser">
<h3 className="rankings-info">
<h3 className="PostUser-name rankings-info">
<Link href={app.route.user(user)} force={true}>
{i < 4 ? avatar(user, { className: 'info-avatar rankings-' + i + '-avatar' }) : ''} {username(user)}
</Link>
Expand Down

0 comments on commit 5815635

Please sign in to comment.