mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-05-07 01:02:36 +00:00
chore: update prettier tab width for consistency (#175)
This commit is contained in:
parent
a931f8c69c
commit
f24d2fcc99
247 changed files with 7224 additions and 7375 deletions
|
@ -2,27 +2,23 @@ import * as React from 'react';
|
|||
import { Item, Wrapper } from './HorizontalSwitch.styled';
|
||||
|
||||
export type SwitchProps = {
|
||||
items: string[];
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
items: string[];
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
};
|
||||
|
||||
export const HorizontalSwitch = (props: SwitchProps) => {
|
||||
const handleClick = (item: typeof props.value) => () => {
|
||||
props.onChange?.(item);
|
||||
};
|
||||
const handleClick = (item: typeof props.value) => () => {
|
||||
props.onChange?.(item);
|
||||
};
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
{props.items.map((item, idx) => (
|
||||
<Item
|
||||
key={idx}
|
||||
selected={item === props.value}
|
||||
onClick={handleClick(item)}
|
||||
>
|
||||
{item}
|
||||
</Item>
|
||||
))}
|
||||
</Wrapper>
|
||||
);
|
||||
return (
|
||||
<Wrapper>
|
||||
{props.items.map((item, idx) => (
|
||||
<Item key={idx} selected={item === props.value} onClick={handleClick(item)}>
|
||||
{item}
|
||||
</Item>
|
||||
))}
|
||||
</Wrapper>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue