From d0999c301464c12ae0982573fdd635e06db0411f Mon Sep 17 00:00:00 2001 From: Justyna <46591755+justyna-13@users.noreply.github.com> Date: Fri, 23 Jun 2023 12:47:30 +0200 Subject: [PATCH] feat: navbar top simple mobile (#2830) * feat: navbar top with simple mobile * feat: navbar top with simple mobile * fix: smaller iframe for navbars top --- apps/docs/components/blocks/NavbarTop.md | 34 ++++- .../NavbarTop/NavbarTopFilledSimpleMobile.tsx | 134 +++++++++++++++++ .../NavbarTop/NavbarTopSimpleMobile.tsx | 135 ++++++++++++++++++ .../NavbarTop/NavbarTopFilledSimpleMobile.vue | 131 +++++++++++++++++ .../NavbarTop/NavbarTopSimpleMobile.vue | 127 ++++++++++++++++ 5 files changed, 559 insertions(+), 2 deletions(-) create mode 100644 apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx create mode 100644 apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx create mode 100644 apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue create mode 100644 apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue diff --git a/apps/docs/components/blocks/NavbarTop.md b/apps/docs/components/blocks/NavbarTop.md index 596f514c53..e78bf1f156 100644 --- a/apps/docs/components/blocks/NavbarTop.md +++ b/apps/docs/components/blocks/NavbarTop.md @@ -11,7 +11,7 @@ hideToc: true ## NavbarTop with white background - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTop.vue @@ -24,7 +24,7 @@ hideToc: true ## NavbarTop with filled background - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilled.vue @@ -34,3 +34,33 @@ hideToc: true + +## NavbarTop with white background and simple mobile bar + +The alternate NavbarTop variant designed to work seamlessly with the NavbarBottom, providing a cohesive mobile navigation experience. + +By combining with the NavbarBottom, you can create a unified navigation structure that accommodates both top and bottom navigation elements on mobile devices. This ensures a smooth and intuitive user experience, allowing users to access important navigation options easily. + + + + +<<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue + + +<<<../../preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx#source + + + + +## NavbarTop with filled background and simple mobile bar + + + + +<<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue + + +<<<../../preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx#source + + + diff --git a/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx new file mode 100644 index 0000000000..695681882f --- /dev/null +++ b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx @@ -0,0 +1,134 @@ +/* eslint-disable jsx-a11y/anchor-is-valid */ +import { ShowcasePageLayout } from '../../showcases'; +// #region source +import { useState } from 'react'; +import { + SfButton, + SfIconShoppingCart, + SfIconFavorite, + SfIconPerson, + SfIconExpandMore, + SfInput, + SfIconSearch, + SfIconMenu, + SfIconArrowBack, +} from '@storefront-ui/react'; + +export default function TopNavFilled() { + const [inputValue, setInputValue] = useState(''); + + const actionItems = [ + { + icon: , + label: '', + ariaLabel: 'Cart', + role: 'button', + }, + { + icon: , + label: '', + ariaLabel: 'Wishlist', + role: 'button', + }, + { + label: 'Log in', + icon: , + ariaLabel: 'Log in', + role: 'login', + }, + ]; + + const search = (event: React.FormEvent) => { + event.preventDefault(); + alert(`Successfully found 10 results for ${inputValue}`); + }; + + return ( +
+
+ + + + + Sf Logo + + + + + + + + } + > + Browse products + +
+ + + + + + } + onChange={(event) => setInputValue(event.target.value)} + /> + + +
+
+ ); +} + +// #endregion source +TopNavFilled.getLayout = ShowcasePageLayout; diff --git a/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx new file mode 100644 index 0000000000..7088d93e39 --- /dev/null +++ b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx @@ -0,0 +1,135 @@ +/* eslint-disable no-alert */ +/* eslint-disable jsx-a11y/anchor-is-valid */ +import { ShowcasePageLayout } from '../../showcases'; +// #region source +import { useState } from 'react'; +import { + SfButton, + SfIconShoppingCart, + SfIconFavorite, + SfIconPerson, + SfIconExpandMore, + SfInput, + SfIconSearch, + SfIconMenu, + SfIconArrowBack, +} from '@storefront-ui/react'; + +export default function TopNavSimpleMobile() { + const [inputValue, setInputValue] = useState(''); + + const actionItems = [ + { + icon: , + label: '', + ariaLabel: 'Cart', + role: 'button', + }, + { + icon: , + label: '', + ariaLabel: 'Wishlist', + role: 'button', + }, + { + label: 'Log in', + icon: , + ariaLabel: 'Log in', + role: 'login', + }, + ]; + + const search = (event: React.FormEvent) => { + event.preventDefault(); + alert(`Successfully found 10 results for ${inputValue}`); + }; + + return ( +
+
+ + + + + Sf Logo + + + + + + + + } + > + Browse products + +
+ + + + + + } + onChange={(event) => setInputValue(event.target.value)} + /> + + +
+
+ ); +} + +// #endregion source +TopNavSimpleMobile.getLayout = ShowcasePageLayout; diff --git a/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue new file mode 100644 index 0000000000..f2a678935c --- /dev/null +++ b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue @@ -0,0 +1,131 @@ + + diff --git a/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue new file mode 100644 index 0000000000..d458169256 --- /dev/null +++ b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue @@ -0,0 +1,127 @@ + +