-
Notifications
You must be signed in to change notification settings - Fork 2
fix: added height on loading button to show indicator #168
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| /* eslint-disable prettier/prettier */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mafeoli melhor deixa habilitado e ajustar a identação |
||
|
|
||
| import styled from 'styled-components/native'; | ||
| import { | ||
| ButtonColorType, | ||
|
|
@@ -100,45 +102,38 @@ type TextButtonProps = { | |
| const getTextColor = (props: TextButtonProps): string => { | ||
| switch (props.colorVariant) { | ||
| case 'primary': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? brandPrimaryContrast(props) | ||
| : brandPrimary(props) | ||
| }`; | ||
| }`; | ||
| case 'secondary': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? brandSecondaryContrast(props) | ||
| : brandSecondary(props) | ||
| }`; | ||
| }`; | ||
| case 'accent': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? brandAccentContrast(props) | ||
| : brandAccent(props) | ||
| }`; | ||
| }`; | ||
| case 'danger': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? dangerContrast(props) | ||
| : dangerMain(props) | ||
| }`; | ||
| }`; | ||
| case 'info': | ||
| return `${ | ||
| props.buttonVariant === 'filled' ? infoContrast(props) : infoMain(props) | ||
| }`; | ||
| return `${props.buttonVariant === 'filled' ? infoContrast(props) : infoMain(props) | ||
| }`; | ||
| case 'warning': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? warningContrast(props) | ||
| : warningMain(props) | ||
| }`; | ||
| }`; | ||
| case 'success': | ||
| return `${ | ||
| props.buttonVariant === 'filled' | ||
| return `${props.buttonVariant === 'filled' | ||
| ? successContrast(props) | ||
| : successMain(props) | ||
| }`; | ||
| }`; | ||
| default: | ||
| return `${brandPrimaryContrast(props)}`; | ||
| } | ||
|
|
@@ -148,7 +143,7 @@ type TouchableProps = { | |
| rounded: boolean; | ||
| } & ThemeProps; | ||
|
|
||
| export const Touchable = styled(TouchableComponent)<TouchableProps>` | ||
| export const Touchable = styled(TouchableComponent) <TouchableProps>` | ||
| border-radius: ${(props: TouchableProps): any => | ||
| props.rounded ? buttonSize / 2 : buttonRadius(props)}px; | ||
| `; | ||
|
|
@@ -172,7 +167,7 @@ export const ButtonWrapper = styled.View<ButtonWrapperProps>` | |
| opacity: ${isDisabled(0.3, 1)}; | ||
| `; | ||
|
|
||
| export const TextButton = styled(TypographyComponent)<TextButtonProps>` | ||
| export const TextButton = styled(TypographyComponent) <TextButtonProps>` | ||
| letter-spacing: 0.4px; | ||
| color: ${isFlat(getBackgroundColor, getTextColor)}; | ||
| font-weight: bold; | ||
|
|
@@ -183,6 +178,7 @@ export const Loading = styled(LoadingIndicator).attrs({ | |
| })` | ||
| align-self: center; | ||
| width: 55px; | ||
| height: 55px | ||
|
Comment on lines
178
to
+181
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change sets
|
||
| `; | ||
|
|
||
| type IconProps = { | ||
|
|
@@ -195,7 +191,7 @@ type IconProps = { | |
|
|
||
| export const Icon = styled(DefaultIcon).attrs((props: IconProps) => ({ | ||
| color: getTextColor(props), | ||
| }))<IconProps>` | ||
| })) <IconProps>` | ||
| margin-right: ${isLeftIcon(smallSpacing, 0)}px; | ||
| margin-left: ${isRightIcon(smallSpacing, 0)}px; | ||
| `; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice
/* eslint-disable prettier/prettier */was added at the top of the file. While sometimes necessary for specific lines, disabling Prettier for an entire file can lead to inconsistencies and make it harder to maintain a uniform codebase style. Could you clarify the reason for this? Perhaps we could resolve the underlying Prettier conflict that prompted this, or if a specific line is problematic, use a more targeted// eslint-disable-next-line prettier/prettiercomment just for that line?