Add active styling to existing bangs while editing.

This commit is contained in:
Bauke 2022-03-15 11:29:42 +01:00
parent 06a1ee5550
commit d66b43e9fd
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 7 additions and 1 deletions

View File

@ -118,6 +118,7 @@ export class PageMain extends Component<Props, State> {
const {bangs, editorError} = this.state;
const availableBangs = bangs.map((bang) => {
const active = bang.id === this.state.editorBang.id ? 'active' : '';
const onClick = () => {
this.setState({
editorBang: {...bang},
@ -126,7 +127,7 @@ export class PageMain extends Component<Props, State> {
return html`
<li>
<button onClick=${onClick}>
<button class="${active}" onClick=${onClick}>
${bang.name}<span class="bang-id">${bang.id}</span>
</button>
</li>

View File

@ -123,6 +123,11 @@
padding: 16px;
width: 100%;
&.active {
border-color: var(--da-3);
color: var(--da-3);
}
&:hover {
background-color: var(--da-3);
border-color: var(--da-3);