Skip to content

Commit

Permalink
button size added
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Feb 24, 2023
1 parent 237bdc5 commit 3cdcb30
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import React from 'react';
import {View, Text, MarginModifiers} from 'react-native-ui-lib';
import {View, Text, MarginModifiers, Modifiers} from 'react-native-ui-lib';
import {Bounceable} from 'rn-bounceable';

type Props = MarginModifiers & {
label?: string;
onPress?: PureFunc;
};
type Props = Modifiers.MarginModifiers &
Modifiers.FlexModifiers & {
label?: string;
onPress?: PureFunc;
size?: 'medium' | 'small';
};

export const BButton: React.FC<Props> = ({label, onPress, size = 'medium', ...modifiers}) => {
const textSize = size === 'medium' ? {text65M: true} : {text70: true};

export const BButton: React.FC<Props> = ({label, onPress, ...modifiers}) => {
return (
<View {...modifiers}>
<Bounceable onPress={onPress}>
<View center bg-primary padding-s4 br40>
<Text text65M _white>
<Text _white {...textSize}>
{label}
</Text>
</View>
Expand Down

0 comments on commit 3cdcb30

Please sign in to comment.