diff options
author | Dessalines <tyhou13@gmx.com> | 2020-03-20 18:35:33 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-03-20 18:41:42 -0400 |
commit | 0050ae74a44c88a9a2be3a1a864423b0da627639 (patch) | |
tree | 23e74ebfc5a913c50b22de5ac096311434f0ebe8 /ui/src/components/user.tsx | |
parent | 4949ab973b4c9a951fa43341972fdb53d712fd56 (diff) |
Switch to radios for user and inbox pages for clarity. Fixes #608
Diffstat (limited to 'ui/src/components/user.tsx')
-rw-r--r-- | ui/src/components/user.tsx | 83 |
1 files changed, 65 insertions, 18 deletions
diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index 3e5df1b0..245df42f 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -242,27 +242,74 @@ export class User extends Component<any, UserState> { ); } - selects() { + viewRadios() { return ( - <div className="mb-2"> - <select - value={this.state.view} - onChange={linkEvent(this, this.handleViewChange)} - class="custom-select custom-select-sm w-auto" + <div class="btn-group btn-group-toggle"> + <label + className={`btn btn-sm btn-secondary pointer border-right border-light + ${this.state.view == View.Overview && 'active'} + `} + > + <input + type="radio" + value={View.Overview} + checked={this.state.view == View.Overview} + onChange={linkEvent(this, this.handleViewChange)} + /> + {i18n.t('overview')} + </label> + <label + className={`btn btn-sm btn-secondary pointer border-right border-light + ${this.state.view == View.Comments && 'active'} + `} + > + <input + type="radio" + value={View.Comments} + checked={this.state.view == View.Comments} + onChange={linkEvent(this, this.handleViewChange)} + /> + {i18n.t('comments')} + </label> + <label + className={`btn btn-sm btn-secondary pointer border-right border-light + ${this.state.view == View.Posts && 'active'} + `} + > + <input + type="radio" + value={View.Posts} + checked={this.state.view == View.Posts} + onChange={linkEvent(this, this.handleViewChange)} + /> + {i18n.t('posts')} + </label> + <label + className={`btn btn-sm btn-secondary pointer border-right border-light + ${this.state.view == View.Saved && 'active'} + `} > - <option disabled>{i18n.t('view')}</option> - <option value={View.Overview}>{i18n.t('overview')}</option> - <option value={View.Comments}>{i18n.t('comments')}</option> - <option value={View.Posts}>{i18n.t('posts')}</option> - <option value={View.Saved}>{i18n.t('saved')}</option> - </select> - <span class="ml-2"> - <SortSelect - sort={this.state.sort} - onChange={this.handleSortChange} - hideHot + <input + type="radio" + value={View.Saved} + checked={this.state.view == View.Saved} + onChange={linkEvent(this, this.handleViewChange)} /> - </span> + {i18n.t('saved')} + </label> + </div> + ); + } + + selects() { + return ( + <div className="mb-2"> + <span class="mr-3">{this.viewRadios()}</span> + <SortSelect + sort={this.state.sort} + onChange={this.handleSortChange} + hideHot + /> <a href={`/feeds/u/${this.state.username}.xml?sort=${ SortType[this.state.sort] |