Skip to content

Commit

Permalink
chore: cleanup More button component
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Apr 16, 2024
1 parent 5f5d6a9 commit 9f1b2fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
19 changes: 4 additions & 15 deletions frontend/src/lib/lemon-ui/LemonButton/More.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,24 @@ import { IconEllipsis } from '@posthog/icons'

import { PopoverProps } from '../Popover/Popover'
import { LemonButtonWithDropdown } from '.'
import { LemonButtonProps, LemonButtonWithDropdownProps } from './LemonButton'
import { LemonButtonProps } from './LemonButton'

export type MoreProps = Partial<Pick<PopoverProps, 'overlay' | 'placement'>> &
LemonButtonProps & {
'data-attr'?: string
onClick?: LemonButtonWithDropdownProps['onClick']
}
export type MoreProps = Partial<Pick<PopoverProps, 'overlay'>> & LemonButtonProps

export function More({
overlay,
placement = 'bottom-end',
'data-attr': dataAttr,
onClick,
...buttonProps
}: MoreProps): JSX.Element {
export function More({ overlay, 'data-attr': dataAttr, ...buttonProps }: MoreProps): JSX.Element {
return (
<LemonButtonWithDropdown
aria-label="more"
data-attr={dataAttr ?? 'more-button'}
icon={<IconEllipsis />}
dropdown={{
placement,
placement: 'bottom-end',
actionable: true,
overlay,
}}
size="small"
{...buttonProps}
disabled={!overlay}
onClick={onClick}
/>
)
}
29 changes: 0 additions & 29 deletions frontend/src/scenes/settings/user/PersonalAPIKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,35 +409,6 @@ function PersonalAPIKeysTable(): JSX.Element {
>
<LemonButton size="small" icon={<IconEllipsis />} />
</LemonMenu>
// <More
// overlay={
// <>
// <LemonButton fullWidth>View</LemonButton>
// <LemonButton fullWidth>Edit</LemonButton>
// <LemonDivider />
// <LemonButton
// status="danger"
// type="tertiary"
// size="xsmall"
// fullWidth
// onClick={() => {
// LemonDialog.open({
// title: `Permanently delete key "${key.label}"?`,
// description:
// 'This action cannot be undone. Make sure to have removed the key from any live integrations first.',
// primaryButton: {
// status: 'danger',
// children: 'Permanently delete',
// onClick: () => deleteKey(key.id),
// },
// })
// }}
// >
// Delete
// </LemonButton>
// </>
// }
// />
)
},
},
Expand Down

0 comments on commit 9f1b2fb

Please sign in to comment.