Skip to content

Commit

Permalink
Add history button to group pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cl8n committed Aug 7, 2023
1 parent c765f62 commit 09c6793
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/css/bem/btn-osu-big.less
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@
margin-top: 10px;
}

&--user-list-title {
flex-shrink: 0;
}

&--user-page-edit {
border-radius: 10000px;
width: 140px;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/bem/user-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

&__title {
.default-gutter-v2();
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 10px;
padding-top: 20px;
padding-bottom: 0;
margin: 0;
Expand Down
12 changes: 11 additions & 1 deletion resources/js/components/user-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import GameMode from 'interfaces/game-mode';
import GroupJson from 'interfaces/group-json';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import { usernameSortAscending } from 'models/user';
import * as moment from 'moment';
import core from 'osu-core-singleton';
Expand All @@ -12,6 +13,7 @@ import { classWithModifiers } from 'utils/css';
import { trans } from 'utils/lang';
import { currentUrlParams } from 'utils/turbolinks';
import { updateQueryString } from 'utils/url';
import BigButton from './big-button';
import { Sort } from './sort';
import { ViewMode, viewModes } from './user-card';
import { UserCards } from './user-cards';
Expand Down Expand Up @@ -151,7 +153,15 @@ export class UserList extends React.PureComponent<Props> {

<div className='user-list'>
{this.props.group != null && (
<h1 className='user-list__title'>{this.props.group.name}</h1>
<h1 className='user-list__title'>
{this.props.group.name}
<BigButton
href={route('group-history.index', { group: this.props.group.identifier })}
icon='fas fa-history'
modifiers='user-list-title'
text={trans('group_history.view')}
/>
</h1>
)}

{this.props.group?.description != null && (
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/group_history.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

return [
'none' => 'No group history found!',
'view' => 'View group history',

'event' => [
'actor' => 'by :user',
Expand Down

0 comments on commit 09c6793

Please sign in to comment.