Skip to content

Commit

Permalink
Revert "Add back check for GroupContext in ActionList.Selection to fi…
Browse files Browse the repository at this point in the history
…x issues introduced to github/github (#3267)"

This reverts commit 332a1af.
  • Loading branch information
broccolinisoup committed Jun 12, 2023
1 parent 741c8a7 commit 700dffd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ActionList/Selection.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React from 'react'
import {CheckIcon} from '@primer/octicons-react'
import {ListContext} from './List'
import {ListContext, ActionListProps} from './List'
import {ActionListItemProps} from './shared'
import {LeadingVisualContainer} from './Visuals'
import {GroupContext} from './Group'

type SelectionProps = Pick<ActionListItemProps, 'selected'>
export const Selection: React.FC<React.PropsWithChildren<SelectionProps>> = ({selected}) => {
const {selectionVariant: groupSelectionVariant} = React.useContext(GroupContext)
const {selectionVariant: listSelectionVariant} = React.useContext(ListContext)

/** selectionVariant in Group can override the selectionVariant in List root */
/** fallback to selectionVariant from container menu if any (ActionMenu, SelectPanel ) */
const selectionVariant = groupSelectionVariant ?? listSelectionVariant
const selectionVariant: ActionListProps['selectionVariant'] = listSelectionVariant

if (!selectionVariant) {
// if selectionVariant is not set on List, but Item is selected
Expand Down

0 comments on commit 700dffd

Please sign in to comment.