Skip to content

Commit

Permalink
Merge pull request #104 from GetLuko/hc/fix/set-mini-by-default-butto…
Browse files Browse the repository at this point in the history
…n-bar

ButtonBar: force size mini on button bar + update test id
  • Loading branch information
hcourthias authored Aug 17, 2023
2 parents d910c70 + 8c6c78c commit 3093a91
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions packages/sandbox/src/app/sandbox/docs/button-bar.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,26 @@ const buttonsArray: ButtonProps[] = [
text: 'One',
onPress: () => console.log('onPress One'),
iconName: 'Area',
size: 'mini',
},
{
text: 'Two',
onPress: () => console.log('onPress Two'),
iconName: 'Area',
size: 'mini',
},
{
text: 'Three',
onPress: () => console.log('onPress Three'),
iconName: 'Area',
size: 'mini',
},
{
text: 'Four',
onPress: () => console.log('onPress Four'),
iconName: 'Area',
size: 'mini',
},
{
text: 'Five',
onPress: () => console.log('onPress Five'),
iconName: 'Area',
size: 'mini',
},
];

Expand Down
2 changes: 1 addition & 1 deletion packages/streamline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getluko/streamline",
"version": "0.0.29",
"version": "0.0.30",
"author": "luko",
"description": "Luko Design System using react-native for iOS and Android",
"main": "dist/packages/streamline/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('ButtonBar', () => {
const { getByTestId } = renderWithProvider(
<ButtonBar buttons={[]} isSkeleton testID="ButtonBar" />
);
const scrollView = getByTestId('ButtonBar_container');
const scrollView = getByTestId('ButtonBar');

expect(scrollView.props).toHaveProperty('scrollEnabled', false);
});
Expand Down
5 changes: 3 additions & 2 deletions packages/streamline/src/components/button-bar/button-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Button } from '../buttons/button/button';
import { ButtonProps } from '../buttons/button/button.types';

type Props = {
buttons: ButtonProps[];
buttons: Omit<ButtonProps, 'size'>[];
isSkeleton?: boolean;
testID?: string;
};
Expand All @@ -28,7 +28,7 @@ export const ButtonBar = ({ buttons, isSkeleton = false, testID }: Props) => {

return (
<ScrollView
testID={testID ? `${testID}_container` : undefined}
testID={testID}
scrollEnabled={!isSkeleton}
horizontal={true}
showsHorizontalScrollIndicator={false}
Expand All @@ -46,6 +46,7 @@ export const ButtonBar = ({ buttons, isSkeleton = false, testID }: Props) => {
appearance="secondary"
{...button}
isSkeleton={isSkeleton}
size="mini"
/>
</Box>
))}
Expand Down

0 comments on commit 3093a91

Please sign in to comment.