widget-options
/
includes
/
widgets
/
gutenberg
/
src
/
attributes
/
components
/
widgetopts-panel.js
widgetopts-panel.js
52 lines
| 1 | import { TabPanel } from "@wordpress/components"; |
| 2 | import ColumsTabPanel from "./option-tabs/columns"; |
| 3 | import AlignmentTabPanel from "./option-tabs/alignment"; |
| 4 | import RolesTabPanel from "./option-tabs/roles"; |
| 5 | import VisibilityTabPanel from "./option-tabs/visibility"; |
| 6 | import DevicesTabPanel from "./option-tabs/devices"; |
| 7 | import DatesTabPanel from "./option-tabs/days-dates"; |
| 8 | import StylingTabPanel from "./option-tabs/styling"; |
| 9 | import SettingsTabPanel from "./option-tabs/settings"; |
| 10 | import AnimationTabPanel from "./option-tabs/animation"; |
| 11 | import BehaviorTabPanel from "./option-tabs/behavior"; |
| 12 | |
| 13 | const onSelect = (tabName) => {}; |
| 14 | |
| 15 | const WidgetOptionsPanel = (props) => { |
| 16 | const tabName = props.tabName; |
| 17 | |
| 18 | const checkActiveTab = () => { |
| 19 | let activeTab = |
| 20 | tabName == "columns" ? ( |
| 21 | <ColumsTabPanel {...props} /> |
| 22 | ) : tabName == "alignment" ? ( |
| 23 | <AlignmentTabPanel {...props} /> |
| 24 | ) : tabName == "role" ? ( |
| 25 | <RolesTabPanel {...props} /> |
| 26 | ) : tabName == "visibility" ? ( |
| 27 | <VisibilityTabPanel {...props} /> |
| 28 | ) : tabName == "devices" ? ( |
| 29 | <DevicesTabPanel {...props} /> |
| 30 | ) : tabName == "dates" ? ( |
| 31 | <DatesTabPanel {...props} /> |
| 32 | ) : tabName == "styling" ? ( |
| 33 | <StylingTabPanel {...props} /> |
| 34 | ) : tabName == "logic" ? ( |
| 35 | <SettingsTabPanel {...props} /> |
| 36 | ) : tabName == "animation" ? ( |
| 37 | <AnimationTabPanel {...props} /> |
| 38 | ) : tabName == "behavior" ? ( |
| 39 | <BehaviorTabPanel {...props} /> |
| 40 | ) : ( |
| 41 | <div> |
| 42 | <h3>{props.tabName} Loading...</h3> |
| 43 | </div> |
| 44 | ); |
| 45 | return activeTab; |
| 46 | }; |
| 47 | |
| 48 | return checkActiveTab(); |
| 49 | }; |
| 50 | |
| 51 | export default WidgetOptionsPanel; |
| 52 |