Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volvo-cars/site-nav-component

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volvo-cars/site-nav-component

High level site navigation component on volvocars.com

  • 3.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created
Source

Site Navigation for volvocars.com

@volvo-cars/site-nav-component @volvo-cars/site-nav-component

This is the global navigation component that can be found on volvocars.com

screenshot desktopscreenshot mobile

Install

Install the package:

npm install @volvo-cars/site-nav-component
# or
yarn add @volvo-cars/site-nav-component

Requirements

Styling and theming is handled with VCC UI:

  1. npm install vcc-ui
  2. Wrap your application in a <StyleProvider> and <ThemeProvider>
  3. Configure at least the following static assets for VCC UI (example configuration):
    • The "Volvo Logo"
    • The "Volvo Novum Light", "Volvo Novum Regular" and "Volvo Broad" fonts

Browser support and polyfills

The code is compiled to match @volvo-cars/browserslist-config but you also need to include some runtime polyfills to support old browsers. We recommend the @volvo-cars/polyfill package.

If you have given a sub navigation (through the children prop), we will measure it once at component mount to determine the height the site nav should occupy. We use ResizeObserver to re-measure the sub navigation, so if you have a sub navigation that will hide or resize you should add a ResizeObserver polyfill.

Usage

The data and content are not provided in this package. You will need to fetch content from the VCC Content Delivery API. Please contact Content Delivery API team for more information.

import { SiteNav } from "@volvo-cars/site-nav-component"

const myApp() (
  ...
  <SiteNav
    data={dataFromContentDeliveryAPI}
  />
  ...
)

Props

PropsTypeDescriptionRequiredDefault
dataSiteNavPayloadData from VCC Content Delivery API✔︎null
userMenuDataUserMenuPayloadData for the user menunull
childrenjsxChild nodes (sub navigation) to stick beneath the footernull
enableMaxWidthbooleanEnable max width for menu (1440px)false
hideOnScrollbooleanHide navigation when scrolling down, enabled by default if given children prop!!children
hideOnScrollOffsetTopnumberThe amount of pixels that needs to be scrolled to hide the header, defaults to 8080

User Menu Data

The data for user menu is also not provided in this package. You will need to fetch the data from the My Volvo API. the production endpoints are like this: https://www.volvocars.com/data/dynamic/myvolvo/menu?sc_site=${marketCode}

Embedded Search should work out of the box, but since it is using fetch to get the search suggestions, your application might need to pollyfill fetch to support older browsers (i.e. IE 11). We use isomorphic-unfetch npm package.

Tracking

<SiteNav> component is doing click tracking if you set up Google Tag Manager (GTM) properly on your page. If you don't have GTM it should silently ignore and work as usual.

We highly recommend you to enable tracking. It will allow us to have a better understating of the actual usage of the component and improve it based on the data we gather.

Please contact the analytics team in order to set up the Google Tag Manager.

Bug Report

Please report any issues and bugs to the Web Impressions board in JIRA.

Changelog

See our CHANGELOG

Support

If you have any questions or need help using this component please shout out on the ced-wi-general (Web Impressions) slack channel.

Keywords

FAQs

Package last updated on 01 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc