Skip to content

Commit

Permalink
refactor(form-builder): refactor and improve styles of date input
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and bjoerge committed Mar 16, 2021
1 parent 05e6555 commit 735b50c
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 169 deletions.
@@ -1,6 +1,6 @@
import React, {useCallback} from 'react'
import FocusLock from 'react-focus-lock'
import {Box, Button, Layer, Popover, useClickOutside, useForwardedRef} from '@sanity/ui'
import {Box, Button, LayerProvider, Popover, useClickOutside, useForwardedRef} from '@sanity/ui'
import {CalendarIcon} from '@sanity/icons'
import {DatePicker} from './DatePicker'
import {LazyTextInput} from './LazyTextInput'
Expand Down Expand Up @@ -53,9 +53,8 @@ export const DateTimeInput = React.forwardRef(function DateTimeInput(
value={inputValue}
onChange={onInputChange}
suffix={
<Layer zOffset={1000}>
<LayerProvider zOffset={1000}>
<Popover
ref={setPopoverRef}
content={
<FocusLock onDeactivation={handleDeactivation}>
<DatePicker
Expand All @@ -67,9 +66,10 @@ export const DateTimeInput = React.forwardRef(function DateTimeInput(
/>
</FocusLock>
}
padding={1}
placement="bottom-end"
open={isPickerOpen}
placement="bottom-end"
ref={setPopoverRef}
radius={2}
>
<Box padding={1}>
<Button
Expand All @@ -82,7 +82,7 @@ export const DateTimeInput = React.forwardRef(function DateTimeInput(
/>
</Box>
</Popover>
</Layer>
</LayerProvider>
}
/>
)
Expand Down

0 comments on commit 735b50c

Please sign in to comment.