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

Option to have full-width cell in structuredListItem when there is only one child #690

Closed
Xin00163 opened this issue Mar 7, 2023 · 0 comments
Labels
triage This issue will be reviewed by the team

Comments

@Xin00163
Copy link
Contributor

Xin00163 commented Mar 7, 2023

Is your feature request related to a problem? Please describe.

When there is only one child, the user would like to remove the padding around the cell. Currently this is not doable in structuredListCell because it's using xs={12}.

Describe the solution you'd like

Ideally we should have an option to pass xs='full-width'so the padding will be removed.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.
Add a prop like below

      if (childrenArray.length === 1) {
        return (
          <StyledGrid
            xsRowGutter="space000"
            xsMargin="space020"
            lgMargin="space030"
            overrides={overrides}
            hasHref={hasHref}
          >
            <StyledCell xs={fullWidthCell? 'full-width': 12} align={alignCell1}>
              {childrenArray[0]}
            </StyledCell>
          </StyledGrid>
        );
      }

Additional context

Copy the below scenario in storybook to view the issue

        <StructuredList
          ariaLabel="list"
          overrides={{
            paddingInline: 'space000',
            paddingBlock: 'space000',
            width: 'unset',
          }}
        >
          <StructuredListItem
            ariaLabel="list item"
            overrides={{
              paddingInline: 'space000',
              paddingBlock: 'space000',
            }}
          >
            <StructuredListCell>
              <HeadingTextBlock>[Cell 1]</HeadingTextBlock>
            </StructuredListCell>
          </StructuredListItem>
        </StructuredList>
@Xin00163 Xin00163 added the triage This issue will be reviewed by the team label Mar 7, 2023
@Xin00163 Xin00163 closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This issue will be reviewed by the team
Projects
None yet
Development

No branches or pull requests

1 participant