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

Components/Segment #125

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

shubhamkakkar
Copy link
Contributor

No description provided.

@palingheorghe palingheorghe changed the base branch from master to Alpha-1 September 10, 2019 12:26
@shubhamkakkar shubhamkakkar changed the title segment incomplete, broken down code into single file, working on #58 segment component - work in progress Sep 10, 2019
Copy link
Collaborator

@palingheorghe palingheorghe left a 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 = {
Copy link
Collaborator

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,
Copy link
Collaborator

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([]);
Copy link
Collaborator

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?

@palingheorghe palingheorghe changed the title segment component - work in progress Components/Segment Sep 10, 2019
@palingheorghe
Copy link
Collaborator

Hi @shubhamkakkar are you still working on this?

@palingheorghe palingheorghe changed the base branch from Alpha-1 to dev October 15, 2019 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants