Skip to content

Commit 2655a63

Browse files
committed
fix: add comment and fix potential circular import
1 parent 9bf4811 commit 2655a63

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Common/SegmentedControl/Segment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ComponentSizeType } from '@Shared/constants'
44
import { Tooltip } from '@Common/Tooltip'
55
import { SegmentProps, SegmentType } from './types'
66
import { COMPONENT_SIZE_TO_ICON_CLASS_MAP, COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP } from './constants'
7-
import { ConditionalWrap } from '..'
7+
import { ConditionalWrap } from '../Helper'
88

99
const wrapWithTooltip = (tooltipProps: SegmentType['tooltipProps']) => (children: ReactElement) => (
1010
<Tooltip content={tooltipProps.content} placement="bottom" {...tooltipProps} alwaysShowTippyOnHover>

src/Common/SegmentedControl/SegmentedControl.component.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ const SegmentedControl = ({
1616
const isUnControlledComponent = controlledValue === undefined
1717

1818
const segmentedControlRefContainer = useRef<HTMLDivElement>(null)
19+
/**
20+
* Using this ref to show the selected segment highlight with transition
21+
*/
1922
const selectedSegmentRef = useRef<HTMLDivElement>(null)
2023
const [selectedSegmentValue, setSelectedSegmentValue] = useState<SegmentType['value'] | null>(segments[0].value)
2124
const segmentValue = isUnControlledComponent ? selectedSegmentValue : controlledValue

0 commit comments

Comments
 (0)