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

[PLAY-1742] Global Height Fixes #3972

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions playbook/app/pb_kits/playbook/pb_drawer/_drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
{...ariaProps}
{...dataProps}
{...htmlProps}
style={dynamicInlineProps}
className={classnames(drawerClassNames.base, {
[drawerClassNames.afterOpen]:
animationState === "afterOpen",
Expand All @@ -296,6 +295,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
})}
id={id}
onClick={(e) => e.stopPropagation()}
style={dynamicInlineProps}
>
{children}
</div>
Expand All @@ -306,7 +306,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
{...dataProps}
{...htmlProps}
className={classes}
style={dynamicInlineProps}
>
{isModalVisible && (
<div
Expand All @@ -327,6 +326,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
animationState === "beforeClose",
})}
onClick={(e) => e.stopPropagation()}
style={dynamicInlineProps}
>
{children}
</div>
Expand Down
41 changes: 30 additions & 11 deletions playbook/app/pb_kits/playbook/pb_layout/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,37 @@ type LayoutPropTypes = {
type LayoutSideProps = {
children: React.ReactNode[] | React.ReactNode,
className?: string,
}
} & GlobalProps

type LayoutBodyProps = {
children: React.ReactNode[] | React.ReactNode,
className?: string,
}
} & GlobalProps

type LayoutItemProps = {
children: React.ReactNode[] | React.ReactNode,
className?: string,
size?: "sm" | "md" | "lg"
}
} & GlobalProps

type LayoutHeaderProps = {
children: React.ReactNode[] | React.ReactNode,
className?: string,
}
} & GlobalProps

type LayoutFooterProps = {
children: React.ReactNode[] | React.ReactNode,
className?: string,
}
} & GlobalProps

// Side component
const Side = (props: LayoutSideProps) => {
const { children, className } = props
const dynamicInlineProps = globalInlineProps(props)
return (
<div className={classnames('layout_sidebar', globalProps(props), className)}>
<div
className={classnames('layout_sidebar', globalProps(props), className)}
style={dynamicInlineProps}
>
{children}
</div>
)
Expand All @@ -60,8 +63,12 @@ const Side = (props: LayoutSideProps) => {
// Body component
const Body = (props: LayoutBodyProps) => {
const { children, className } = props
const dynamicInlineProps = globalInlineProps(props)
return (
<div className={classnames('layout_body', globalProps(props), className)}>
<div
className={classnames('layout_body', globalProps(props), className)}
style={dynamicInlineProps}
>
{children}
</div>
)
Expand All @@ -71,8 +78,12 @@ const Body = (props: LayoutBodyProps) => {
const Item = (props: LayoutItemProps) => {
const { children, className, size = 'sm' } = props
const sizeClass = `size_${size}`
const dynamicInlineProps = globalInlineProps(props)
return (
<div className={classnames('layout_item', sizeClass, globalProps(props), className)}>
<div
className={classnames('layout_item', sizeClass, globalProps(props), className)}
style={dynamicInlineProps}
>
{children}
</div>
)
Expand All @@ -81,8 +92,12 @@ const Item = (props: LayoutItemProps) => {
// Header component
const Header = (props: LayoutHeaderProps) => {
const { children, className } = props
const dynamicInlineProps = globalInlineProps(props)
return (
<div className={classnames('layout_header', globalProps(props), className)}>
<div
className={classnames('layout_header', globalProps(props), className)}
style={dynamicInlineProps}
>
{children}
</div>
)
Expand All @@ -91,8 +106,12 @@ const Header = (props: LayoutHeaderProps) => {
// Footer component
const Footer = (props: LayoutFooterProps) => {
const { children, className } = props
const dynamicInlineProps = globalInlineProps(props)
return (
<div className={classnames('layout_footer', globalProps(props), className)}>
<div
className={classnames('layout_footer', globalProps(props), className)}
style={dynamicInlineProps}
>
{children}
</div>
)
Expand Down
Loading