Skip to content

Commit

Permalink
fix: small fixes and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
grzracz committed Jul 6, 2021
1 parent 5bb7592 commit 7895e20
Show file tree
Hide file tree
Showing 11 changed files with 295 additions and 271 deletions.
6 changes: 3 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import Header from './components/Header'
import DatePickerDemo from './components/DatePickerDemo'
import Header from './components/Header/Header'
import DatePickerDemo from './components/DatePickerDemo/DatePickerDemo'
import InstallationGuide from './components/InstallationGuide'
import Documentation from './components/Documentation'
import Documentation from './components/Documentation/Documentation'

const App = () => {
return (
Expand Down
4 changes: 3 additions & 1 deletion example/src/components/DatePickerDemo/CheckboxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const CheckboxInput: FC<CheckboxInputProps> = ({
<input
type='checkbox'
checked={checked}
onClick={() => (updateChecked ? updateChecked(!checked) : {})}
onChange={(event) =>
updateChecked ? updateChecked(event.target.checked) : {}
}
/>{' '}
{children}
</div>
Expand Down
23 changes: 18 additions & 5 deletions example/src/components/DatePickerDemo/DatePickerDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react'
import { DatePicker } from '../dist'
import { Dayjs } from 'dayjs'
import { DatePicker } from 'react-dayjs-picker'
import { LeftOutlined, ReloadOutlined, RightOutlined } from '@ant-design/icons'
import CheckboxInput from './CheckboxInput'

Expand Down Expand Up @@ -42,6 +42,7 @@ const DatePickerDemo = () => {
closeOnSelect={closeOnSelect}
disableBeforeToday={disableBeforeToday}
markToday={markToday}
onChange={() => console.log}
format={customFormat ? 'D MMMM YYYY' : undefined}
disableDates={
disableCustomDates
Expand Down Expand Up @@ -69,10 +70,16 @@ const DatePickerDemo = () => {
<CheckboxInput checked={markToday} updateChecked={setMarkToday}>
mark today
</CheckboxInput>
<CheckboxInput checked={disableBeforeToday} updateChecked={setDisableBeforeToday}>
<CheckboxInput
checked={disableBeforeToday}
updateChecked={setDisableBeforeToday}
>
disable dates before today
</CheckboxInput>
<CheckboxInput checked={disableCustomDates} updateChecked={setDisableCustomDates}>
<CheckboxInput
checked={disableCustomDates}
updateChecked={setDisableCustomDates}
>
disable custom dates
</CheckboxInput>
<CheckboxInput checked={closeOnSelect} updateChecked={setCloseOnSelect}>
Expand All @@ -81,10 +88,16 @@ const DatePickerDemo = () => {
<CheckboxInput checked={customFormat} updateChecked={setCustomFormat}>
custom date format
</CheckboxInput>
<CheckboxInput checked={customPosition} updateChecked={setCustomPosition}>
<CheckboxInput
checked={customPosition}
updateChecked={setCustomPosition}
>
custom position
</CheckboxInput>
<CheckboxInput checked={customComponents} updateChecked={setCustomComponents}>
<CheckboxInput
checked={customComponents}
updateChecked={setCustomComponents}
>
render custom components
</CheckboxInput>
<div>...and more</div>
Expand Down
Loading

0 comments on commit 7895e20

Please sign in to comment.