Skip to content

Sticky header for PageShell #180

@zoubingwu

Description

@zoubingwu

Here is a case that we want to just use fixed header and not passing children to PageShell:

https://github.com/tidbcloud/dbaas-ui/blob/728fa1f13ac07e4e9f9835677aefbb0ddbbca8f8/src/dbaas/screens/OrgSettings/features/Billing/Billing.tsx#L43

const HistoryShell: React.FC<{}> = ({ children }) => {
  const history = useHistory()
  return (
    <Box>
      <PageShell
        headerProps={{
          withBack: true,
          onBackClick: () => {
            history.push('/console/org-settings/billing')
          }
        }}
        bodyProps={{
          pb: 0
        }}
        title="History"
      ></PageShell>
      {children}
    </Box>
  )
}
image

this is resolved by making children props optional, see #179

we might need a props to make header sticky when scrolling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions