show correct title (#111)
This commit is contained in:
@@ -22,11 +22,12 @@ interface IListDialogProps{
|
||||
open: boolean
|
||||
onClose: (arg0: string | null) => void
|
||||
options: string[]
|
||||
title: string
|
||||
}
|
||||
|
||||
function ListDialog(props: IListDialogProps) {
|
||||
const {
|
||||
value: valueProp, open, onClose, options,
|
||||
value: valueProp, open, onClose, options, title,
|
||||
} = props;
|
||||
const [value, setValue] = React.useState(valueProp);
|
||||
const radioGroupRef = React.useRef<HTMLDivElement>(null);
|
||||
@@ -62,12 +63,10 @@ function ListDialog(props: IListDialogProps) {
|
||||
TransitionProps={{ onEntering: handleEntering }}
|
||||
open={open}
|
||||
>
|
||||
<DialogTitle>Phone Ringtone</DialogTitle>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<RadioGroup
|
||||
ref={radioGroupRef}
|
||||
aria-label="ringtone"
|
||||
name="ringtone"
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
>
|
||||
@@ -139,6 +138,7 @@ export default function ListPreference(props: ListPreferenceProps) {
|
||||
<ListItemText primary={title} secondary={getSummary()} />
|
||||
</ListItem>
|
||||
<ListDialog
|
||||
title={title}
|
||||
open={dialogOpen}
|
||||
onClose={handleDialogClose}
|
||||
value={findEntryOf(internalCurrentValue)}
|
||||
|
||||
@@ -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)}
|
||||
|
||||
Reference in New Issue
Block a user