Skip to content

Commit

Permalink
fix: move helper file to inside libs
Browse files Browse the repository at this point in the history
  • Loading branch information
im36-123 committed Nov 6, 2019
1 parent 75d3f20 commit 36e30c6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/AccordionPanel/AccordionPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useState } from 'react'

import { mapToArray, arrayToMap } from './AccordionPanelHelper'
import { mapToArray, arrayToMap } from '../../libs/map'

type Props = {
children: React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion src/components/AccordionPanel/AccordionPanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Transition } from 'react-transition-group'
import { InjectedProps, withTheme } from '../../hocs/withTheme'
import { AccordionPanelItemContext } from './AccordionPanelItem'
import { AccordionPanelContext } from './AccordionPanel'
import { getShouldExpanded } from './AccordionPanelHelper'
import { getShouldExpanded } from '../../libs/map'

type Props = {
children: React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion src/components/AccordionPanel/AccordionPanelTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccordionPanelContext } from './AccordionPanel'
import { AccordionPanelItemContext } from './AccordionPanelItem'
import { Icon as IconComponent } from '../Icon'

import { getShouldExpanded } from './AccordionPanelHelper'
import { getShouldExpanded } from '../../libs/map'
import { isTouchDevice } from '../../libs/ua'
import { withTheme, InjectedProps } from '../../hocs/withTheme'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const getShouldExpanded = (expanded: Map<string, string>, name: string) =>
!!expanded.get(name)
export const getShouldExpanded = (map: Map<string, string>, key: string) => !!map.get(key)

export const mapToArray = (map: Map<string, string>) => Array.from(map.keys())

Expand Down

0 comments on commit 36e30c6

Please sign in to comment.