Browse Source

Add styles for "multiple choice" toggle

lets-bump-hometown-to-mastodon-4.2
nachtjasmin 2 years ago
parent
commit
54bcf3dc11
No known key found for this signature in database
  1. 2
      app/javascript/mastodon/features/compose/components/poll_form.jsx
  2. 9
      app/javascript/styles/hometown.scss

2
app/javascript/mastodon/features/compose/components/poll_form.jsx

@ -164,6 +164,8 @@ class PollForm extends ImmutablePureComponent {
<ul>
{options.map((title, i) => <Option title={title} lang={lang} key={i} index={i} onChange={onChangeOption} onRemove={onRemoveOption} isPollMultiple={isMultiple} onToggleMultiple={this.handleToggleMultiple} autoFocus={i === autoFocusIndex} {...other} />)}
</ul>
{/* Hometown: Clicking the poll checkboxes is not accessible at all, therefore we add a dedicated toggle. */}
<div className='is-multiple-toggle'>
<Toggle className='is-multiple-checkbox' checked={isMultiple} onChange={this.handleToggleMultiple} />
<span className='is-multiple-toggle__label'>

9
app/javascript/styles/hometown.scss

@ -52,3 +52,12 @@
height: 23.1429px;
line-height: 23.15px;
}
// app/javascript/mastodon/features/compose/components/poll_form.jsx
// Add some custom styling for the "multiple choice" selection button
.compose-form__poll-wrapper .is-multiple-toggle {
padding: 10px; // same as the poll options above it
display: inline-flex;
align-items: center;
gap: 10px; // same as the padding
}

Loading…
Cancel
Save