Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@volvo-cars/site-nav-component
Advanced tools
High level site navigation component on volvocars.com
This is the global navigation component that can be found on volvocars.com
Install the package:
npm install @volvo-cars/site-nav-component
# or
yarn add @volvo-cars/site-nav-component
Styling and theming is handled with VCC UI:
npm install vcc-ui
<StyleProvider>
and <ThemeProvider>
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.
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 | Type | Description | Required | Default |
---|---|---|---|---|
data | SiteNavPayload | Data from VCC Content Delivery API | ✔︎ | null |
userMenuData | UserMenuPayload | Data for the user menu | null | |
children | jsx | Child nodes (sub navigation) to stick beneath the footer | null | |
enableMaxWidth | boolean | Enable max width for menu (1440px) | false | |
hideOnScroll | boolean | Hide navigation when scrolling down, enabled by default if given children prop | !!children | |
hideOnScrollOffsetTop | number | The amount of pixels that needs to be scrolled to hide the header, defaults to 80 | 80 |
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.
<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.
Please report any issues and bugs to the Web Impressions board in JIRA.
See our CHANGELOG
If you have any questions or need help using this component please shout out on the ced-wi-general
(Web Impressions) slack channel.
FAQs
High level site navigation component on volvocars.com
We found that @volvo-cars/site-nav-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.