1
+ import { Storage } from "@plasmohq/storage" ;
2
+ import { useStorage } from "@plasmohq/storage/hook" ;
1
3
import classNames from "classnames" ;
2
4
import { useEffect , useMemo , useRef , useState } from "react" ;
3
5
import { useHotkeys } from "react-hotkeys-hook" ;
4
6
import Logo from "react:./logo-mark.svg" ;
5
-
6
- import { useStorage } from "@plasmohq/storage/hook" ;
7
- import { Storage } from "@plasmohq/storage" ;
8
-
9
7
import { DEFAULT_GITPOD_ENDPOINT , EVENT_CURRENT_URL_CHANGED } from "~constants" ;
8
+ import { FeatureFlags , useFlag } from "~hooks/use-configcat" ;
9
+ import { OnaLettermark } from "~icons/OnaLettermark" ;
10
10
import { STORAGE_KEY_ADDRESS , STORAGE_KEY_ALWAYS_OPTIONS , STORAGE_KEY_NEW_TAB } from "~storage" ;
11
-
12
11
import type { SupportedApplication } from "./button-contributions" ;
13
12
import { CaretForProvider } from "./CaretForProvider" ;
14
13
@@ -23,6 +22,7 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
23
22
const [ disableAutostart ] = useStorage < boolean > ( STORAGE_KEY_ALWAYS_OPTIONS , false ) ;
24
23
const [ showDropdown , setShowDropdown ] = useState ( false ) ;
25
24
const [ currentHref , setCurrentHref ] = useState ( window . location . href ) ;
25
+ const { value : isOnaEnabled } = useFlag ( FeatureFlags . ONA_ENABLED , false ) ;
26
26
27
27
const linkRef = useRef < HTMLAnchorElement | null > ( null ) ;
28
28
@@ -96,7 +96,7 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
96
96
return (
97
97
< div
98
98
id = "gitpod-btn-nav"
99
- title = " Gitpod"
99
+ title = { `Open with ${ isOnaEnabled ? "Ona" : " Gitpod"} ` }
100
100
className = { classNames ( "gitpod-button" , application , ...( additionalClassNames ?? [ ] ) ) }
101
101
>
102
102
< div className = { classNames ( "button" ) } >
@@ -108,7 +108,10 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
108
108
ref = { linkRef }
109
109
>
110
110
< 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
+ }
112
115
{ actions [ 0 ] . label }
113
116
</ span >
114
117
</ a >
0 commit comments