From addbb3349c5fa305bb2fb200c04173d174897db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Fri, 28 Jun 2024 10:23:42 -0300 Subject: [PATCH 01/14] remove social icons --- src/components/NavigationMobile.tsx | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index 6f405da8..99a92545 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -1,18 +1,13 @@ -import { DiscordIcon } from '@pluralsh/design-system' - import { isEmpty } from 'lodash-es' import styled from 'styled-components' import { useIsomorphicLayoutEffect } from 'usehooks-ts' -import { DISCORD_LINK } from '@src/consts' import { useNavData } from '@src/contexts/NavDataContext' import { type NavListFragment } from '@src/generated/graphqlDirectus' -import GithubStars from './GithubStars' import useScrollLock from './hooks/useScrollLock' import { MainLink } from './Navigation' import { type NavContextValue, NavigationFull } from './NavigationFull' -import { SocialLink } from './PageHeaderButtons' const MobileMainLink = styled(MainLink)(({ theme }) => ({ paddingLeft: 0, @@ -34,12 +29,6 @@ type MobileMenuProps = NavContextValue & { className?: string } -const SocialIcons = styled.div(({ theme }) => ({ - display: 'flex', - marginTop: theme.spacing.xlarge, - gap: theme.spacing.medium, -})) - type NavData = ( | (NavListFragment & { subnav?: NavData | null @@ -97,17 +86,6 @@ function PluralMenuContent({ return (
- - - - - -
) } From 1b71ac800705f55d0facb1b7c41e65b290f3d67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Fri, 28 Jun 2024 10:50:25 -0300 Subject: [PATCH 02/14] add upper buttons --- src/components/NavigationMobile.tsx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index 99a92545..91c631a3 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -1,5 +1,7 @@ +import { ArrowRightIcon, Button } from '@pluralsh/design-system' + import { isEmpty } from 'lodash-es' -import styled from 'styled-components' +import styled, { useTheme } from 'styled-components' import { useIsomorphicLayoutEffect } from 'usehooks-ts' import { useNavData } from '@src/contexts/NavDataContext' @@ -82,9 +84,32 @@ function PluralMenuContent({ className?: string }) { const navData = useNavData() + const theme = useTheme() return (
+
+ + +
) From 7dde6af78e13485951e758d5870f951d96ad8933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Fri, 28 Jun 2024 11:03:02 -0300 Subject: [PATCH 03/14] add divider --- src/components/NavigationMobile.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index 91c631a3..c959fb19 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -1,4 +1,4 @@ -import { ArrowRightIcon, Button } from '@pluralsh/design-system' +import { ArrowRightIcon, Button, Divider } from '@pluralsh/design-system' import { isEmpty } from 'lodash-es' import styled, { useTheme } from 'styled-components' @@ -110,6 +110,10 @@ function PluralMenuContent({ Log in + ) From e0e40ea0ddf549b4f848955b1cf4aeaa4a597140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Fri, 28 Jun 2024 12:05:08 -0300 Subject: [PATCH 04/14] update navlist styles --- src/components/NavigationMobile.tsx | 69 +++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index c959fb19..05d64b2f 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -1,4 +1,9 @@ -import { ArrowRightIcon, Button, Divider } from '@pluralsh/design-system' +import { + Accordion, + ArrowRightIcon, + Button, + Divider, +} from '@pluralsh/design-system' import { isEmpty } from 'lodash-es' import styled, { useTheme } from 'styled-components' @@ -12,12 +17,9 @@ import { MainLink } from './Navigation' import { type NavContextValue, NavigationFull } from './NavigationFull' const MobileMainLink = styled(MainLink)(({ theme }) => ({ - paddingLeft: 0, - paddingRight: 0, - paddingTop: theme.spacing.xsmall, - paddingBottom: theme.spacing.xsmall, - marginBottom: theme.spacing.xsmall, + padding: theme.spacing.medium, width: '100%', + marginTop: 1, })) export const MenuHeading = styled.h6(({ theme }) => ({ @@ -39,40 +41,62 @@ type NavData = ( )[] function NavList({ navData }: { navData?: NavData | null }) { + const theme = useTheme() + if (!navData) { return null } return ( - <> +
{navData.map((navItem) => { if (!navItem) { return null } if (isEmpty(navItem?.subnav)) { return ( - } + style={{ + justifyContent: 'space-between', + padding: theme.spacing.medium, + borderColor: theme.colors.border, + }} > {navItem?.link?.title} - + ) } return ( -
- {navItem?.link?.title ? ( - {navItem?.link?.title} - ) : null} - -
+ {navItem.subnav?.map((subnavItem) => { + if (!subnavItem) { + return null + } + + return ( + + {subnavItem?.link?.title} + + ) + })} + ) })} - +
) } @@ -95,7 +119,10 @@ function PluralMenuContent({ primary fontFamily={theme.fontFamilies.sans} endIcon={} - style={{ justifyContent: 'space-between' }} + style={{ + justifyContent: 'space-between', + padding: theme.spacing.medium, + }} > Book a demo @@ -105,7 +132,11 @@ function PluralMenuContent({ secondary fontFamily={theme.fontFamilies.sans} endIcon={} - style={{ justifyContent: 'space-between' }} + style={{ + justifyContent: 'space-between', + padding: theme.spacing.medium, + borderColor: theme.colors.border, + }} > Log in From f26a2739977d443b06a40dbdfa74df0f8bc45907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Fri, 28 Jun 2024 12:18:39 -0300 Subject: [PATCH 05/14] add ProductMobileLink --- src/components/Navigation.tsx | 31 +++++++++++++++++++++++++++++ src/components/NavigationMobile.tsx | 22 ++++++++++++++++---- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 30ca15b3..6ab964c3 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -63,6 +63,37 @@ export const ProductLink = forwardRef( ) } ) +export const ProductMobileLink = forwardRef( + (props: ComponentProps, ref) => { + const { Link } = useNavigationContext() + + const itemConfig = productsConfigs[props.id || ''] + + return ( + +
+ {itemConfig?.navIcon} +
+ + {itemConfig?.title} + + + +
+ ) + } +) export const MainLinkBase = styled.a.withConfig({ shouldForwardProp: (prop) => !['isDisabled', 'isSelected'].includes(prop), diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index 05d64b2f..578bd8cf 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -13,11 +13,10 @@ import { useNavData } from '@src/contexts/NavDataContext' import { type NavListFragment } from '@src/generated/graphqlDirectus' import useScrollLock from './hooks/useScrollLock' -import { MainLink } from './Navigation' +import { MainLink, ProductMobileLink } from './Navigation' import { type NavContextValue, NavigationFull } from './NavigationFull' -const MobileMainLink = styled(MainLink)(({ theme }) => ({ - padding: theme.spacing.medium, +const MobileMainLink = styled(MainLink)(() => ({ width: '100%', marginTop: 1, })) @@ -49,7 +48,7 @@ function NavList({ navData }: { navData?: NavData | null }) { return (
- {navData.map((navItem) => { + {navData.map((navItem, navIndex) => { if (!navItem) { return null } @@ -82,12 +81,27 @@ function NavList({ navData }: { navData?: NavData | null }) { return null } + if (!navIndex) { + return ( + + {subnavItem?.link?.title} + + ) + } + return ( {subnavItem?.link?.title} From f60bd5ba76c8838f76d66ec479783ab4aea56bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Mon, 1 Jul 2024 13:12:07 -0300 Subject: [PATCH 06/14] update ds --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index c13c38f9..821e38f4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@markdoc/markdoc": "0.4.0", "@markdoc/next.js": "0.2.2", "@open-draft/until": "2.1.0", - "@pluralsh/design-system": "3.49.0", + "@pluralsh/design-system": "3.52.1", "@react-types/shared": "3.22.0", "@tanstack/react-table": "8.10.7", "@tanstack/react-virtual": "3.0.1", diff --git a/yarn.lock b/yarn.lock index 6faf5247..bb8d8240 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4276,9 +4276,9 @@ __metadata: languageName: node linkType: hard -"@pluralsh/design-system@npm:3.49.0": - version: 3.49.0 - resolution: "@pluralsh/design-system@npm:3.49.0" +"@pluralsh/design-system@npm:3.52.1": + version: 3.52.1 + resolution: "@pluralsh/design-system@npm:3.52.1" dependencies: "@floating-ui/react-dom-interactions": 0.13.3 "@loomhq/loom-embed": 1.5.0 @@ -4326,7 +4326,7 @@ __metadata: react-dom: ">=18.3.1" react-transition-group: ">=4.4.5" styled-components: ">=5.3.11" - checksum: 17b233f9eb16f2a94c2b5197d3ac12ee529fa65c298b092d43f4aec21bc3749cdf03953d9421bfb737fe728cb1993e5d1467b12f4d0373f0382be29a8770d123 + checksum: 1e802c690394138e35696e2e2e7b49d4af0a61bdabc27474118c65df2d0326b25031132906a0046d9e9b847a6ef99f3f9e6e8e4f4d38ea68af97eb1cc1d91969 languageName: node linkType: hard @@ -13743,7 +13743,7 @@ __metadata: "@markdoc/next.js": 0.2.2 "@next/bundle-analyzer": 13.4.12 "@open-draft/until": 2.1.0 - "@pluralsh/design-system": 3.49.0 + "@pluralsh/design-system": 3.52.1 "@pluralsh/eslint-config-typescript": 2.5.183 "@pluralsh/stylelint-config": 2.0.10 "@radix-ui/react-slot": 1.0.2 From 8ec4fccccf4944f24fc7b3f5a3685f6390eabc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Mon, 1 Jul 2024 13:14:37 -0300 Subject: [PATCH 07/14] fix item config --- src/components/Navigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 89fc7702..130b24bc 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -67,7 +67,7 @@ export const ProductMobileLink = forwardRef( (props: ComponentProps, ref) => { const { Link } = useNavigationContext() - const itemConfig = productsConfigs[props.id || ''] + const itemConfig = getProductsConfigs()[props.id || ''] return ( Date: Mon, 1 Jul 2024 13:28:40 -0300 Subject: [PATCH 08/14] update directus --- src/generated/graphqlDirectus.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/generated/graphqlDirectus.ts b/src/generated/graphqlDirectus.ts index 7abaecda..66ddb283 100644 --- a/src/generated/graphqlDirectus.ts +++ b/src/generated/graphqlDirectus.ts @@ -4721,6 +4721,7 @@ export type Create_Page_Community_Input = { export type Create_Page_Homepage_Input = { article_cards?: InputMaybe>>; + case_study?: InputMaybe>>; date_created?: InputMaybe; date_updated?: InputMaybe; featured_quote?: InputMaybe; @@ -5953,6 +5954,7 @@ export type Page_Homepage = { __typename?: 'page_homepage'; article_cards?: Maybe>>; article_cards_func?: Maybe; + case_study?: Maybe>>; date_created?: Maybe; date_created_func?: Maybe; date_updated?: Maybe; @@ -5975,6 +5977,16 @@ export type Page_HomepageArticle_CardsArgs = { }; +export type Page_HomepageCase_StudyArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + page?: InputMaybe; + search?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type Page_HomepageFeatured_QuoteArgs = { filter?: InputMaybe; limit?: InputMaybe; @@ -6019,6 +6031,7 @@ export type Page_Homepage_Filter = { _or?: InputMaybe>>; article_cards?: InputMaybe; article_cards_func?: InputMaybe; + case_study?: InputMaybe; date_created?: InputMaybe; date_created_func?: InputMaybe; date_updated?: InputMaybe; @@ -7967,6 +7980,7 @@ export type Update_Page_Community_Input = { export type Update_Page_Homepage_Input = { article_cards?: InputMaybe>>; + case_study?: InputMaybe>>; date_created?: InputMaybe; date_updated?: InputMaybe; featured_quote?: InputMaybe; From 6d595202fb3d73528a6f7cc360d6b25b4f4e8fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Mon, 1 Jul 2024 15:31:16 -0300 Subject: [PATCH 09/14] add solution nav style updates --- src/components/Navigation.tsx | 26 ++++++++ src/components/NavigationDesktop.tsx | 9 +++ src/components/menu/Menu.tsx | 97 +++++++++++++++++++++++++--- src/components/menu/SolutionNav.tsx | 79 ++++++++++++++++++++++ src/data/getSiteSettings.tsx | 6 +- src/generated/graphqlDirectus.ts | 15 ++++- src/graph/directus/cms.graphql | 3 +- 7 files changed, 221 insertions(+), 14 deletions(-) create mode 100644 src/components/menu/SolutionNav.tsx diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 130b24bc..01b5fa09 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -63,6 +63,32 @@ export const ProductLink = forwardRef( ) } ) + +export const SolutionLink = forwardRef( + (props: ComponentProps, ref) => { + const { Link } = useNavigationContext() + + return ( + + + {props.children} + + + + ) + } +) export const ProductMobileLink = forwardRef( (props: ComponentProps, ref) => { const { Link } = useNavigationContext() diff --git a/src/components/NavigationDesktop.tsx b/src/components/NavigationDesktop.tsx index 3db06a9a..f61791a2 100644 --- a/src/components/NavigationDesktop.tsx +++ b/src/components/NavigationDesktop.tsx @@ -9,6 +9,7 @@ import { type NavData, useNavData } from '@src/contexts/NavDataContext' import { mqs } from '../breakpoints' import { ProductTopNavMenu } from './menu/ProductNav' +import { SolutionTopNavMenu } from './menu/SolutionNav' import { TopNavMenu } from './menu/TopNavMenu' import { MainLink } from './Navigation' @@ -53,6 +54,14 @@ export const NavigationDesktop = styled( /> ) } + if (i === 1) { + return ( + + ) + } return ( ({ kind = 'default', left, ...props -}: MenuButtonProps & { kind?: 'product' | 'default'; left?: number }) { +}: MenuButtonProps & { + kind?: 'product' | 'default' | 'solution' + left?: number +}) { // Create state based on the incoming props const triggerState = useMenuTriggerState(props) @@ -145,13 +149,22 @@ export function MenuButton({ onClose={triggerState.close} floating={floating} > - - {children} - + {kind === 'solution' ? ( + + {children} + + ) : ( + + {children} + + )} ) @@ -167,7 +180,7 @@ function MenuDropdown({ ...props }: AriaMenuProps & { itemRenderer?: ItemRenderer - kind?: 'product' | 'default' + kind?: 'product' | 'default' | 'solution' }) { // Create menu state based on the incoming props const state = useTreeState(props) @@ -200,6 +213,72 @@ function MenuDropdown({ ) } +function SolutionNavDropdown({ + itemRenderer = MenuItem, + ...props +}: AriaMenuProps & { + itemRenderer?: ItemRenderer +}) { + // Create menu state based on the incoming props + const state = useTreeState(props) + + const collection = [...state.collection] + + const itemByCategory = collection.reduce((acc, item) => { + // @ts-ignore + const category = item?.value?.link?.category + + if (!category) return acc + + if (!acc[category]) { + acc[category] = [] + } + + acc[category].push(item) + + return acc + }, {}) + + // Get props for the menu element + const ref = React.useRef(null) + const { menuProps } = useMenu(props, state, ref) + + const ItemRenderer = itemRenderer + + return ( +
+ +
+ {Object.keys(itemByCategory).map((category) => ( +
+ + {category} + +
    + {itemByCategory[category].map((item) => ( + + ))} +
+
+ ))} +
+
+
+ ) +} + const DropdownCardSC = styled.div(({ theme }) => ({ overflowX: 'hidden', overflowY: 'auto', diff --git a/src/components/menu/SolutionNav.tsx b/src/components/menu/SolutionNav.tsx new file mode 100644 index 00000000..96a1233f --- /dev/null +++ b/src/components/menu/SolutionNav.tsx @@ -0,0 +1,79 @@ +import React, { useMemo } from 'react' + +import { useNavigationContext } from '@pluralsh/design-system' + +import { useMenuItem } from 'react-aria' +import { Item } from 'react-stately' +import styled, { useTheme } from 'styled-components' + +import { type NavList } from '@src/contexts/NavDataContext' + +import { SolutionLink } from '../Navigation' + +import { type ItemRendererProps, MenuButton } from './Menu' + +function SolutionTopNavMenuItem({ + item, + state, +}: ItemRendererProps) { + // Get props for the menu item element + const ref = React.useRef(null) + const { menuItemProps, isSelected, isDisabled } = useMenuItem( + { key: item.key }, + state, + ref + ) + + return ( + + + {item.rendered} + + + ) +} + +const TopNavMenuItemWrapper = styled.li((_) => ({})) + +export function SolutionTopNavMenu({ navItem }: { navItem: NavList }) { + const navigate = useNavigationContext().useNavigate() + const theme = useTheme() + const items = useMemo( + () => navItem?.subnav?.filter((item): item is NavList => !!item), + [navItem.subnav] + ) + + if (!items) { + return null + } + + return ( + { + const item = navItem.subnav?.find((item) => item?.id === key) + const url = item?.link?.url + + if (url) { + navigate(url) + } + }} + > + {({ ...item }) => ( + {item.link?.title} + )} + + ) +} diff --git a/src/data/getSiteSettings.tsx b/src/data/getSiteSettings.tsx index 485d6d8c..79ca7ffa 100644 --- a/src/data/getSiteSettings.tsx +++ b/src/data/getSiteSettings.tsx @@ -2,7 +2,8 @@ import { getProductsConfigs } from './getProductConfigs' type Solution = { slug?: string | null - title?: string | null + nav_title?: string | null + category } export const getSiteSettings = (solutions?: Solution[]) => ({ @@ -221,8 +222,9 @@ function getSolutionSubnav(solutions?: Solution[]) { id: solution.slug || '', link: { id: `${solution.slug}-${i}`, - title: solution.title, + title: solution.nav_title, url: `/solutions/${solution.slug}`, + category: solution.category, }, })) } diff --git a/src/generated/graphqlDirectus.ts b/src/generated/graphqlDirectus.ts index 66ddb283..3d9f25ad 100644 --- a/src/generated/graphqlDirectus.ts +++ b/src/generated/graphqlDirectus.ts @@ -4876,6 +4876,7 @@ export type Create_Solution_Problems_Input = { }; export type Create_Solutions_Pages_Input = { + category?: InputMaybe; date_created?: InputMaybe; date_updated?: InputMaybe; description?: InputMaybe; @@ -4885,6 +4886,7 @@ export type Create_Solutions_Pages_Input = { id?: InputMaybe; lower_features?: InputMaybe>>; lower_features_title?: InputMaybe; + nav_title?: InputMaybe; problems?: InputMaybe>>; slug: Scalars['String']['input']; sort?: InputMaybe; @@ -7209,6 +7211,7 @@ export type Solution_Problems_Filter = { export type Solutions_Pages = { __typename?: 'solutions_pages'; + category?: Maybe; date_created?: Maybe; date_created_func?: Maybe; date_updated?: Maybe; @@ -7221,6 +7224,7 @@ export type Solutions_Pages = { lower_features?: Maybe>>; lower_features_func?: Maybe; lower_features_title?: Maybe; + nav_title?: Maybe; problems?: Maybe>>; problems_func?: Maybe; slug: Scalars['String']['output']; @@ -7310,6 +7314,7 @@ export type Solutions_Pages_Aggregated = { export type Solutions_Pages_Aggregated_Count = { __typename?: 'solutions_pages_aggregated_count'; + category?: Maybe; date_created?: Maybe; date_updated?: Maybe; description?: Maybe; @@ -7319,6 +7324,7 @@ export type Solutions_Pages_Aggregated_Count = { id?: Maybe; lower_features?: Maybe; lower_features_title?: Maybe; + nav_title?: Maybe; problems?: Maybe; slug?: Maybe; sort?: Maybe; @@ -7340,6 +7346,7 @@ export type Solutions_Pages_Aggregated_Fields = { export type Solutions_Pages_Filter = { _and?: InputMaybe>>; _or?: InputMaybe>>; + category?: InputMaybe; date_created?: InputMaybe; date_created_func?: InputMaybe; date_updated?: InputMaybe; @@ -7352,6 +7359,7 @@ export type Solutions_Pages_Filter = { lower_features?: InputMaybe; lower_features_func?: InputMaybe; lower_features_title?: InputMaybe; + nav_title?: InputMaybe; problems?: InputMaybe; problems_func?: InputMaybe; slug?: InputMaybe; @@ -8145,6 +8153,7 @@ export type Update_Solution_Problems_Input = { }; export type Update_Solutions_Pages_Input = { + category?: InputMaybe; date_created?: InputMaybe; date_updated?: InputMaybe; description?: InputMaybe; @@ -8154,6 +8163,7 @@ export type Update_Solutions_Pages_Input = { id?: InputMaybe; lower_features?: InputMaybe>>; lower_features_title?: InputMaybe; + nav_title?: InputMaybe; problems?: InputMaybe>>; slug?: InputMaybe; sort?: InputMaybe; @@ -8277,7 +8287,7 @@ export type SolutionFragment = { __typename?: 'solutions_pages', id: string, slu export type SolutionsSlugsQueryVariables = Exact<{ [key: string]: never; }>; -export type SolutionsSlugsQuery = { __typename?: 'Query', solutions_pages: Array<{ __typename?: 'solutions_pages', slug: string, title?: string | null }> }; +export type SolutionsSlugsQuery = { __typename?: 'Query', solutions_pages: Array<{ __typename?: 'solutions_pages', slug: string, nav_title?: string | null, category?: string | null }> }; export type SolutionsQueryVariables = Exact<{ slug?: InputMaybe; @@ -8895,7 +8905,8 @@ export const SolutionsSlugsDocument = gql` query SolutionsSlugs { solutions_pages { slug - title + nav_title + category } } `; diff --git a/src/graph/directus/cms.graphql b/src/graph/directus/cms.graphql index 94eca9a0..b2319639 100644 --- a/src/graph/directus/cms.graphql +++ b/src/graph/directus/cms.graphql @@ -273,7 +273,8 @@ fragment Solution on solutions_pages { query SolutionsSlugs { solutions_pages { slug - title + nav_title + category } } From 4ae39a9fb0422dc4a8154ac8bd644631a484667d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Mon, 1 Jul 2024 15:45:19 -0300 Subject: [PATCH 10/14] fix type --- src/data/getSiteSettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/getSiteSettings.tsx b/src/data/getSiteSettings.tsx index 79ca7ffa..f93c68ef 100644 --- a/src/data/getSiteSettings.tsx +++ b/src/data/getSiteSettings.tsx @@ -3,7 +3,7 @@ import { getProductsConfigs } from './getProductConfigs' type Solution = { slug?: string | null nav_title?: string | null - category + category?: string | null } export const getSiteSettings = (solutions?: Solution[]) => ({ From 63d8ff5646ed3557583a3203a93d1e5180e63917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Tue, 2 Jul 2024 11:57:15 -0300 Subject: [PATCH 11/14] fix dropdown width --- src/components/menu/Menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/menu/Menu.tsx b/src/components/menu/Menu.tsx index 103ae3bd..f78b4f26 100644 --- a/src/components/menu/Menu.tsx +++ b/src/components/menu/Menu.tsx @@ -250,7 +250,7 @@ function SolutionNavDropdown({ ref={ref} {...menuProps} > - +
{Object.keys(itemByCategory).map((category) => (
From 31460a40f9788dc1f743483f6dce038b1925cf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Tue, 2 Jul 2024 11:59:28 -0300 Subject: [PATCH 12/14] add bg to accordion --- src/components/NavigationMobile.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index 578bd8cf..d96f81b2 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -75,6 +75,7 @@ function NavList({ navData }: { navData?: NavData | null }) { {navItem.subnav?.map((subnavItem) => { if (!subnavItem) { From 8de4722fc1b5d8508de18457f8759125a30f4dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Tue, 2 Jul 2024 12:03:05 -0300 Subject: [PATCH 13/14] ignore error --- src/components/NavigationMobile.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index d96f81b2..a917ffef 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -75,6 +75,7 @@ function NavList({ navData }: { navData?: NavData | null }) { {navItem.subnav?.map((subnavItem) => { From d29901e264ff4e55c60bc8ac2afb0f1c61f1ff5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Wed, 10 Jul 2024 08:23:10 -0300 Subject: [PATCH 14/14] check for title instead of index --- src/components/NavigationMobile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/NavigationMobile.tsx b/src/components/NavigationMobile.tsx index a917ffef..fe93c8ef 100644 --- a/src/components/NavigationMobile.tsx +++ b/src/components/NavigationMobile.tsx @@ -48,7 +48,7 @@ function NavList({ navData }: { navData?: NavData | null }) { return (
- {navData.map((navItem, navIndex) => { + {navData.map((navItem) => { if (!navItem) { return null } @@ -83,7 +83,7 @@ function NavList({ navData }: { navData?: NavData | null }) { return null } - if (!navIndex) { + if (navItem.link?.title === 'Product') { return (