How to use the @mapbox/batfish/data/holidays-data.map function in @mapbox/batfish

To help you get started, we’ve selected a few @mapbox/batfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / batfish / examples / miscellany / src / components / holiday-wrapper.js View on Github external
import React from 'react';
import holidaysData from '@mapbox/batfish/data/holidays-data';
import PageShell from './page-shell';
import SidebarNavigation from './sidebar-navigation';

const sidebarItems = holidaysData.map((holiday) => {
  return {
    content: (
      <div>
        {holiday.frontMatter.title}
        <div>({holiday.frontMatter.date})</div>
      </div>
    ),
    url: holiday.path
  };
});

export default class HolidayWrapper extends React.Component {
  render() {
    const { props } = this;

    return (
github mapbox / batfish / examples / miscellany / src / pages / holidays / index.js View on Github external
render() {
    const { props } = this;

    const holidayItems = holidaysData.map((holiday) =&gt; {
      return (
        <a href="{holiday.path}">
          <div>
            {holiday.frontMatter.title}
          </div>
          <div>({holiday.frontMatter.date})</div>
        </a>
      );
    });

    return (