0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00

Wrap feature flag key name in CopyToClipboardInline (#4322)

This commit is contained in:
Sam Winslow 2021-05-12 16:08:52 -04:00 committed by GitHub
parent ffac7d1b1e
commit 1df3428f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ import { createdAtColumn, createdByColumn } from 'lib/components/Table'
import { FeatureFlagGroupType, FeatureFlagType } from '~/types'
import { router } from 'kea-router'
import { LinkButton } from 'lib/components/LinkButton'
import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'
export function FeatureFlags(): JSX.Element {
const { featureFlags, featureFlagsLoading } = useValues(featureFlagsLogic)
@ -27,14 +28,18 @@ export function FeatureFlags(): JSX.Element {
sorter: (a: FeatureFlagType, b: FeatureFlagType) => ('' + a.key).localeCompare(b.key),
render: function Render(_: string, featureFlag: FeatureFlagType) {
return (
<>
{!featureFlag.active && (
<Tooltip title="This feature flag is disabled.">
<DisconnectOutlined style={{ marginRight: 4 }} />
</Tooltip>
)}
{featureFlag.key}
</>
<div onClick={(e) => e.stopPropagation()}>
<CopyToClipboardInline iconPosition="start" explicitValue={featureFlag.key}>
<>
{!featureFlag.active && (
<Tooltip title="This feature flag is disabled.">
<DisconnectOutlined style={{ marginRight: 4 }} />
</Tooltip>
)}
{featureFlag.key}
</>
</CopyToClipboardInline>
</div>
)
},
},