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

1672: Improve birthday field #1767

Open
wants to merge 2 commits into
base: 1670-show-form-hints
Choose a base branch
from

Conversation

f1sh1918
Copy link
Contributor

Short description

As a koblenz pass applicant i want to provide my birthday easily on a mobile device

Proposed changes

  • added a custom mui datepicker in desktop variant that enables date input with (virtual) keyboard
  • improved datepicker usage by choosing date -> month -> day on calendar icon click and dropdown
  • add error hint
  • adjusted the clearButton slightly to fit better to material icons

Note

  • it makes sense to reuse this component for other date inputs to unify behavior and especially for the application process for bavaria we should reuse this approach even the styling is a bit different Unify Datepicker components #1766
  • the style for the calendar differs to the design, since its a lot of effort to customize that and i think not worth the effort
  • the under 16 years old check is not really clear. I don't think this makes sense because no one can create a card for their children if we disallow that.

Side effects

  • none

Testing

  1. Please start the application on a real mobile device to check if everything works fine
  2. Create a card and activate it and check if birthday value is correct

Resolved issues

Fixes: #1672

const { viewportSmall } = useWindowDimensions()
const formStyle = viewportSmall ? { fontSize: 16, padding: '9px 10px' } : { fontSize: 14, padding: '6px 10px' }
const textFieldBoxShadow =
'0 0 0 0 rgba(205, 66, 70, 0), 0 0 0 0 rgba(205, 66, 70, 0), inset 0 0 0 1px #cd4246, inset 0 0 0 1px rgba(17, 20, 24, 0.2), inset 0 1px 1px rgba(17, 20, 24, 0.3)'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just copy the box shadow from the standard TextField components of MUI.
If someone know how to improve that, just let me know

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Tested on firefox, works great 🎉

administration/src/cards/extensions/BirthdayExtension.tsx Outdated Show resolved Hide resolved
<DesktopDatePicker
views={['year', 'month', 'day']}
value={date}
format='dd.MM.yyyy'
Copy link
Member

Choose a reason for hiding this comment

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

❓ How does this correspond with the LocalizationProvider you wrapped the app in?

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 library needs the Localization provider you can check the documentation

administration/src/cards/extensions/BirthdayExtension.tsx Outdated Show resolved Hide resolved
@f1sh1918 f1sh1918 force-pushed the 1670-show-form-hints branch 3 times, most recently from bbdf70f to ca0080a Compare November 13, 2024 19:19
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.

2 participants