0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added multiselect to Default Recipients

refs. https://github.com/TryGhost/Team/issues/3318
This commit is contained in:
Peter Zimon 2023-06-02 11:13:35 +02:00
parent b3300589fa
commit 5386fc923f

View file

@ -1,8 +1,10 @@
import MultiSelect, {MultiSelectOption} from '../../../admin-x-ds/global/MultiSelect';
import React from 'react';
import Select from '../../../admin-x-ds/global/Select';
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
import SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent';
import useSettingGroup from '../../../hooks/useSettingGroup';
import {MultiValue} from 'react-select';
import {getOptionLabel} from '../../../utils/helpers';
type RefipientValueArgs = {
@ -110,6 +112,24 @@ const DefaultRecipients: React.FC = () => {
setDefaultRecipientValue(value);
}}
/>
{(emailRecipientValue === 'segment') && (
<MultiSelect
defaultValues={[
{value: 'option2', label: 'Fake tier 2'}
]}
options={[
{value: 'option1', label: 'Fake tier 1'},
{value: 'option2', label: 'Fake tier 2'},
{value: 'option3', label: 'Fake tier 3'}
]}
title='Select tiers'
onChange={(selected: MultiValue<MultiSelectOption>) => {
selected?.map(o => (
alert(`${o.label} (${o.value})`)
));
}}
/>
)}
</SettingGroupContent>
);