show correct title (#111)

This commit is contained in:
Aria Moradi
2021-12-04 10:23:12 +03:30
committed by GitHub
parent ac4aa7d1ca
commit 24addbdb52
2 changed files with 8 additions and 6 deletions

View File

@@ -23,11 +23,12 @@ interface IListDialogProps{
open: boolean
onClose: (arg0: string[] | null) => void
values: string[]
title: string
}
function ListDialog(props: IListDialogProps) {
const {
selectedValues: selectedValuesProp, open, onClose, values,
selectedValues: selectedValuesProp, open, onClose, values, title,
} = props;
const [selectedValues, setSelectedValues] = React.useState(selectedValuesProp);
@@ -69,7 +70,7 @@ function ListDialog(props: IListDialogProps) {
maxWidth="xs"
open={open}
>
<DialogTitle>Phone Ringtone</DialogTitle>
<DialogTitle>{title}</DialogTitle>
<DialogContent dividers>
<FormGroup>
{values.map((value) => (
@@ -143,6 +144,7 @@ export default function MultiSelectListPreference(props: MultiSelectListPreferen
<ListItemText primary={title} secondary={getSummary()} />
</ListItem>
<ListDialog
title={title}
open={dialogOpen}
onClose={handleDialogClose}
selectedValues={findEntriesOf(internalCurrentValue)}