// #region [Imports] =================================================================================================== // Libraries import React from 'react'; import { bindActionCreators, Dispatch } from 'redux'; import { connect } from 'react-redux'; import { Link, useHistory } from 'react-router-dom'; import { Skeleton, Menu } from 'antd'; // Actions import { PageActions } from '../../store/actions/page'; // Types import { IStore } from '../../types/store'; import { ISection } from '../../types/section'; // SCSS import './index.scss'; // Components import MenuIcon from './icons'; // Helpers import { getPathPrefix } from '../../helpers/utils'; // #endregion [Imports] // #region [Variables] ================================================================================================= declare var acfwAdminApp: any; const { setStorePage } = PageActions; const pathPrefix = getPathPrefix(); // #endregion [Variables] // #region [Interfaces] ================================================================================================ interface IActions { setStorePage: typeof setStorePage; } interface IProps { sections: ISection[]; currentSection: string | null; actions: IActions; } // #endregion [Interfaces] // #region [Component] ================================================================================================= const SettingsNav = (props: IProps) => { const { sections, currentSection, actions } = props; const { app_pages } = acfwAdminApp; const defaultKey: string = currentSection ? currentSection : 'general_section'; const history = useHistory(); if (sections.length < 1) { return (