Skip to content

Enhance ContentItem component with flexed layout option and update Picker API #3633

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 12 commits into from
Mar 24, 2025

Conversation

ethanshar
Copy link
Collaborator

@ethanshar ethanshar commented Mar 18, 2025

Description

  • Updated Picker components docs (from private), I removed features that are not relevant in public
  • Add support for a flexed behavior for ContentItem (relevant for code snippets) - it allows to stretch the components (default is centered)
  • Fix some styling in ContentItem related to the previous feature
  • Fix and reimplement the support for Incubator component (see two last commits in this PR)

Changelog

N/A

Additional info

@ethanshar ethanshar assigned nitzanyiz and unassigned Inbal-Tish Mar 20, 2025
@ethanshar ethanshar requested review from nitzanyiz and removed request for Inbal-Tish March 20, 2025 08:41
@adids1221 adids1221 assigned adids1221 and unassigned nitzanyiz Mar 23, 2025
{
"background": "#E8ECF0",
"flexed": true,
"snippet": "<View bg-$backgroundDefault padding-20><Picker label='Label' placeholder='Select' fieldType='settings'/></View>"
Copy link
Collaborator

@Inbal-Tish Inbal-Tish Mar 23, 2025

Choose a reason for hiding this comment

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

I think you need to remove the bg from the view, it looks off especially when adding the background color to the table cell (could be redundant too)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't <Picker padding-20 label='Label' placeholder='Select' fieldType='settings'/> better than adding the wrapper View?

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 doesn't look good when it's without the view, the View represent some sort of a list item the user can wrap it with
I think it's important to show a usage that make sense and visually more appealing
At the end the user can understand what to do with it (if they don't want to the wrapping view)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you flexed the container, removing the wrapper View and the component rendered fine (minus the padding, that can be added from the Picker), no? It did to me...
If the wrapper view is not the one flexing the component this example seems misleading and just adding a strange bg color that is not a part of the picker component...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Im adding the View for the white background not the flex
Unlike the other Picker example that looks good, in this case, without the background it just looks like two texts elements

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nvm I removed the wrapping View and used Picker's containerStyle instead

};
type ContentItemProps = {
item: Item;
componentName: string;
showCodeButton?: boolean;
isIncubator: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not pass category instead and check isIncubator here?

"content": [
{
"flexed": true,
"snippet": "<Picker preset='outline' placeholder='select' leadingAccessory={<Icon source={Assets.icons.general.favorite}/>} items={[{label: 'Selected Value', value: 1}]} value={1}/>"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This snippet not rendering...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@ethanshar ethanshar assigned Inbal-Tish and unassigned adids1221 Mar 24, 2025
@ethanshar ethanshar requested review from Inbal-Tish and removed request for nitzanyiz March 24, 2025 05:13
@ethanshar
Copy link
Collaborator Author

I also updated the examples now to add the chevronDown trailing accessory because I see it wasn't included in the component itself

@Inbal-Tish Inbal-Tish assigned ethanshar and unassigned Inbal-Tish Mar 24, 2025
@ethanshar ethanshar assigned Inbal-Tish and unassigned ethanshar Mar 24, 2025
@Inbal-Tish Inbal-Tish merged commit f874994 into master Mar 24, 2025
1 check passed
@Inbal-Tish Inbal-Tish deleted the docs/picker_docs branch March 24, 2025 09:02
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.

4 participants