Skip to content

Commit

Permalink
console: Fix button alert styling
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiffer committed Feb 6, 2024
1 parent cbc8667 commit aa6187a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 9 additions & 7 deletions pkg/webui/components/button/button.styl
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@
&:only-child
margin-right: - $cs.xxs

.alert
left: 17px
&.with-alert:after
content: ''
position: absolute
top: 1px
background: white
width: 7px
height: 14px
padding-left: $cs.xxs
top: 4px
left: 17px
border: 3px solid var(--c-border-neutral-min)
border-radius: 100%
size: 13px
box-sizing: border-box
background-color: var(--c-bg-brand-normal)

.expand-icon
color: var(--c-icon-neutral-light)
Expand Down
5 changes: 3 additions & 2 deletions pkg/webui/components/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const assembleClassnames = ({
dropdownItems,
className,
error,
withAlert,
}) =>
classnames(style.button, {
[className]: !Boolean(dropdownItems), // If there are dropdown items, the button is wrapped in a div with the className.
Expand All @@ -67,15 +68,15 @@ const assembleClassnames = ({
[style.onlyIcon]: icon !== undefined && !message,
[style.withDropdown]: Boolean(dropdownItems),
[style.error]: error && !busy,
[style.withAlert]: withAlert,
})

const buttonChildren = props => {
const { dropdownItems, icon, busy, message, noDropdownIcon, withAlert, children } = props
const { dropdownItems, icon, busy, message, noDropdownIcon, children } = props

const content = (
<>
{icon && <Icon className={style.icon} icon={icon} />}
{withAlert && <Status pulse={false} status="good" flipped className={style.alert} />}
{message && <Message content={message} className={style.linkButtonMessage} />}
{children}
{dropdownItems && (
Expand Down

0 comments on commit aa6187a

Please sign in to comment.