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