-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1207 from City-of-Helsinki/develop
Release v2.0.30
- Loading branch information
Showing
17 changed files
with
246 additions
and
153 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
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
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
85 changes: 85 additions & 0 deletions
85
src/views/AreaView/components/ServiceFilterContainer/ServiceFilterContainer.js
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,85 @@ | ||
import React from 'react'; | ||
import { useTheme } from '@mui/styles'; | ||
import { | ||
IconButton, Typography, | ||
} from '@mui/material'; | ||
import { Clear } from '@mui/icons-material'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { | ||
StyledServiceFilterContainer, | ||
StyledServiceFilterText, | ||
StyledRowContainer, | ||
StyledServiceFilter, | ||
StyledServiceFilterButton, | ||
} from '../styled/styled'; | ||
import { createServiceFilterStyles } from '../../serviceFilterStyles'; | ||
|
||
const ServiceFilterContainer = ({ | ||
title, | ||
inputRef, | ||
keyboardHandler, | ||
handlefilterButtonClick, | ||
filterValue, | ||
setFilterValue, | ||
formatMessage, | ||
}) => { | ||
const theme = useTheme(); | ||
const { | ||
serviceFilterInputClass, | ||
serviceFilterButtonLabelClass, | ||
serviceFilterButtonFocusClass, | ||
} = createServiceFilterStyles(theme); | ||
|
||
return ( | ||
<StyledServiceFilterContainer> | ||
{typeof title === 'string' && ( | ||
<StyledServiceFilterText id="ServiceListTitle" variant="body2"> | ||
{title} | ||
</StyledServiceFilterText> | ||
)} | ||
<StyledRowContainer> | ||
<StyledServiceFilter | ||
inputRef={inputRef} | ||
inputProps={{ | ||
className: serviceFilterInputClass, | ||
'aria-labelledby': 'ServiceListTitle', | ||
}} | ||
type="text" | ||
onKeyPress={keyboardHandler(() => handlefilterButtonClick(), ['enter'])} | ||
endAdornment={ | ||
filterValue ? ( | ||
<IconButton | ||
aria-label={formatMessage({ id: 'search.cancelText' })} | ||
onClick={() => { | ||
inputRef.current.value = ''; | ||
setFilterValue(''); | ||
}} | ||
> | ||
<Clear /> | ||
</IconButton> | ||
) : null | ||
} | ||
/> | ||
<StyledServiceFilterButton | ||
id="ServiceListFilterButton" | ||
aria-label={formatMessage({ id: 'area.statisticalDistrict.service.filter.button.aria' })} | ||
disableRipple | ||
disableFocusRipple | ||
classes={{ | ||
label: serviceFilterButtonLabelClass, | ||
focusVisible: serviceFilterButtonFocusClass, | ||
}} | ||
onClick={handlefilterButtonClick} | ||
color="secondary" | ||
variant="contained" | ||
> | ||
<Typography variant="caption" color="inherit"> | ||
<FormattedMessage id="area.statisticalDistrict.service.filter.button" /> | ||
</Typography> | ||
</StyledServiceFilterButton> | ||
</StyledRowContainer> | ||
</StyledServiceFilterContainer> | ||
); | ||
}; | ||
|
||
export default ServiceFilterContainer; |
3 changes: 3 additions & 0 deletions
3
src/views/AreaView/components/ServiceFilterContainer/index.js
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,3 @@ | ||
import ServiceFilterContainer from './ServiceFilterContainer'; | ||
|
||
export default ServiceFilterContainer; |
Oops, something went wrong.