Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(TextDateInput): Add new precise date input component #3841

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ellajay
Copy link
Contributor

@ellajay ellajay commented Jun 21, 2024

Screenshot / video

image

What does this do?

Adds a new TextDateInput component that allows for a precise date to be entered in specific day, month and year input fields

@ellajay ellajay self-assigned this Jun 21, 2024
import { Box } from '../Box'
import { Fieldset, FieldsetProps } from '../fields/Fieldset'

export type FullDateFormat = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually renamed in in sign-up. We could match is so that it is DateObjectType

| 'day'
| 'month'
| 'year'
| 'all'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there will be more errors types encopassed under all. Maybe a better approach would be to pass an array as a prop for example, fieldsWithError: ['day', 'month'] and we will evaluate it whereever we use it?

}

const Template: FC = (props: TextDateInputProps) => {
const [_value, setValue] = useState<FullDateFormat>({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it _value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was left over from a previous approach where there was already a value defined, we can use value now though so I'll update this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants