Skip to content

Commit

Permalink
feat(RadioButton): fix max comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryMatte committed Oct 29, 2024
1 parent 1455169 commit 2ef7988
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const InnerContent = styled.div<{ $isExpanded: boolean, $transitionStarted: bool
interface RadioButtonProps {
label: string;
value: string;
inputId?: string;
id?: string;
defaultChecked?: boolean;
disabled?: boolean;
content?: {
Expand Down Expand Up @@ -140,7 +140,7 @@ export const RadioButtonGroup: VoidFunctionComponent<RadioButtonGroupProps> = ({
data-testid={`${dataTestId}-${button.value}`}
defaultChecked={button.defaultChecked}
disabled={button.disabled}
id={button.inputId}
id={button.id}
label={button.label}
name={groupName}
onChange={handleChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ exports[`Radio Card Matches snapshot (Disabled, Desktop) 1`] = `
background-color: #F1F2F2;
border: 1px solid #B7BBC2;
border-radius: var(--border-radius-2x);
color: #B7BBC2;
color: #1B1C1E;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/components/radio-card-group/radio-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as S from './styled-components';
export interface RadioCardProps {
checked?: boolean;
children?: ReactNode;
className?: string;
defaultChecked?: boolean;
disabled?: boolean;
id?: string;
Expand All @@ -34,6 +35,7 @@ const StyledRadioInput = styled(RadioInput)`
export const RadioCard: VoidFunctionComponent<RadioCardProps> = ({
checked,
children,
className,
defaultChecked,
disabled,
name,
Expand All @@ -56,6 +58,7 @@ export const RadioCard: VoidFunctionComponent<RadioCardProps> = ({
<S.Label isDisabled={disabled} isMobile={isMobile} htmlFor={id}>
<StyledRadioInput
checked={checked}
className={className}
data-testid={`radio-card-${value}-input`}
defaultChecked={defaultChecked}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ResolvedTheme } from '../../themes/theme';
import { focus } from '../../utils/css-state';

interface InputContainerProps {
isDisabled?: boolean;
disabled?: boolean;
isMobile: boolean;
isChecked?: boolean;
theme: ResolvedTheme;
Expand All @@ -21,8 +21,8 @@ interface CardProps {
theme: ResolvedTheme;
}

function getContentColor({ isDisabled, theme }: InputContainerProps): string {
if (isDisabled) {
function getContentColor({disabled, theme }: InputContainerProps): string {

Check failure on line 24 in packages/react/src/components/radio-card-group/styled-components.ts

View workflow job for this annotation

GitHub Actions / React: ESLint

ESLint results

A space is required after '{'.
if (disabled) {
return theme.component['radio-card-disabled-text-color'];
}
return theme.component['radio-card-text-color'];
Expand Down

0 comments on commit 2ef7988

Please sign in to comment.