1818 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1919 */
2020import React , { Dispatch } from 'react'
21- import { Action } from 'redux'
22- import { trackNavigateToPreview } from 'shared/modules/preview/previewDuck'
2321import { connect } from 'react-redux'
2422import { withBus } from 'react-suber'
23+ import { Action } from 'redux'
2524import { GlobalState } from 'shared/globalState'
2625import {
2726 Connection ,
2827 getActiveConnectionData
2928} from 'shared/modules/connections/connectionsDuck'
29+ import { trackNavigateToPreview } from 'shared/modules/preview/previewDuck'
3030
31- export const navigateToPreview = (
32- db ?: string | null ,
33- dbms ?: string | null
34- ) : void => {
35- const url = new URL ( window . location . href )
31+ const navigateToPreview = ( db ?: string | null , dbms ?: string | null ) : void => {
32+ const url = new URL ( 'https://browser.neo4j.io/' )
3633
37- if (
38- dbms &&
39- ! url . searchParams . has ( 'dbms' ) &&
40- ! url . searchParams . get ( 'connectURL' )
41- ) {
34+ if ( dbms ) {
4235 url . searchParams . set ( 'dbms' , dbms )
4336 }
4437
45- if ( db && ! url . searchParams . has ( 'db' ) ) {
38+ if ( db ) {
4639 url . searchParams . set ( 'db' , db )
4740 }
4841
49- const previewPath = '/preview/'
50- if ( ! url . pathname . endsWith ( previewPath ) ) {
51- url . pathname = url . pathname . replace ( / \/ ? $ / , previewPath )
52- window . location . href = decodeURIComponent ( url . toString ( ) )
53- }
42+ window . open ( url . toString ( ) , '_blank' , 'noreferrer' )
5443}
5544
5645type PreviewFrameProps = {
@@ -71,9 +60,9 @@ const PreviewFrame = ({
7160 < div className = "teasers" >
7261 < div className = "teaser teaser-advertise teaser-3" >
7362 < img src = "./assets/images/clusters.svg" className = "img-advertise" />
74- < h3 > 🚀 Try the new Browser preview !</ h3 >
63+ < h3 > 🚀 Try the new hosted Browser !</ h3 >
7564 < p >
76- Switch to the preview experience to access all the latest features.
65+ Switch to the hosted Browser to access all of the latest features.
7766 </ p >
7867 < button
7968 onClick = { trackAndNavigateToPreview }
0 commit comments