matthewbub / calendar-widgets

Craft beautifully robust date components in React.
http://calendar-widgets.com/
MIT License
4 stars 13 forks source link

move `dayName` component to `Calendar.dayName` as a optional prop #200

Closed matthewbub closed 1 year ago

matthewbub commented 1 year ago

There is a block of code in the src/react/Calendar/Calendar.tsx file that is used to display the days of week. e.g S, M, T, W, T, F, S this code block is currently hardcoded into the return statement of the Calendar component.

We should modify this bit to live as a customizable component that library users can define themselves. Same as the dayComponent prop we already have defined in this file.

This is the block that should be extracted from the return statement

// ...
<div style={{ display: 'flex' }}>
    {dayNames.map((dayName, idx) =>
      <div key={idx} style={{ display: 'inline-block', width: '14.28%', textAlign: 'center' }}>
        {dayName}
      </div>
    )}
</div>
// ...

Tasks