Skip to content

Commit

Permalink
Allow toggling custom style
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Oct 3, 2020
1 parent c21c528 commit 665e3b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Widgets/StyleSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const StyleSelectWidget = (props) => {
<Card
as="div"
name={style.id}
onClick={() => onChange(id, style.id)}
onClick={() =>
onChange(id, style.id === value ? null : style.id)
}
key={style.id}
className={cx({ active: style.id === value })}
>
Expand Down
3 changes: 3 additions & 0 deletions src/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
}

.style-select-widget {
.card {
cursor: pointer;
}
.card.active {
.extra.content {
background-color: #eee;
Expand Down

0 comments on commit 665e3b3

Please sign in to comment.