-
Notifications
You must be signed in to change notification settings - Fork 734
Typescript - RadioButton and RadioGroup #766
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a3440bb
Typescript - RadioButton and RadioGroup
M-i-k-e-l 6913a89
Move propTypes in to the files
M-i-k-e-l 40aff8a
Merge branch 'master' into feat/typescript-radio-group-and-button
M-i-k-e-l 217cdf0
Revert RadioGroup deletion
M-i-k-e-l 97c4187
Rename RadioGroup
M-i-k-e-l 9f979b2
Use ImageSourcePropType
M-i-k-e-l 2ca9519
Revert splitting getAccessibilityProps (add ts-ignore)
M-i-k-e-l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import { TextStyle, ImageStyle } from 'react-native'; | ||
interface RadioButtonPropTypes { | ||
/** | ||
* The identifier value of the radio button. must be different than other RadioButtons in the same group | ||
*/ | ||
value?: string | boolean; | ||
/** | ||
* When using RadioButton without a RadioGroup, use this prop to toggle selection | ||
*/ | ||
selected?: boolean; | ||
/** | ||
* Invoked when pressing the button | ||
*/ | ||
onPress?: Function; | ||
/** | ||
* Whether the radio button should be disabled | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* The color of the radio button | ||
*/ | ||
color?: string; | ||
/** | ||
* The size of the radio button, affect both width & height | ||
*/ | ||
size?: number; | ||
/** | ||
* The radio button border radius | ||
*/ | ||
borderRadius?: number; | ||
/** | ||
* A label for the radio button description | ||
*/ | ||
label?: string; | ||
/** | ||
* Label style | ||
*/ | ||
labelStyle?: TextStyle; | ||
/** | ||
* Icon image source | ||
*/ | ||
iconSource?: object | number; | ||
/** | ||
* Icon image style | ||
*/ | ||
iconStyle?: ImageStyle; | ||
/** | ||
* Should the icon be on the right side of the label | ||
*/ | ||
iconOnRight?: boolean; | ||
} | ||
declare const _default: React.ComponentType<RadioButtonPropTypes>; | ||
export default _default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
interface RadioGroupPropTypes { | ||
/** | ||
* The initial value of the selected radio button | ||
*/ | ||
initialValue?: string | boolean; | ||
/** | ||
* Invoked once when value changes, by selecting one of the radio buttons in the group | ||
*/ | ||
onValueChange?: Function; | ||
} | ||
declare const _default: React.ComponentType<RadioGroupPropTypes>; | ||
export default _default; |
13 changes: 13 additions & 0 deletions
13
generatedTypes/components/radioButton/RadioGroupContext.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
export interface RadioGroupContextPropTypes { | ||
/** | ||
* The identifier value of the radio button. must be different than other RadioButtons in the same group | ||
*/ | ||
value?: string | boolean; | ||
/** | ||
* Invoked once when value changes, by selecting one of the radio buttons in the group | ||
*/ | ||
onValueChange?: Function; | ||
} | ||
declare const _default: React.Context<RadioGroupContextPropTypes>; | ||
export default _default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import React from 'react'; | ||
export default function asRadioGroupChild(WrappedComponent: React.ComponentType<any>): any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think u can import as usual but just add
//@ts-ignore
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.
import Image from '../Image';
gives an error