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

fix issue where layout title would be left aligned #2463

Merged
merged 2 commits into from
Dec 20, 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
6 changes: 6 additions & 0 deletions .changeset/orange-olives-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphcommerce/next-ui": patch
"@graphcommerce/magento-graphcms": patch
---

Fix issue where layout title would be left aligned
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { LayoutTitle, memoDeep, StickyBelowHeader, Container } from '@graphcommerce/next-ui'
import { ProductListItems } from '../ProductListItems'
import { ProductListLayoutProps } from './types'
import { Trans } from '@lingui/macro'

export const ProductListLayoutClassic = memoDeep((props: ProductListLayoutProps) => {
const { filters, filterTypes, params, products, title, category } = props
Expand All @@ -39,7 +40,6 @@ export const ProductListLayoutClassic = memoDeep((props: ProductListLayoutProps)
variant='h1'
sx={(theme) => ({
mb: (category?.description || category?.children) && theme.spacings.md,
alignItems: { xs: 'center', md: 'center' },
})}
gutterBottom={!category?.description && category?.children?.length === 0}
>
Expand All @@ -57,8 +57,8 @@ export const ProductListLayoutClassic = memoDeep((props: ProductListLayoutProps)
</CategoryChildren>
</>
) : (
<LayoutTitle gutterTop variant='h1' sx={{ alignItems: { xs: 'center', md: 'center' } }}>
Search {params.search}
<LayoutTitle gutterTop variant='h1'>
<Trans>Search</Trans> {params.search}
</LayoutTitle>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ export const ProductListLayoutDefault = memoDeep((props: ProductListLayoutProps)

{category ? (
<>
<LayoutTitle
gutterTop
variant='h1'
sx={{ alignItems: { xs: 'left', md: 'center' } }}
gutterBottom={false}
>
<LayoutTitle gutterTop variant='h1' gutterBottom={false}>
{title}
</LayoutTitle>
<CategoryDescription
Expand Down
1 change: 1 addition & 0 deletions packages/next-ui/Layout/components/LayoutTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const LayoutTitle = React.forwardRef<HTMLDivElement, TitleProps>((props,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
gap: '6px',
'&.sizeSmall': {
overflow: 'hidden',
Expand Down
Loading