Skip to content

Commit

Permalink
add url prop (#61)
Browse files Browse the repository at this point in the history
add  prop
  • Loading branch information
BrookJeynes authored Feb 12, 2024
1 parent f9cfd51 commit 682aa00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export function getStaticProps() {
| `menuBarItems` | `MenuBarItem[]` | An array of objects that represent the menu bar items provided by SSR or other data fetching mechanisms. If this prop isn't supplied, the component will fetch the data from the Next.js API route. | No |
| `title` | `string` | The title text displayed next to the SSW logo. | Yes (If there is no `tagline` provided) |
| `subtitle` | `string` | The text displayed underneath the SSW logo | No |
| `tagline` | `string` | The URL of the menu bar item. | No |
| `tagline` | `string` | The text displayed next the SSW Logo. | No |
| `url` | `string` | The URL of the menu bar item. | No |
| `searchUrl` | `string` | The absolute URL the search takes you to. If not provided, will default to the host address. i.e. for SSW <www.ssw.com.au> | No |
| `rightSideActionsOverride` | `() => JSX.Element` | The component to replace the "Call Us" and search buttons that are displayed by default on the right side of the menu. | No |

Expand Down
4 changes: 3 additions & 1 deletion lib/components/MegaMenuLayout/MegaMenuLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Search } from "../Search";

export type MegaMenuWrapperProps = {
menuBarItems?: NavMenuGroup[];
url?: string;
subtitle?: string;
searchUrl?: string;
rightSideActionsOverride?: () => JSX.Element;
Expand All @@ -30,6 +31,7 @@ type Title = {
const MegaMenuLayout: React.FC<MegaMenuWrapperProps> = ({
tagline,
title,
url,
subtitle,
searchUrl,
menuBarItems,
Expand All @@ -49,7 +51,7 @@ const MegaMenuLayout: React.FC<MegaMenuWrapperProps> = ({
aria-label="Global"
>
<div className="flex items-center">
<CustomLink href="/" className="gap-1 whitespace-nowrap">
<CustomLink href={url || "/"} className="gap-1 whitespace-nowrap">
<div className="flex min-w-[4rem] max-w-[14rem] items-center justify-center">
<Logo />

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssw.megamenu",
"version": "4.0.1",
"version": "4.0.2",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down

0 comments on commit 682aa00

Please sign in to comment.