Skip to content

Commit

Permalink
fix linting and staff
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Sep 19, 2024
1 parent 19daa03 commit 38ca715
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/FeatureFlags/DefaultFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const DefaultFeatureFlags = FeatureFlagScope.create({
primer_react_css_modules_staff: false,
primer_react_css_modules_ga: false,
primer_react_action_list_item_as_button: false,
primer_react_select_panel_with_modern_action_list: true,
primer_react_select_panel_with_modern_action_list: false,
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {useFeatureFlag} from '../FeatureFlags'

export function FilteredActionList(props: FilteredActionListProps): JSX.Element {
const enabled = useFeatureFlag('primer_react_select_panel_with_modern_action_list')
return <WithStableActionList {...props} />
// else return <WithDeprecatedActionList {...props} />
if (enabled) return <WithStableActionList {...props} />
else return <WithDeprecatedActionList {...props} />
}

FilteredActionList.displayName = 'FilteredActionList'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export interface FilteredActionListProps
onFilterChange: (value: string, e: React.ChangeEvent<HTMLInputElement> | null) => void
textInputProps?: Partial<Omit<TextInputProps, 'onChange'>>
inputRef?: React.RefObject<HTMLInputElement>
emptyState?: boolean
children?: React.ReactNode
}

const StyledHeader = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ import {VisuallyHidden} from '../internal/components/VisuallyHidden'
import type {SxProp} from '../sx'
import type {FilteredActionListLoadingType} from './FilteredActionListLoaders'
import {FilteredActionListLoadingTypes, FilteredActionListBodyLoader} from './FilteredActionListLoaders'
import Text from '../Text'

import {isValidElementType} from 'react-is'
import type {RenderItemFn} from '../deprecated/ActionList/List'
import {SelectPanelMessage} from '../SelectPanel/SelectPanel'

const menuScrollMargins: ScrollIntoViewOptions = {startMargin: 0, endMargin: 8}

Expand All @@ -37,7 +35,6 @@ export interface FilteredActionListProps
onFilterChange: (value: string, e: React.ChangeEvent<HTMLInputElement>) => void
textInputProps?: Partial<Omit<TextInputProps, 'onChange'>>
inputRef?: React.RefObject<HTMLInputElement>
emptyState?: boolean
}

const StyledHeader = styled.div`
Expand All @@ -57,7 +54,6 @@ export function FilteredActionList({
sx,
groupMetadata,
showItemDividers,
emptyState,
message,
...listProps
}: FilteredActionListProps): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from '@primer/octicons-react'
import useSafeTimeout from '../hooks/useSafeTimeout'
import Link from '../Link'
import Text from '../Text'

const meta = {
title: 'Components/SelectPanel/Features',
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/SelectPanel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export type SelectPanelMessageProps = {
title: string
variant: 'noitems' | 'nomatches'
}
// we will have more variants in the future like error / warning etc
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const SelectPanelMessage: React.FC<SelectPanelMessageProps> = ({variant = 'noitems', title, children}) => {
return (
<Box
Expand Down Expand Up @@ -346,7 +348,6 @@ function Panel({
inputRef={inputRef}
loading={isLoading}
loadingType={loadingType()}
emptyState={isNoItemsState}
message={message}
// inheriting height and maxHeight ensures that the FilteredActionList is never taller
// than the Overlay (which would break scrolling the items)
Expand Down

0 comments on commit 38ca715

Please sign in to comment.