-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
86 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 8 additions & 24 deletions
32
storefront/components/Pages/CategoryDetail/AdvancedSeoCategories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,24 @@ | ||
import { ExtendedNextLink } from 'components/Basic/ExtendedNextLink/ExtendedNextLink'; | ||
import { SimpleNavigation } from 'components/Blocks/SimpleNavigation/SimpleNavigation'; | ||
import { CategoryDetailFragmentApi } from 'graphql/generated'; | ||
import useTranslation from 'next-translate/useTranslation'; | ||
import { twJoin } from 'tailwind-merge'; | ||
|
||
type AdvancedSeoCategoriesProps = { | ||
readyCategorySeoMixLinks: CategoryDetailFragmentApi['readyCategorySeoMixLinks']; | ||
}; | ||
|
||
const simpleNavigationItemTwClass = 'lg:justify-center text-center'; | ||
|
||
export const AdvancedSeoCategories: FC<AdvancedSeoCategoriesProps> = ({ readyCategorySeoMixLinks }) => { | ||
const { t } = useTranslation(); | ||
|
||
if (readyCategorySeoMixLinks.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<> | ||
<div className="mb-3 break-words font-bold text-dark lg:text-lg">{t('Favorite categories')}</div> | ||
|
||
<ul className="mb-5 grid snap-x snap-mandatory auto-cols-[40%] gap-3 overflow-x-auto overscroll-x-contain max-lg:grid-flow-col lg:grid-cols-[repeat(auto-fill,minmax(210px,1fr))]"> | ||
{readyCategorySeoMixLinks.map((seoMixLink, index) => ( | ||
<li key={index} className="snap-start"> | ||
<ExtendedNextLink | ||
href={`/${seoMixLink.slug}`} | ||
type="static" | ||
className={twJoin( | ||
'flex h-full items-center justify-center rounded bg-greyVeryLight p-3 text-center text-sm text-dark no-underline', | ||
'hover:bg-whitesmoke hover:text-dark hover:no-underline', | ||
'active:bg-whitesmoke active:text-dark active:no-underline', | ||
)} | ||
> | ||
{seoMixLink.name} | ||
</ExtendedNextLink> | ||
</li> | ||
))} | ||
</ul> | ||
<SimpleNavigation | ||
listedItems={readyCategorySeoMixLinks} | ||
className="mb-5" | ||
itemClassName={simpleNavigationItemTwClass} | ||
/> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters