Skip to content

Commit

Permalink
Refactor list items
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo committed Sep 5, 2020
1 parent e020072 commit 10b821f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
13 changes: 8 additions & 5 deletions app/javascript/mastodon/features/circles/components/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Icon from '../../../components/icon';
import IconButton from '../../../components/icon_button';
import { openModal } from '../../../actions/modal';
import { deleteCircle } from '../../../actions/circles';
import { defaultMediaVisibility } from '../../../components/status';

const messages = defineMessages({
deleteTitle: { id: 'confirmations.delete_circle.title', defaultMessage: 'Delete' },
Expand Down Expand Up @@ -45,13 +46,15 @@ class Circle extends React.PureComponent {
const { text, intl } = this.props;

return (
<button className='circle-link' onClick={this.handleEditClick}>
<div>
<div className='circle-link'>
<button className='circle-edit-button' onClick={this.handleEditClick}>
<Icon id='circle-o' className='column-link__icon' fixedWidth />
{text}
</div>
<IconButton icon='trash' size={16} title={intl.formatMessage(messages.deleteTitle)} onClick={this.handleDeleteClick} />
</button>
</button>
<button className='circle-delete-button' title={intl.formatMessage(messages.deleteTitle)} onClick={this.handleDeleteClick}>
<Icon id='trash' className='column-link__icon' fixedWidth />
</button>
</div>
);
}

Expand Down
45 changes: 24 additions & 21 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6327,34 +6327,37 @@ noscript {
}
}

button.circle-link {
background: lighten($ui-base-color, 8%);
color: $primary-text-color;
.circle-link {
display: flex;
font-size: 16px;
padding: 15px;
border: 0;
width: 100%;
text-align: left;
text-decoration: none;
cursor: pointer;

&:hover,
&:focus,
&:active {
background: lighten($ui-base-color, 11%);
.circle-edit-button {
flex: 1 1 auto;
}

&:focus {
outline: 0;
.circle-delete-button {
flex: 0 0 auto;
}

div {
flex: 1 1 auto;
}
.circle-edit-button,
.circle-delete-button {
background: lighten($ui-base-color, 8%);
color: $primary-text-color;
padding: 15px;
font-size: 16px;
text-align: left;
text-decoration: none;
cursor: pointer;
border: 0;

.icon-button {
flex: 0 0 auto;
&:hover,
&:focus,
&:active {
background: lighten($ui-base-color, 11%);
}

&:focus {
outline: 0;
}
}
}

Expand Down

0 comments on commit 10b821f

Please sign in to comment.