Skip to content

Commit

Permalink
feat: Added new tag to Notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 5, 2023
1 parent c7c57eb commit bb77cea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
33 changes: 13 additions & 20 deletions frontend/src/layout/navigation-3000/components/NavbarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface NavbarButtonProps {
title?: string
shortTitle?: string
forceTooltipOnHover?: boolean
tag?: 'alpha' | 'beta'
tag?: 'alpha' | 'beta' | 'new'
onClick?: () => void
to?: string
active?: boolean
Expand Down Expand Up @@ -53,25 +53,18 @@ export const NavbarButton: FunctionComponent<NavbarButtonProps> = React.forwardR
if (!isNavCollapsedActually) {
content = shortTitle || title
if (tag) {
if (tag === 'alpha') {
content = (
<>
<span className="grow">{content}</span>
<LemonTag type="completion" size="small" className="ml-2">
ALPHA
</LemonTag>
</>
)
} else if (tag === 'beta') {
content = (
<>
<span className="grow">{content}</span>
<LemonTag type="warning" size="small" className="ml-2">
BETA
</LemonTag>
</>
)
}
content = (
<>
<span className="grow">{content}</span>
<LemonTag
type={tag === 'alpha' ? 'completion' : tag === 'beta' ? 'warning' : 'warning'}
size="small"
className="ml-2"
>
{tag.toUpperCase()}
</LemonTag>
</>
)
}
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/layout/navigation-3000/navigationLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ export const navigation3000Logic = kea<navigation3000LogicType>([
icon: <IconNotebook />,
to: urls.notebooks(),
featureFlag: FEATURE_FLAGS.NOTEBOOKS,
tag: 'new' as const,
},
{
identifier: Scene.Events,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation-3000/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface NavbarItemBase {
label: string
icon: JSX.Element
featureFlag?: (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]
tag?: 'alpha' | 'beta'
tag?: 'alpha' | 'beta' | 'new'
}
export interface SceneNavbarItem extends NavbarItemBase {
to: string
Expand Down

0 comments on commit bb77cea

Please sign in to comment.