Skip to content

Commit

Permalink
rename beatmap-owner components to beatmap-mappers
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko committed Sep 6, 2024
1 parent 1193167 commit 0b15e03
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions resources/css/bem-index.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@import "bem/beatmap-list";
@import "bem/beatmap-list-item";
@import "bem/beatmap-mapper";
@import "bem/beatmap-owner-editor";
@import "bem/beatmap-mappers-editor";
@import "bem/beatmap-pack";
@import "bem/beatmap-pack-description";
@import "bem/beatmap-pack-items";
Expand All @@ -64,7 +64,7 @@
@import "bem/beatmap-scoreboard-top";
@import "bem/beatmap-stats-table";
@import "bem/beatmap-success-rate";
@import "bem/beatmaps-owner-editor";
@import "bem/beatmaps-mappers-editor";
@import "bem/beatmaps-popup";
@import "bem/beatmaps-popup-item";
@import "bem/beatmapset-activities";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.beatmap-owner-editor {
.beatmap-mappers-editor {
display: contents;

&__avatar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.beatmaps-owner-editor {
.beatmaps-mappers-editor {
.page-width-default();
.default-box-shadow();
padding-top: 10px;
Expand Down
4 changes: 2 additions & 2 deletions resources/css/bem/input-container.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
}
}

&--beatmap-owner-editor {
&--beatmap-mappers-editor {
--input-bg: hsl(var(--hsl-b6));

flex-direction: row;
padding: 0;

// match beatmap-owner-editor__mappers to prevent the layout from shifting.
// match beatmap-mappers-editor__mappers to prevent the layout from shifting.
gap: 2px;
border: 2px solid transparent; // TODO: border should be moved to a different modifier related to error.
}
Expand Down
2 changes: 1 addition & 1 deletion resources/css/bem/username-input.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
justify-content: flex-start;
min-width: 0; // so user-card-brick overflows properly.

&--beatmap-owner-editor {
&--beatmap-mappers-editor {
min-height: 20px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface Props {
}

@observer
export default class BeatmapOwnerEditor extends React.Component<Props> {
export default class BeatmapMappersEditor extends React.Component<Props> {
@observable private editing = false;
private readonly inputRef = React.createRef<HTMLInputElement>();
@observable private inputUsername = '';
Expand Down Expand Up @@ -61,29 +61,29 @@ export default class BeatmapOwnerEditor extends React.Component<Props> {
}

render() {
const blockClass = classWithModifiers('beatmap-owner-editor', {
const blockClass = classWithModifiers('beatmap-mappers-editor', {
editing: this.editing,
});

return (
<div className={blockClass}>
<div className='beatmap-owner-editor__col'>
<span className='beatmap-owner-editor__mode'>
<div className='beatmap-mappers-editor__col'>
<span className='beatmap-mappers-editor__mode'>
<span className={`fal fa-fw fa-extra-mode-${this.props.beatmap.mode}`} />
</span>
</div>

<div className='beatmap-owner-editor__col beatmap-owner-editor__col--version'>
<div className='beatmap-mappers-editor__col beatmap-mappers-editor__col--version'>
<span className='u-ellipsis-overflow'>
{this.props.beatmap.version}
</span>
</div>

<div className='beatmap-owner-editor__col'>
<div className='beatmap-mappers-editor__col'>
{this.renderUsernames()}
</div>

<div className='beatmap-owner-editor__col beatmap-owner-editor__col--buttons'>
<div className='beatmap-mappers-editor__col beatmap-mappers-editor__col--buttons'>
{this.renderButtons()}
</div>
</div>
Expand Down Expand Up @@ -135,7 +135,7 @@ export default class BeatmapOwnerEditor extends React.Component<Props> {

const reset = (
<button
className='beatmap-owner-editor__button'
className='beatmap-mappers-editor__button'
disabled={!hasGuestMapper(this.props.beatmap, this.props.beatmapset)}
onClick={this.handleResetClick}
>
Expand All @@ -146,7 +146,7 @@ export default class BeatmapOwnerEditor extends React.Component<Props> {
if (!this.editing) {
return (
<>
<button className='beatmap-owner-editor__button' onClick={this.handleStartEditingClick}>
<button className='beatmap-mappers-editor__button' onClick={this.handleStartEditingClick}>
<span className='fas fa-fw fa-pen' />
</button>

Expand All @@ -157,11 +157,11 @@ export default class BeatmapOwnerEditor extends React.Component<Props> {

return (
<>
<button className='beatmap-owner-editor__button' disabled={!this.canSave} onClick={this.handleSaveClick}>
<button className='beatmap-mappers-editor__button' disabled={!this.canSave} onClick={this.handleSaveClick}>
<span className='fas fa-fw fa-check' />
</button>

<button className='beatmap-owner-editor__button' onClick={this.handleCancelEditingClick}>
<button className='beatmap-mappers-editor__button' onClick={this.handleCancelEditingClick}>
<span className='fas fa-fw fa-times' />
</button>

Expand All @@ -177,24 +177,24 @@ export default class BeatmapOwnerEditor extends React.Component<Props> {
private renderUsernames() {
if (!this.editing) {
return (
<div className='beatmap-owner-editor__mappers'>
<div className='beatmap-mappers-editor__mappers'>
{this.props.mappers.map((mapper) => <BeatmapMapper key={mapper.id} user={mapper} />)}
</div>
);
}

return (
<InputContainer
for='beatmap-owner-editor-username-input'
for='beatmap-mappers-editor-username-input'
hasError={!this.canSave}
modifiers='beatmap-owner-editor'
modifiers='beatmap-mappers-editor'
showError={this.showError}
>
<UsernameInput
id='beatmap-owner-editor-username-input'
id='beatmap-mappers-editor-username-input'
initialUsers={this.props.mappers}
// initialValue not set for owner editor as value is reset when cancelled.
modifiers='beatmap-owner-editor'
modifiers='beatmap-mappers-editor'
onEnterPressed={this.handleSaveClick}
onValidUsersChanged={this.handleValidUsersChanged}
onValueChanged={this.handleUsernameInputValueChanged}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { deletedUserJson } from 'models/user';
import * as React from 'react';
import { group as groupBeatmaps } from 'utils/beatmap-helper';
import { trans } from 'utils/lang';
import BeatmapOwnerEditor from './beatmap-owner-editor';
import BeatmapMappersEditor from './beatmap-mappers-editor';
import DiscussionsState from './discussions-state';

interface Props {
Expand All @@ -19,15 +19,15 @@ interface Props {
}

@observer
export default class BeatmapsOwnerEditor extends React.Component<Props> {
export default class BeatmapsMappersEditor extends React.Component<Props> {
render() {
const groupedBeatmaps = [...groupBeatmaps((this.props.beatmapset.beatmaps ?? []).filter(
(beatmap) => beatmap.deleted_at == null,
))];

return (
<div className='beatmaps-owner-editor u-fancy-scrollbar'>
<div className='beatmaps-owner-editor__row beatmaps-owner-editor__row--content'>
<div className='beatmaps-mappers-editor u-fancy-scrollbar'>
<div className='beatmaps-mappers-editor__row beatmaps-mappers-editor__row--content'>
{/* header and its grid placeholder */}
<div />
<strong>
Expand All @@ -40,7 +40,7 @@ export default class BeatmapsOwnerEditor extends React.Component<Props> {

{groupedBeatmaps.map(([, beatmaps]) => (
beatmaps.map((beatmap) => (
<BeatmapOwnerEditor
<BeatmapMappersEditor
key={beatmap.id}
beatmap={beatmap}
beatmapset={this.props.beatmapset}
Expand All @@ -51,7 +51,7 @@ export default class BeatmapsOwnerEditor extends React.Component<Props> {
))}
</div>

<div className='beatmaps-owner-editor__row beatmaps-owner-editor__row--footer'>
<div className='beatmaps-mappers-editor__row beatmaps-mappers-editor__row--footer'>
<button
className='btn-osu-big btn-osu-big--rounded-thin'
onClick={this.props.onClose}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/beatmap-discussions/nominations.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import BeatmapsOwnerEditor from 'beatmap-discussions/beatmaps-owner-editor';
import BeatmapsOwnerEditor from 'beatmap-discussions/beatmaps-mappers-editor';
import LoveBeatmapDialog from 'beatmap-discussions/love-beatmap-dialog';
import { Nominator } from 'beatmap-discussions/nominator';
import PlainTextPreview from 'beatmap-discussions/plain-text-preview';
Expand Down

0 comments on commit 0b15e03

Please sign in to comment.