-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend Refactor #59
base: master
Are you sure you want to change the base?
Conversation
@dsevillamartin I would be glad if you could also take a glance at this, particularly the changes in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, haven't tested locally though.
import type User from 'flarum/common/models/User'; | ||
|
||
export default function addBioToUserCard() { | ||
extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd type this
in the function itself - I believe this should work. (Does UserCard not have the attributes typed?)
extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>) { | |
extend(UserCard.prototype, 'infoItems', function (items: ItemList<Mithril.Children>, this: any) { |
*/ | ||
this.textareaRows = '5'; | ||
export default class UserBio extends Component<UserBioAttrs> { | ||
editing: boolean = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if having values moved from oninit
to instance creation causes any issues or not... theoretically oninit
should only be called once, and since these are primitives it shouldn't really matter as there are no side effects? Just some thoughts.
const index = lengthBefore + lineIndex; | ||
|
||
// Show the same number of lines to avoid layout shift | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all these ts-ignore
s necessary?
Please note a minor change I made today in the released version: user-bio/js/src/forum/components/UserBio.js Line 117 in f30b872
(added |
Fixes #0000
Changes proposed in this pull request:
Reviewers should focus on:
Screenshot
Confirmed
composer test
).Required changes: