Skip to content

Commit

Permalink
Allow classname prop for WpAdminContainer (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadahmad21 authored Oct 18, 2024
1 parent 308c580 commit 2ee3224
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/js/shared-ui/components/wp-admin-container.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
import { cn } from '@wpsocio/ui-components';

export type WpAdminContainerProps = {
children?: React.ReactNode;
sidebar: React.ReactNode;
wrapperClassName?: string;
};

export function WpAdminContainer({ children, sidebar }: WpAdminContainerProps) {
export function WpAdminContainer({
children,
sidebar,
wrapperClassName,
}: WpAdminContainerProps) {
return (
<>
<style>
{
'#wpcontent { padding-left: 0 !important; padding-right: 0 !important; }'
}
</style>
<div className="flex flex-col md:flex-row gap-4 p-3 sm:p-6">
<div
className={cn(
'flex flex-col md:flex-row gap-4 p-3 sm:p-6',
wrapperClassName,
)}
>
<div className="md:basis-2/3 xl:basis-3/4 shrink-0">{children}</div>
<div className="md:basis-1/3 xl:basis-1/4">{sidebar}</div>
</div>
Expand Down

0 comments on commit 2ee3224

Please sign in to comment.