Skip to content

Commit 2a2663f

Browse files
committed
link out
1 parent 637ddc9 commit 2a2663f

File tree

4 files changed

+12
-58
lines changed

4 files changed

+12
-58
lines changed

src/browser/index.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,7 @@ import ReactDOM from 'react-dom'
2222

2323
import AppInit, { setupSentry } from './AppInit'
2424
import './init'
25-
import { navigateToPreview } from './modules/Stream/StartPreviewFrame'
26-
import { optedInByLocalhost } from 'browser-services/preview-optin-service'
2725

2826
setupSentry()
2927

30-
;(async () => {
31-
const optedInToPreview = optedInByLocalhost()
32-
try {
33-
const response = await fetch('./preview/manifest.json')
34-
if (response.status === 200) {
35-
if (optedInToPreview) {
36-
navigateToPreview()
37-
} else {
38-
localStorage.setItem('previewAvailable', 'true')
39-
}
40-
} else {
41-
localStorage.setItem('previewAvailable', 'false')
42-
}
43-
} catch (e) {
44-
localStorage.setItem('previewAvailable', 'false')
45-
}
46-
47-
ReactDOM.render(<AppInit />, document.getElementById('mount'))
48-
})()
28+
ReactDOM.render(<AppInit />, document.getElementById('mount'))

src/browser/modules/Stream/PlayFrame.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,19 +292,16 @@ function generateContent(
292292

293293
// Check if content exists locally
294294
if (isPlayChapter(guideName)) {
295-
const isPreviewAvailable =
296-
localStorage.getItem('previewAvailable') === 'true' && !inDesktop
297-
298295
const { content, title, subtitle, slides = null } = chapters[guideName]
299296

300297
const isPlayStart = stackFrame.cmd.trim() === ':play start'
301298
const updatedContent =
302299
isPlayStart && showPromotion ? (
303300
<>
304-
{isPreviewAvailable ? <PreviewFrame /> : content}
301+
{!inDesktop ? <PreviewFrame /> : content}
305302
<AuraPromotion />
306303
</>
307-
) : isPreviewAvailable ? (
304+
) : !inDesktop ? (
308305
<PreviewFrame />
309306
) : (
310307
content

src/browser/modules/Stream/StartPreviewFrame.tsx

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,28 @@
1818
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*/
2020
import React, { Dispatch } from 'react'
21-
import { Action } from 'redux'
22-
import { trackNavigateToPreview } from 'shared/modules/preview/previewDuck'
2321
import { connect } from 'react-redux'
2422
import { withBus } from 'react-suber'
23+
import { Action } from 'redux'
2524
import { GlobalState } from 'shared/globalState'
2625
import {
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')
5443
}
5544

5645
type PreviewFrameProps = {
@@ -71,10 +60,8 @@ 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>
75-
<p>
76-
Switch to the preview experience to access all the latest features.
77-
</p>
63+
<h3>🚀 Try the new Browser!</h3>
64+
<p>Switch to the hosted Browser to access all the latest features.</p>
7865
<button
7966
onClick={trackAndNavigateToPreview}
8067
className="btn btn-advertise"

src/browser/services/preview-optin-service.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)