PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / FormTaxonomies / resources / form-builder / taxonomy-settings.tsx

taxonomy-settings.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at src/FormTaxonomies/resources/form-builder/taxonomy-settings.tsx

61 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {SettingsSection} from "@givewp/form-builder-library";
2 import {__} from "@wordpress/i18n";
3 import {PanelRow} from "@wordpress/components";
4 import FormTagSetting from "./form-tags";
5 import FormCategorySetting from "./form-categories";
6 import getWindowData, {isFormCategoriesEnabled, isFormTagsEnabled} from "./windowData";
7
8 /**
9 * @since 3.16.0
10 */
11 const TaxonomySettings = ({settings, setSettings}) => {
12
13 return (
14 <div id={'give-form-settings__form-taxonomies'}>
15
16 {isFormTagsEnabled() && (
17 <SettingsSection title={__('Form Tags', 'give')}>
18 <PanelRow className={'no-extra-gap'}>
19 <FormTagSetting settings={settings} setSettings={setSettings} />
20 </PanelRow>
21 </SettingsSection>
22 )}
23
24 {isFormCategoriesEnabled() && (
25 <SettingsSection title={__('Form Categories', 'give')}>
26 <PanelRow className={'no-extra-gap'}>
27 <FormCategorySetting settings={settings} setSettings={setSettings} />
28 </PanelRow>
29 </SettingsSection>
30 )}
31 </div>
32 )
33 }
34
35 /**
36 * @since 3.16.0
37 */
38 export default function withTaxonomySettingsRoute (routes) {
39
40 const isFormTagsEnabled = getWindowData().formTagsEnabled;
41 const isFormCategoriesEnabled = getWindowData().formCategoriesEnabled;
42
43 /**
44 * @since 3.16.0
45 */
46 const getDynamicLabel = () => {
47 return isFormTagsEnabled && isFormCategoriesEnabled ? __('Tags and Categories', '')
48 : isFormTagsEnabled ? __('Form Tags', '')
49 : isFormCategoriesEnabled ? __('Form Categories', '') : '';
50 }
51
52 return [
53 ...routes,
54 {
55 name: getDynamicLabel(),
56 path: 'give-form-tags',
57 element: TaxonomySettings,
58 },
59 ];
60 }
61