Skip to content

Commit

Permalink
Merge pull request #864 from WestpacGEL/fix/site-nav-order
Browse files Browse the repository at this point in the history
Fix/site nav order
  • Loading branch information
jaortiz authored Sep 9, 2024
2 parents 98112c8 + 0f9cab3 commit 1d87967
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 9 deletions.
5 changes: 3 additions & 2 deletions apps/site/src/app/design-system/[brand]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export default async function DesignSystemLayout({
allContent.filter(i => !i.entry?.excludeFromNavbar).map(({ entry, slug }) => ({ slug, name: entry.name })),
),
);
const brand = (params?.brand ?? 'wbc') as BrandKey; // double check this is the best way to do this

const brand = (params?.brand ?? 'wbc') as BrandKey; // double check this is the best way to do this.

return (
<div data-theme={brand?.toLowerCase()}>
<SkipLink href="#content" className="z-[100]">
Skip to content
</SkipLink>
<div className="flex min-h-screen flex-col text-text active-theme-stg:text-heading">
<div className="text-text active-theme-stg:text-heading flex min-h-screen flex-col">
<SidebarContextProvider>
<Suspense>
<Sidebar items={formattedItems} brand={brand} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ The Rat said nothing, but stooped and unfastened a rope and hauled on it; then l

**Responsive tabcordion:** This a responsive component that can render as either [tabs](/components/tabs) or an accordion, depending on the screen width available.&nbsp;The tabcordion, can appear in either the default or lego style, see Visual design for the usage recommendations for either style.

1.

---

---

-

```jsx
<>
<Accordion className="sm:hidden">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ If the brand font is a web font (not a system font) then it should be self-hoste

Developers can [download web font files](https://westpacgroup.sharepoint.com/:f:/s/O365-UG-043642/EmCGwWc6TtVKrkd39ZL2lZMBK06NWlIvAl2wA3uOa4gnTQ) directly from SharePoint.

After downloading the font files, developers should follow the installation instructions outlined [here](/development/get-started) to add them to their project.
After downloading the font files, developers should follow the installation instructions outlined [here](/get-started/developers/) to add them to their project.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Content here

```jsx
<>
<Footer
brand="wbc"
hideLogo
>
<div>
<SecurityIcon
className="float-left shrink-0 max-md:mr-1 md:mr-2"
color="muted"
size={{
initial: 'small',
md: 'medium'
}}
/>
<p className="text-muted">
Our site and your online application are secure. For more information read our{' '}
<Link
href="https://www.westpac.com.au/security/"
type="inline"
>
information on security
</Link>
. © Copyright © Westpac Banking Corporation ABN 33 007 457 141 AFSL and Australian credit licence 233714.
</p>
</div>
</Footer>
</>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Designers
description: TBA
namedExport:
discriminant: false
excludeFromNavbar: true
design:
- title:
name: Designer's guide
slug: designers-guide
noTitle: false
noDemo: false
accessibility: []
relatedComponents: []
code: []
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Brand
name: Using brands
description: >-
In order to allow for the most flexibility when theming your application, you
can easily change your application to use any of Westpac Group's brands.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ESLint
name: ESLint configuration
description: >-
We suggest following the Westpac Group ESLint configuration.
design:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Get started
name: Set up
description: >-
The GEL design system is built using React. Use it to easily build new React
applications, as well as add to existing ones.
Expand Down
Empty file.
Empty file.
8 changes: 5 additions & 3 deletions apps/site/src/utils/format.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Item } from '@/app/design-system/components/sidebar/components/navigation/navigation.types';

export function formatComponentSlug(component: string) {
return component[0].toUpperCase() + component.slice(1);
const label = component.replace('-', ' ');
return label[0].toUpperCase() + label.slice(1);
}

export function formatNavItems(navList: { name: string; slug: string }[]) {
Expand Down Expand Up @@ -35,11 +36,12 @@ export function formatNavItems(navList: { name: string; slug: string }[]) {
// This had to be made as a separate function as adding some to formatNavItems too cognitively complex
export function sortMenu(menuItems: Item[]) {
const topLevelMenuOrder = [
'accessibility',
'home',
'get-started',
'foundation',
'components',
'patterns',
'development',
'accessibility',
'content',
'design tokens',
];
Expand Down

0 comments on commit 1d87967

Please sign in to comment.