Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondThundeR committed Oct 9, 2023
2 parents 58fc8b9 + a09fecc commit e9de1b2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secondthunder/modsen-date-picker-library",
"version": "0.1.0",
"version": "0.1.1",
"description": "Date picker example library",
"repository": {
"type": "git",
Expand Down
37 changes: 19 additions & 18 deletions src/components/RangePicker/RangePicker.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";

import {
withHolidays,
withHolidaysAPI,
withMondayFirst,
withTodos,
withWeekends,
} from "@/hocs";
import { withMondayFirst, withTodos, withWeekends } from "@/hocs";

import RangePicker from "./RangePicker";

Expand Down Expand Up @@ -43,6 +37,15 @@ const meta: Meta<typeof RangePicker> = {
holidays: {
name: "Holidays data",
description: "Defines data for days, which defined as holidays",
defaultValue: {},
},
holidayCountry: {
name: "Holidays country",
description: "Defines country for holidays, fetched with API",
},
holidayYear: {
name: "Holidays year",
description: "Defines year for holidays, fetched with API",
},
},
args: {
Expand All @@ -60,19 +63,17 @@ export const WithWeekendsHOC: Story = {
render: () => <RangePickerWithWeekends />,
};

const RangePickerWithHolidays = withHolidays(RangePicker, {
[new Date().getMonth() + 1]: [2, 10, 18, 19, 20, 30],
});
export const WithHolidaysHOC: Story = {
render: () => <RangePickerWithHolidays />,
export const RangePickerWithHolidays: Story = {
args: {
holidays: { [new Date().getMonth() + 1]: [2, 10, 18, 19, 20, 30] },
},
};

const RangePickerWithHolidaysAPI = withHolidaysAPI(RangePicker, {
holidayCountry: "BY",
year: 2022,
});
export const WithHolidaysApiHOC: Story = {
render: () => <RangePickerWithHolidaysAPI />,
export const RangePickerWithHolidaysAPI: Story = {
args: {
holidayCountry: "BY",
holidayYear: 2022,
},
};

const RangePickerWithMondayFirst = withMondayFirst(RangePicker);
Expand Down
6 changes: 6 additions & 0 deletions src/components/RangePicker/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const RangePicker = memo(function RangePicker({
startDate,
endDate,
holidays,
holidayCountry,
holidayYear,
isSundayFirst,
displayWeekends,
isTodosEnabled,
Expand All @@ -27,6 +29,8 @@ const RangePicker = memo(function RangePicker({
isPickingStart
endDate={endDate}
holidays={holidays}
holidayCountry={holidayCountry}
holidayYear={holidayYear}
startRange={startRange}
endRange={endRange}
isSundayFirst={isSundayFirst}
Expand All @@ -40,6 +44,8 @@ const RangePicker = memo(function RangePicker({
endDate={endDate}
isPickingEnd
holidays={holidays}
holidayCountry={holidayCountry}
holidayYear={holidayYear}
startRange={startRange}
endRange={endRange}
isSundayFirst={isSundayFirst}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "@/components";
export * from "@/hocs";
export { withMondayFirst, withTodos, withWeekends } from "@/hocs";

0 comments on commit e9de1b2

Please sign in to comment.