-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1430-extend-card
- Loading branch information
Showing
22 changed files
with
431 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
administration/src/bp-modules/components/CustomDatePicker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { DesktopDatePicker } from '@mui/x-date-pickers' | ||
import { deDE } from '@mui/x-date-pickers/locales' | ||
import React, { ReactElement } from 'react' | ||
|
||
import useWindowDimensions from '../../hooks/useWindowDimensions' | ||
|
||
type CustomDatePickerProps = { | ||
date: Date | null | ||
onBlur: () => void | ||
onChange: (date: Date | null) => void | ||
onClear: () => void | ||
isValid: boolean | ||
minDate?: Date | ||
maxDate?: Date | ||
disableFuture: boolean | ||
} | ||
|
||
const CustomDatePicker = ({ | ||
date, | ||
onBlur, | ||
onChange, | ||
onClear, | ||
isValid, | ||
minDate, | ||
maxDate, | ||
disableFuture, | ||
}: CustomDatePickerProps): ReactElement => { | ||
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)' | ||
return ( | ||
<DesktopDatePicker | ||
views={['year', 'month', 'day']} | ||
value={date} | ||
format='dd.MM.yyyy' | ||
slotProps={{ | ||
clearIcon: { fontSize: viewportSmall ? 'medium' : 'small' }, | ||
openPickerIcon: { fontSize: 'small' }, | ||
field: { clearable: true, onClear }, | ||
textField: { | ||
placeholder: 'TT.MM.JJJJ', | ||
error: !isValid, | ||
spellCheck: false, | ||
onBlur, | ||
sx: { | ||
width: '100%', | ||
input: formStyle, | ||
boxShadow: !isValid ? textFieldBoxShadow : undefined, | ||
}, | ||
}, | ||
}} | ||
localeText={deDE.components.MuiLocalizationProvider.defaultProps.localeText} | ||
disableFuture={disableFuture} | ||
minDate={minDate} | ||
maxDate={maxDate} | ||
onChange={onChange} | ||
/> | ||
) | ||
} | ||
|
||
export default CustomDatePicker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
administration/src/bp-modules/self-service/components/FormErrorMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import InfoOutlined from '@mui/icons-material/InfoOutlined' | ||
import { styled } from '@mui/material' | ||
import React, { CSSProperties, ReactElement } from 'react' | ||
|
||
const Container = styled('div')` | ||
margin: 6px 0; | ||
color: #ba1a1a; | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
font-size: 14px; | ||
` | ||
|
||
type FormErrorMessageProps = { | ||
errorMessage: string | null | ||
style?: CSSProperties | ||
} | ||
|
||
const FormErrorMessage = ({ errorMessage, style }: FormErrorMessageProps): ReactElement | null => | ||
errorMessage ? ( | ||
<Container style={style}> | ||
<InfoOutlined /> | ||
{errorMessage} | ||
</Container> | ||
) : null | ||
|
||
export default FormErrorMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.