Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement base button with pressable component #29

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

PoorTable
Copy link
Collaborator

#22

Screenshot 2023-05-17 at 20 40 03

@PoorTable PoorTable requested a review from sharnik May 17, 2023 19:01
@PoorTable PoorTable self-assigned this May 17, 2023
type RoundButtonType = 'primary' | 'secondary'

export type BaseButtonPropsType = {
isDisabled?: boolean | null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of consistency with the RN Button this prop should be named disabled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

onPress?: () => void
iconAtStart?: ReactElement
iconAtEnd?: ReactElement
text?: string | ReactElement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you stopped at the 5th iteration of the Button. Take a look at the problems described further: https://www.smashingmagazine.com/2023/01/key-good-component-design-selfishness/#iteration-6 and the final form: hthttps://www.smashingmagazine.com/2023/01/key-good-component-design-selfishness/#me-myself-and-ui

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think now done in favour of flexibility

styleText?: StyleProp<TextStyle>
rootStyle?: StyleProp<ViewStyle>
hitSlop?: null | Insets | number
isLoading?: boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to loading for the sake of consistency with disabled

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -8,6 +8,7 @@ enum Palette {
ANGRY = '#dd3333',
DEEP_PURPLE = '#5D2555',
TRANSPARENT = 'rgba(0, 0, 0, 0)',
TRANSPARENT_DISABLED_BUTTON = 'rgba(0,0,1,0.14)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not tie the names to how they might be used. Note that we have Palette.ANGRY not Palette.ERROR_MESSAGE.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing, renamed

@PoorTable PoorTable requested a review from sharnik May 18, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants