Skip to content

Commit

Permalink
fix(protocol-designer, components): discarding vs delete step form bu…
Browse files Browse the repository at this point in the history
…tton text (#14872)

closes AUTH-319
  • Loading branch information
jerader authored Apr 12, 2024
1 parent 9be2f8f commit 044b37f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions components/src/lists/TitledList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import * as React from 'react'
import cx from 'classnames'

import styles from './lists.module.css'
import { Icon } from '../icons'
import { StyledText } from '../atoms'
import { COLORS } from '../helix-design-system'
import type { IconName, IconProps } from '../icons'

import styles from './lists.module.css'

// TODO(bc, 2021-03-31): reconsider whether this belongs in components library
// it is bloated with application specific functionality

Expand Down Expand Up @@ -98,6 +101,15 @@ export function TitledList(props: TitledListProps): JSX.Element {
iconProps && iconProps.className
)

let textColor = ''
if (disabled) {
// the below hex code is for our legacy --c-font-disabled to match other text colors
textColor = '#9c9c9c'
} else if (props.selected && !disabled) {
// the below hex code is for our legacy --c-highlight to match other text colors
textColor = '#5fd8ee'
}

return (
<div
id={id}
Expand All @@ -109,14 +121,9 @@ export function TitledList(props: TitledListProps): JSX.Element {
{iconName && (
<Icon {...iconProps} className={iconClass} name={iconName} />
)}
<h3
className={cx(styles.title, {
[styles.title_enabled]: !(disabled || inert),
[styles.title_disabled]: disabled || inert,
})}
>
<StyledText as="h3" backgroundColor={COLORS.white} color={textColor}>
{props.title}
</h3>
</StyledText>
{collapsible && (
<div
onClick={handleCollapseToggle}
Expand Down
2 changes: 1 addition & 1 deletion protocol-designer/src/localization/en/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"closeUnsavedStepForm": {
"title": "Unsaved step form",
"body": "You have not saved this step form. If you navigate away without saving, this step will be deleted.",
"confirm_button": "delete step"
"confirm_button": "discard step"
},
"closeBatchEditForm": {
"title": "Unsaved changes to multiple steps",
Expand Down

0 comments on commit 044b37f

Please sign in to comment.