From b318daf34f1e5ec0cbc9e51062d113eafc6ac249 Mon Sep 17 00:00:00 2001 From: Fikri Karim Date: Mon, 30 Dec 2024 21:14:29 +0700 Subject: [PATCH] feat: add height prop to header and footer This commits also updates: - Make the Shape prop required. Makeswift supports this by default. - Add default values to height and weight that matches the Soul default values. - Move the banner id prop to be after allowClose. - Rename and move some variables. --- .../site-footer/site-footer.client.tsx | 15 ++++++----- .../site-footer/site-footer.makeswift.tsx | 3 ++- .../components/site-footer/site-footer.tsx | 4 +-- .../site-header/site-header.client.tsx | 26 ++++++++++--------- .../site-header/site-header.makeswift.tsx | 8 +++--- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/core/lib/makeswift/components/site-footer/site-footer.client.tsx b/core/lib/makeswift/components/site-footer/site-footer.client.tsx index d9e43d9736..60a935f799 100644 --- a/core/lib/makeswift/components/site-footer/site-footer.client.tsx +++ b/core/lib/makeswift/components/site-footer/site-footer.client.tsx @@ -32,10 +32,11 @@ export const PropsContextProvider = ({ ); interface Props { - logo?: { + logo: { show: boolean; src?: string; - width?: number; + width: number; + height: number; alt: string; }; sections: Array<{ @@ -63,17 +64,17 @@ function combineSections( } export const MakeswiftFooter = forwardRef( - ({ logo: _logo, sections, copyright }: Props, ref: Ref) => { + ({ logo, sections, copyright }: Props, ref: Ref) => { const passedProps = useContext(PropsContext); - const logoObject = _logo?.src ? { src: _logo.src, alt: _logo.alt } : passedProps.logo; - const logo = _logo?.show ? logoObject : undefined; + const logoObject = logo.src ? { src: logo.src, alt: logo.alt } : passedProps.logo; return (