Skip to content

Commit

Permalink
Swapped notebook icons around
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Oct 26, 2023
1 parent a24f34f commit b95b7a6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
IconGauge,
IconLive,
IconMessages,
IconNotebook,
IconOpenInApp,
IconPerson,
IconPinOutline,
Expand Down Expand Up @@ -53,6 +52,7 @@ import { DebugNotice } from 'lib/components/DebugNotice'
import ActivationSidebar from 'lib/components/ActivationSidebar/ActivationSidebar'
import { NotebookPopover } from 'scenes/notebooks/Notebook/NotebookPopover'
import { FlaggedFeature } from 'lib/components/FlaggedFeature'
import { IconNotebook } from 'scenes/notebooks/IconNotebook'

function Pages(): JSX.Element {
const { currentOrganization } = useValues(organizationLogic)
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/layout/navigation/TopBar/NotebookButton.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { IconNotebook } from 'lib/lemon-ui/icons'
import { useActions, useValues } from 'kea'
import { notebookPopoverLogic } from 'scenes/notebooks/Notebook/notebookPopoverLogic'
import { LemonButton, LemonButtonWithSideActionProps } from '@posthog/lemon-ui'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { IconNotebook } from 'scenes/notebooks/IconNotebook'

export function NotebookButton(): JSX.Element {
const { visibility } = useValues(notebookPopoverLogic)
const { setVisibility } = useActions(notebookPopoverLogic)
const { featureFlags } = useValues(featureFlagLogic)
const is3000 = useFeatureFlag('POSTHOG_3000')

const overrides3000: Partial<LemonButtonWithSideActionProps> = featureFlags[FEATURE_FLAGS.POSTHOG_3000]
const overrides3000: Partial<LemonButtonWithSideActionProps> = is3000
? {
size: 'small',
type: 'secondary',
Expand All @@ -25,7 +24,7 @@ export function NotebookButton(): JSX.Element {
status="primary-alt"
{...overrides3000}
>
{featureFlags[FEATURE_FLAGS.POSTHOG_3000] ? 'Notebooks' : null}
{is3000 ? 'Notebooks' : null}
</LemonButton>
)
}
9 changes: 9 additions & 0 deletions frontend/src/scenes/notebooks/IconNotebook.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { IconNotebook as IconNotebookLegacy, LemonIconProps } from 'lib/lemon-ui/icons'
import { IconNotebook as IconNotebook3000 } from '@posthog/icons'

export function IconNotebook(props: LemonIconProps): JSX.Element {
const is3000 = useFeatureFlag('POSTHOG_3000')

return is3000 ? <IconNotebook3000 {...props} /> : <IconNotebookLegacy {...props} />
}
12 changes: 2 additions & 10 deletions frontend/src/scenes/notebooks/Nodes/NotebookNodeBacklink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ import { mergeAttributes, Node, NodeViewProps } from '@tiptap/core'
import { NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react'
import { InsightModel, NotebookNodeType, NotebookTarget } from '~/types'
import { Link } from '@posthog/lemon-ui'
import {
IconGauge,
IconBarChart,
IconFlag,
IconExperiment,
IconLive,
IconPerson,
IconCohort,
IconNotebook,
} from 'lib/lemon-ui/icons'
import { IconGauge, IconBarChart, IconFlag, IconExperiment, IconLive, IconPerson, IconCohort } from 'lib/lemon-ui/icons'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { urls } from 'scenes/urls'
import clsx from 'clsx'
Expand All @@ -22,6 +13,7 @@ import { useValues } from 'kea'
import { notebookLogic } from '../Notebook/notebookLogic'

import { openNotebook } from '~/models/notebooksModel'
import { IconNotebook } from '../IconNotebook'

const ICON_MAP = {
dashboards: <IconGauge />,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { LemonButton } from '@posthog/lemon-ui'
import { useValues } from 'kea'
import { IconNotebook } from 'lib/lemon-ui/icons'
import { notebooksModel } from '~/models/notebooksModel'
import { NotebookListItemType } from '~/types'
import { NotebookSelectPopover } from '../NotebookSelectButton/NotebookSelectButton'
import { IconNotebook } from '../IconNotebook'

export type NotebookListMiniProps = {
selectedNotebookId?: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LemonButton, LemonButtonProps } from 'lib/lemon-ui/LemonButton'

import { IconNotebook, IconPlus, IconWithCount } from 'lib/lemon-ui/icons'
import { IconPlus, IconWithCount } from 'lib/lemon-ui/icons'
import {
NotebookSelectButtonLogicProps,
notebookSelectButtonLogic,
Expand All @@ -18,6 +18,7 @@ import { FlaggedFeature } from 'lib/components/FlaggedFeature'
import { FEATURE_FLAGS } from 'lib/constants'
import { ReactChild, useEffect } from 'react'
import { LemonDivider, ProfilePicture } from '@posthog/lemon-ui'
import { IconNotebook } from '../IconNotebook'

export type NotebookSelectProps = NotebookSelectButtonLogicProps & {
newNotebookTitle?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from 'scenes/session-recordings/player/sessionRecordingPlayerLogic'
import { useActions, useValues } from 'kea'
import { LemonButton, LemonButtonProps } from 'lib/lemon-ui/LemonButton'
import { IconComment, IconDelete, IconNotebook, IconLink, IconPinFilled, IconPinOutline } from 'lib/lemon-ui/icons'
import { IconComment, IconDelete, IconLink, IconPinFilled, IconPinOutline } from 'lib/lemon-ui/icons'
import { openPlayerShareDialog } from 'scenes/session-recordings/player/share/PlayerShare'
import { PlaylistPopoverButton } from './playlist-popover/PlaylistPopover'
import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
Expand All @@ -13,6 +13,7 @@ import { NotebookNodeType } from '~/types'
import { useNotebookNode } from 'scenes/notebooks/Nodes/notebookNodeLogic'
import { sessionPlayerModalLogic } from './modal/sessionPlayerModalLogic'
import { personsModalLogic } from 'scenes/trends/persons-modal/personsModalLogic'
import { IconNotebook } from '@posthog/icons'

export function PlayerMetaLinks(): JSX.Element {
const { sessionRecordingId, logicProps } = useValues(sessionRecordingPlayerLogic)
Expand Down

0 comments on commit b95b7a6

Please sign in to comment.