-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Components/Segment #125
base: dev
Are you sure you want to change the base?
Components/Segment #125
Conversation
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.
Hi,
Please don't forget about the design files.
You can find out more about what a Segment is from here: https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/
Alin
} | ||
} | ||
|
||
Segment.prototypes = { |
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.
This should be Segment.propTypes
SafeAreaView, | ||
TouchableNativeFeedback, | ||
Dimensions, | ||
Text, |
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.
Try using the Text
component from Galio
const { | ||
Provider: TilesDimensionPropProvider, | ||
Consumer: TilesDimensionPropConsumer, | ||
} = React.createContext([]); |
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 don't think using context is right for this component. I'd actually prefer using state
memorizing which of the Segment's tab is the active one. Maybe we could try having a dataArray
prop which will accept an array of components and then render all of those components with they're own onPress function which the user could also edit.
For example let's say: <Segment dataArray={data} onPress={(option) => {/*do something here*/}}/>
and the data array would look something like this: data = [<Text>Option 1</Text>, <Text>Option 2</Text>];
What do you think?
Hi @shubhamkakkar are you still working on this? |
No description provided.