Skip to content

Commit

Permalink
Fix(web): Reflects SubTabButtonList component pointers.
Browse files Browse the repository at this point in the history
  • Loading branch information
長田淳史 committed Jun 27, 2023
1 parent 5f35283 commit 36a77de
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions web/src/beta/components/SwitchButtonList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ type SwitchAdditionalField = SwitchField<AdditionalField>;

export type Props = {
list: SwitchAdditionalField[];
onClick?: (id: string) => void;
onChange?: (id: string) => void;
};
const SwitchButtonList: React.FC<Props> = ({ list, onClick }) => {
const SwitchButtonList: React.FC<Props> = ({ list, onChange }) => {
const theme = useTheme();
return (
<>
{list.map((item, index) => (
<SwitchButton
key={item.id}
key={index}
disabled={!!item?.active}
onClick={() => onClick?.(item.id)}
onClick={() => onChange?.(item.id)}
first={index === 0}
end={index === list.length - 1}>
<Text
Expand All @@ -45,12 +45,9 @@ const SwitchButton = styled.button<{
border-top-right-radius: ${props => (props.end ? "4px" : "0px")};
border-bottom-left-radius: ${props => (props.first ? "4px" : "0px")};
border-bottom-right-radius: ${props => (props.end ? "4px" : "0px")};
transition: all 0.5s ease;
:hover {
background: ${props => props.theme.general.select};
transition: all 0.5s ease;
}
:not(:hover) {
transition: all 0.5s ease;
}
`;

Expand Down

0 comments on commit 36a77de

Please sign in to comment.