Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmadejek committed Nov 29, 2024
1 parent 4d53db4 commit fdf709c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { PxeConfigurationFactory } from '../../PxeParametricEditor/configuration';
import { PxeValueType } from '../../PxeParametricEditor/types/PxeConfiguration.types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import { PxeExpandedSection, PxeExpandedSectionStateTuple } from './types/PxePar

export const PxeExpandedSectionContext = createContext<PxeExpandedSectionStateTuple>([undefined, noop]);

export const useAncestorExpandedSectionState = (): PxeExpandedSectionStateTuple =>
useContext(PxeExpandedSectionContext);

export const useNewExpandedSectionState = (): PxeExpandedSectionStateTuple => {
const [expandedSection, setExpandedSection] = useState<PxeExpandedSection>(undefined);
return useMemo<PxeExpandedSectionStateTuple>(() => [expandedSection, setExpandedSection], [expandedSection]);
};

export const useAncestorExpandedSectionState = (): PxeExpandedSectionStateTuple =>
useContext(PxeExpandedSectionContext);
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import { makeStyles } from '@material-ui/core';
import { isEqual } from 'lodash';
import React from 'react';
import { PxeRowLayoutEntry } from '../../types/PxeConfiguration.types';
import { PxeParametricEditorNode, PxeParametricEditorNodeProps } from '../../PxeParametricEditorNode';
import { makeStyles } from '@material-ui/core';
import { useDiagnostics } from '../../PxeDiagnosticsContext';

const useStyles = makeStyles(() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PxeConfigurationEntry } from '../types/PxeConfiguration.types';

import { isArray } from 'lodash';
import { PxeConfigurationEntry } from '../types/PxeConfiguration.types';
import { isLayoutNode, isSectionNode } from './nodePredicates';

type SearchOptions = {
Expand Down

0 comments on commit fdf709c

Please sign in to comment.