1+ import { Storage } from "@plasmohq/storage" ;
2+ import { useStorage } from "@plasmohq/storage/hook" ;
13import classNames from "classnames" ;
24import { useEffect , useMemo , useRef , useState } from "react" ;
35import { useHotkeys } from "react-hotkeys-hook" ;
46import Logo from "react:./logo-mark.svg" ;
5-
6- import { useStorage } from "@plasmohq/storage/hook" ;
7- import { Storage } from "@plasmohq/storage" ;
8-
97import { DEFAULT_GITPOD_ENDPOINT , EVENT_CURRENT_URL_CHANGED } from "~constants" ;
8+ import { FeatureFlags , useFlag } from "~hooks/use-configcat" ;
9+ import { OnaLettermark } from "~icons/OnaLettermark" ;
1010import { STORAGE_KEY_ADDRESS , STORAGE_KEY_ALWAYS_OPTIONS , STORAGE_KEY_NEW_TAB } from "~storage" ;
11-
1211import type { SupportedApplication } from "./button-contributions" ;
1312import { CaretForProvider } from "./CaretForProvider" ;
1413
@@ -23,6 +22,7 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
2322 const [ disableAutostart ] = useStorage < boolean > ( STORAGE_KEY_ALWAYS_OPTIONS , false ) ;
2423 const [ showDropdown , setShowDropdown ] = useState ( false ) ;
2524 const [ currentHref , setCurrentHref ] = useState ( window . location . href ) ;
25+ const { value : isOnaEnabled } = useFlag ( FeatureFlags . ONA_ENABLED , false ) ;
2626
2727 const linkRef = useRef < HTMLAnchorElement | null > ( null ) ;
2828
@@ -96,7 +96,7 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
9696 return (
9797 < div
9898 id = "gitpod-btn-nav"
99- title = " Gitpod"
99+ title = { `Open with ${ isOnaEnabled ? "Ona" : " Gitpod"} ` }
100100 className = { classNames ( "gitpod-button" , application , ...( additionalClassNames ?? [ ] ) ) }
101101 >
102102 < div className = { classNames ( "button" ) } >
@@ -108,7 +108,10 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
108108 ref = { linkRef }
109109 >
110110 < span className = { classNames ( "action-label" ) } >
111- < Logo className = { classNames ( "action-logo" ) } width = { 14 } height = { 14 } />
111+ { isOnaEnabled ?
112+ < OnaLettermark className = { classNames ( "action-logo" ) } width = { 14 } height = { 14 } /> :
113+ < Logo className = { classNames ( "action-logo" ) } width = { 14 } height = { 14 } />
114+ }
112115 { actions [ 0 ] . label }
113116 </ span >
114117 </ a >
0 commit comments