Skip to content

Commit

Permalink
Merge branch 'feature/radio-button' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillermo Angeles committed Oct 3, 2023
2 parents a4778b1 + 3f81f0f commit 473b1fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/RadioButton/RadioButtonList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement, useState } from 'react';
import { CSSProperties, ReactElement, useState } from 'react';
import styled from 'styled-components';
import RadioButton from './RadioButton';

Expand All @@ -24,14 +24,17 @@ const RadioButtonList = (props: Props) =>{
}

return(
<Container role="radiobuttonlist">
<Container
style={props.style}
role="radiobuttonlist"
>
{props.options.map((item, index) => {
const active = selection.some(e => e.id === item.id);
return(
<RadioButton
id={item.id}
key={item.id+'-'+index}
style={{marginBottom: 16}}
style={{marginBottom: 16, ...props.cellStyle}}
children={item.children}
selected={active}
onClick={() => onClick(item)}
Expand All @@ -45,6 +48,8 @@ export default RadioButtonList;
export interface Props{
options: Array<OptionProps>,
type: 'single' | 'multiple',
style?: CSSProperties,
cellStyle?: CSSProperties,
onChange?: (data: Array<OptionProps>) => void
}
interface OptionProps {
Expand Down

0 comments on commit 473b1fc

Please sign in to comment.