From 1df155760066e8959c3aef9de89bdc3dce678e7d Mon Sep 17 00:00:00 2001 From: matt423 Date: Mon, 14 Oct 2024 16:40:11 +0100 Subject: [PATCH] chore: Add searchDataId to Meganav options Option allows to change the data-id that the search components use. --- src/core/Meganav.tsx | 16 ++++++++-- src/core/Meganav/Meganav.stories.tsx | 30 +++++++++++++++++++ src/core/MeganavItemsMobile.tsx | 6 +++- src/core/MeganavItemsSignedIn.tsx | 4 ++- src/core/MeganavSearch.tsx | 10 +++++-- .../MeganavSearchSuggestions/component.js | 8 ++--- 6 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/core/Meganav.tsx b/src/core/Meganav.tsx index ce237d75a..e72a94f3d 100644 --- a/src/core/Meganav.tsx +++ b/src/core/Meganav.tsx @@ -83,6 +83,7 @@ type SignInProps = { theme: MeganavTheme; loginLink: string; absUrl: AbsUrl; + searchDataId?: string; }; type MeganavProps = { @@ -106,14 +107,22 @@ type MeganavProps = { urlBase?: string; addSearchApiKey: string; statusUrl: string; + searchDataId?: string; }; -const SignIn = ({ sessionState, theme, loginLink, absUrl }: SignInProps) => { +const SignIn = ({ + sessionState, + theme, + loginLink, + absUrl, + searchDataId, +}: SignInProps) => { return sessionState.signedIn ? ( ) : (