diff --git a/cmd/frontend/internal/app/ui/handlers.go b/cmd/frontend/internal/app/ui/handlers.go index 00faefbcc13..6bef8bc7a39 100644 --- a/cmd/frontend/internal/app/ui/handlers.go +++ b/cmd/frontend/internal/app/ui/handlers.go @@ -215,9 +215,9 @@ func serveHome(w http.ResponseWriter, r *http.Request) error { } if envvar.SourcegraphDotComMode() && !actor.FromContext(r.Context()).IsAuthenticated() { - // The user is not signed in and tried to access our main site at sourcegraph.com. - // Redirect to sourcegraph.com/start so they see general info. - http.Redirect(w, r, "/start", http.StatusTemporaryRedirect) + // The user is not signed in and tried to access Sourcegraph.com. Redirect to /welcome so + // they see the welcome page. + http.Redirect(w, r, "/welcome", http.StatusTemporaryRedirect) return nil } // sourcegraph.com (not about) homepage. There is none, redirect them to /search. @@ -248,7 +248,7 @@ func serveSignIn(w http.ResponseWriter, r *http.Request) error { return renderTemplate(w, "app.html", common) } -func serveStart(w http.ResponseWriter, r *http.Request) error { +func serveWelcome(w http.ResponseWriter, r *http.Request) error { common, err := newCommon(w, r, "Sourcegraph", serveError) if err != nil { return err @@ -258,8 +258,7 @@ func serveStart(w http.ResponseWriter, r *http.Request) error { } if !envvar.SourcegraphDotComMode() { - // The user is signed in and tried to access sourcegraph.com/start, - // this page should be a 404 under that situation. + // The welcome page only exists on Sourcegraph.com. w.WriteHeader(http.StatusNotFound) } return renderTemplate(w, "app.html", common) diff --git a/cmd/frontend/internal/app/ui/router.go b/cmd/frontend/internal/app/ui/router.go index 510cf898543..eeac91543e0 100644 --- a/cmd/frontend/internal/app/ui/router.go +++ b/cmd/frontend/internal/app/ui/router.go @@ -64,6 +64,7 @@ const ( routeExtensions = "extensions" routeHelp = "help" routeExplore = "explore" + routeWelcome = "welcome" // Legacy redirects routeLegacyLogin = "login" @@ -113,6 +114,7 @@ func newRouter() *mux.Router { r.Path("/").Methods("GET").Name(routeHome) r.PathPrefix("/threads").Methods("GET").Name(routeThreads) r.Path("/start").Methods("GET").Name(routeStart) + r.PathPrefix("/welcome").Methods("GET").Name(routeWelcome) r.Path("/search").Methods("GET").Name(routeSearch) r.Path("/search/badge").Methods("GET").Name(routeSearchBadge) r.Path("/search/searches").Methods("GET").Name(routeSearchSearches) @@ -185,7 +187,8 @@ func initRouter() { router := newRouter() uirouter.Router = router // make accessible to other packages router.Get(routeHome).Handler(handler(serveHome)) - router.Get(routeStart).Handler(handler(serveStart)) + router.Get(routeStart).Handler(staticRedirectHandler("/welcome", http.StatusMovedPermanently)) + router.Get(routeWelcome).Handler(handler(serveWelcome)) router.Get(routeThreads).Handler(handler(serveBasicPageString("Threads - Sourcegraph"))) router.Get(uirouter.RouteSignIn).Handler(handler(serveSignIn)) router.Get(uirouter.RouteSignUp).Handler(handler(serveBasicPageString("Sign up - Sourcegraph"))) diff --git a/go.mod b/go.mod index 8ebc5727171..961288505c3 100644 --- a/go.mod +++ b/go.mod @@ -10,11 +10,9 @@ require ( github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect github.com/coreos/go-oidc v0.0.0-20171002155002-a93f71fdfe73 github.com/coreos/go-semver v0.2.0 - github.com/cosiner/argv v0.0.1 // indirect github.com/crewjam/saml v0.0.0-20180831135026-ebc5f787b786 github.com/davecgh/go-spew v1.1.1 github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc - github.com/derekparker/delve v1.1.0 // indirect github.com/dghubble/gologin v1.0.2-0.20181013174641-0e442dd5bb73 github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/die-net/lrucache v0.0.0-20190123005519-19a39ef22a11 @@ -82,7 +80,6 @@ require ( github.com/neelance/parallel v0.0.0-20160708114440-4de9ce63d14c github.com/opentracing-contrib/go-stdlib v0.0.0-20190104202730-77df8e8e70b4 github.com/opentracing/opentracing-go v1.0.2 - github.com/peterh/liner v1.1.0 // indirect github.com/peterhellberg/link v1.0.0 github.com/pkg/errors v0.8.1 github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect @@ -118,7 +115,6 @@ require ( github.com/xeonx/timeago v1.0.0-rc3 github.com/zenazn/goji v0.9.0 // indirect go.uber.org/atomic v1.3.2 // indirect - golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect golang.org/x/crypto v0.0.0-20190104202753-ff983b9c42bc golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e golang.org/x/oauth2 v0.0.0-20190201180606-99b60b757ec1 diff --git a/go.sum b/go.sum index ad9152416c2..75726ae1b0e 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,6 @@ github.com/coreos/go-oidc v0.0.0-20171002155002-a93f71fdfe73 h1:7CNPV0LWRCa1FNmq github.com/coreos/go-oidc v0.0.0-20171002155002-a93f71fdfe73/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosiner/argv v0.0.1 h1:2iAFN+sWPktbZ4tvxm33Ei8VY66FPCxdOxpncUGpAXE= -github.com/cosiner/argv v0.0.1/go.mod h1:p/NrK5tF6ICIly4qwEDsf6VDirFiWWz0FenfYBwJaKQ= github.com/crewjam/saml v0.0.0-20180831135026-ebc5f787b786 h1:8OVABJfT9iJh/uHeYlk1HWugxt7j50JPwW2uLOV9Yqs= github.com/crewjam/saml v0.0.0-20180831135026-ebc5f787b786/go.mod h1:w5eu+HNtubx+kRpQL6QFT2F3yIFfYVe6+EzOFVU7Hko= github.com/cznic/b v0.0.0-20180115125044-35e9bbe41f07/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= @@ -62,8 +60,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc h1:nqMZEdowWmtK9ysqvFibHJ56mTprkyE5c/6q8ZHwLc0= github.com/daviddengcn/go-colortext v0.0.0-20171126034257-17e75f6184bc/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/derekparker/delve v1.1.0 h1:icd65nMp7s2HiLz6y/6RCVXBdoED3xxYLwX09EMaRCc= -github.com/derekparker/delve v1.1.0/go.mod h1:pMSZMfp0Nhbm8qdZJkuE/yPGOkLpGXLS1I4poXQpuJU= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dhui/dktest v0.3.0 h1:kwX5a7EkLcjo7VpsPQSYJcKGbXBXdjI9FGjuUj1jn6I= @@ -328,8 +324,6 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -367,8 +361,6 @@ github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTm github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM= github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os= -github.com/peterh/liner v1.1.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/peterhellberg/link v1.0.0 h1:mUWkiegowUXEcmlb+ybF75Q/8D2Y0BjZtR8cxoKhaQo= github.com/peterhellberg/link v1.0.0/go.mod h1:gtSlOT4jmkY8P47hbTc8PTgiDDWpdPbFYl75keYyBB8= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -504,8 +496,6 @@ go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 h1:Pn8fQdvx+z1avAi7fdM2kRYWQNxGlavNDSyzrQg2SsU= -golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/package.json b/package.json index 6c289efe9bf..8aa674524d0 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@types/babel__core": "7.0.4", "@types/chai": "4.1.7", "@types/chai-as-promised": "7.1.0", + "@types/classnames": "^2.2.7", "@types/cpy": "5.1.0", "@types/d3-axis": "1.0.11", "@types/d3-scale": "2.1.0", @@ -174,6 +175,7 @@ "@sqs/jsonc-parser": "^1.0.3", "abortable-rx": "^1.0.9", "bootstrap": "^4.1.3", + "classnames": "^2.2.6", "copy-to-clipboard": "^3.0.7", "d3-axis": "^1.0.7", "d3-scale": "^2.0.0", diff --git a/shared/src/actions/ActionsContainer.tsx b/shared/src/actions/ActionsContainer.tsx index 8d420d4f9ff..0ae76213465 100644 --- a/shared/src/actions/ActionsContainer.tsx +++ b/shared/src/actions/ActionsContainer.tsx @@ -10,7 +10,9 @@ import { PlatformContextProps } from '../platform/context' import { ActionItem, ActionItemProps } from './ActionItem' import { ActionsState } from './actions' -export interface ActionsProps extends ExtensionsControllerProps, PlatformContextProps { +export interface ActionsProps + extends ExtensionsControllerProps<'executeCommand' | 'services'>, + PlatformContextProps<'forceUpdateTooltip'> { menu: ContributableMenu scope?: ContributionScope actionItemClass?: string diff --git a/shared/src/commandPalette/CommandList.tsx b/shared/src/commandPalette/CommandList.tsx index d2834a32807..07954521587 100644 --- a/shared/src/commandPalette/CommandList.tsx +++ b/shared/src/commandPalette/CommandList.tsx @@ -14,7 +14,9 @@ import { getContributedActionItems } from '../contributions/contributions' import { ExtensionsControllerProps } from '../extensions/controller' import { PlatformContextProps } from '../platform/context' -interface Props extends ExtensionsControllerProps, PlatformContextProps { +interface Props + extends ExtensionsControllerProps<'services' | 'executeCommand'>, + PlatformContextProps<'forceUpdateTooltip'> { /** The menu whose commands to display. */ menu: ContributableMenu diff --git a/web/src/Layout.tsx b/web/src/Layout.tsx index 874932ad60d..772696fff80 100644 --- a/web/src/Layout.tsx +++ b/web/src/Layout.tsx @@ -64,8 +64,6 @@ export interface LayoutProps isLightTheme: boolean onThemeChange: () => void - onMainPage: (mainPage: boolean) => void - isMainPage: boolean navbarSearchQuery: string onNavbarQueryChange: (query: string) => void diff --git a/web/src/SourcegraphWebApp.scss b/web/src/SourcegraphWebApp.scss index 7ff21ea846e..6435f3f5281 100644 --- a/web/src/SourcegraphWebApp.scss +++ b/web/src/SourcegraphWebApp.scss @@ -240,7 +240,6 @@ hr { @import './global/GlobalAlerts'; @import './global/GlobalDebug'; @import './docSite/DocSitePage'; -@import './search/input/MainPage'; @import './search/input/ScopePage'; @import './search/input/SearchPage'; @import './search/results/SearchResults'; diff --git a/web/src/SourcegraphWebApp.tsx b/web/src/SourcegraphWebApp.tsx index 706579fb321..bd41bea124b 100644 --- a/web/src/SourcegraphWebApp.tsx +++ b/web/src/SourcegraphWebApp.tsx @@ -73,11 +73,6 @@ interface SourcegraphWebAppState extends PlatformContextProps, SettingsCascadePr */ isLightTheme: boolean - /** - * Whether the user is on MainPage and therefore not logged in - */ - isMainPage: boolean - /** * The current search query in the navbar. */ @@ -108,7 +103,6 @@ export class SourcegraphWebApp extends React.Component ({ isLightTheme: !state.isLightTheme })) } - private onMainPage = (mainPage: boolean) => { - this.setState(() => ({ isMainPage: mainPage })) - } - private onNavbarQueryChange = (navbarSearchQuery: string) => { this.setState({ navbarSearchQuery }) } diff --git a/web/src/auth.ts b/web/src/auth.ts index 57888c87dbe..23b33706b82 100644 --- a/web/src/auth.ts +++ b/web/src/auth.ts @@ -53,7 +53,7 @@ export function refreshAuthenticatedUser(): Observable { ) } -const initialSiteConfigAuthPublic = window.context.critical['auth.public'] +const initialSiteConfigAuthPublic = window.context ? window.context.critical['auth.public'] : false // default to false in tests /** * Whether auth is required to perform any action. @@ -67,7 +67,7 @@ const initialSiteConfigAuthPublic = window.context.critical['auth.public'] export const authRequired = authenticatedUser.pipe(map(user => user === null && !initialSiteConfigAuthPublic)) // Populate authenticatedUser. -if (window.context.isAuthenticatedUser) { +if (window.context && window.context.isAuthenticatedUser) { refreshAuthenticatedUser() .toPromise() .then(() => void 0, err => console.error(err)) diff --git a/web/src/enterprise.scss b/web/src/enterprise.scss index 911bef6dc75..91c2b8df15d 100644 --- a/web/src/enterprise.scss +++ b/web/src/enterprise.scss @@ -3,6 +3,7 @@ @import './SourcegraphWebApp.scss'; // Need .scss extension because of https://github.com/webpack-contrib/sass-loader/issues/556 // Enterprise styles +@import './enterprise/dotcom/welcome/WelcomeArea'; @import './enterprise/extensions/registry/RegistryArea'; @import './enterprise/extensions/registry/RegistryNewExtensionPage'; @import './enterprise/extensions/extension/RegistryExtensionManagePage'; diff --git a/web/src/enterprise/dotcom/welcome/WelcomeArea.scss b/web/src/enterprise/dotcom/welcome/WelcomeArea.scss new file mode 100644 index 00000000000..eec25d18b01 --- /dev/null +++ b/web/src/enterprise/dotcom/welcome/WelcomeArea.scss @@ -0,0 +1 @@ +@import './WelcomeMainPage'; diff --git a/web/src/enterprise/dotcom/welcome/WelcomeArea.tsx b/web/src/enterprise/dotcom/welcome/WelcomeArea.tsx new file mode 100644 index 00000000000..067067a8cc8 --- /dev/null +++ b/web/src/enterprise/dotcom/welcome/WelcomeArea.tsx @@ -0,0 +1,91 @@ +import { LoadingSpinner } from '@sourcegraph/react-loading-spinner' +import H from 'history' +import ChevronLeftIcon from 'mdi-react/ChevronLeftIcon' +import MapSearchIcon from 'mdi-react/MapSearchIcon' +import React from 'react' +import { Route, RouteComponentProps, Switch } from 'react-router' +import { Link } from 'react-router-dom' +import { ExtensionsControllerProps } from '../../../../../shared/src/extensions/controller' +import * as GQL from '../../../../../shared/src/graphql/schema' +import { PlatformContextProps } from '../../../../../shared/src/platform/context' +import { ErrorBoundary } from '../../../components/ErrorBoundary' +import { HeroPage } from '../../../components/HeroPage' +import { RouteDescriptor } from '../../../util/contributions' +import { WelcomeAreaFooter } from './WelcomeAreaFooter' + +const NotFoundPage = () => + +export interface WelcomeAreaRoute extends RouteDescriptor {} + +export interface WelcomeAreaProps extends ExtensionsControllerProps, PlatformContextProps, RouteComponentProps<{}> { + authenticatedUser: GQL.IUser | null + isLightTheme: boolean + routes: ReadonlyArray + location: H.Location + history: H.History +} + +export interface WelcomeAreaRouteContext extends WelcomeAreaProps {} + +/** + * The welcome area, which contains general product information. + */ +export class WelcomeArea extends React.PureComponent { + public render(): JSX.Element | null { + if (!window.context.sourcegraphDotComMode) { + return ( + + Visit{' '} + + sourcegraph.com/welcome + {' '} + instead. +

+ } + /> + ) + } + + const { children, ...context } = this.props + return ( +
+ {this.props.location.pathname !== '/welcome' && ( + + )} + + }> + + {this.props.routes.map( + ({ path, exact, render, condition = () => true }) => + condition(context) && ( + ( + <> + {render({ ...context, ...routeComponentProps })} + + + )} + /> + ) + )} + + + + +
+ ) + } +} diff --git a/web/src/enterprise/dotcom/welcome/WelcomeAreaFooter.tsx b/web/src/enterprise/dotcom/welcome/WelcomeAreaFooter.tsx new file mode 100644 index 00000000000..cb881ad135a --- /dev/null +++ b/web/src/enterprise/dotcom/welcome/WelcomeAreaFooter.tsx @@ -0,0 +1,135 @@ +import React from 'react' +import { Link } from 'react-router-dom' + +export const WelcomeAreaFooter: React.FunctionComponent<{ isLightTheme: boolean }> = ({ isLightTheme }) => ( + <> +
+
+ +

+ + hi@sourcegraph.com + +
+ 142 Minna St, 2nd Floor +
+ San Francisco, CA 94105 (USA) +

+
+
+

Features

+
    +
  • + Code search +
  • +
  • + Code intelligence +
  • +
  • + Integrations +
  • +
  • + + Enterprise + +
  • +
+
+
+

Community

+ +
+
+

Company

+ +
+ +
+

+ + Terms + {' '} + -{' '} + + Privacy + {' '} + - Copyright © 2018 Sourcegraph, Inc. +

+ +) diff --git a/web/src/enterprise/dotcom/welcome/WelcomeMainPage.scss b/web/src/enterprise/dotcom/welcome/WelcomeMainPage.scss new file mode 100644 index 00000000000..35722d18da6 --- /dev/null +++ b/web/src/enterprise/dotcom/welcome/WelcomeMainPage.scss @@ -0,0 +1,23 @@ +@import './WelcomeMainPageDemos'; +@import './WelcomeMainPageLogos'; + +.welcome-main-page { + &__logo-mark { + width: 1.5rem; + height: 1.5rem; + position: absolute; + top: -1.5rem; // make CTAs flush with header text + } + &__header { + font-size: 24px; + } + &__demo { + min-height: 540px; // reduce jitter while page is loading + } +} + +.theme-dark .welcome-main-page { + &__sign-up { + color: #ffffff; // otherwise the signup CTA link text is indistinguishable from text-muted + } +} diff --git a/web/src/enterprise/dotcom/welcome/WelcomeMainPage.tsx b/web/src/enterprise/dotcom/welcome/WelcomeMainPage.tsx new file mode 100644 index 00000000000..1cb17e24bef --- /dev/null +++ b/web/src/enterprise/dotcom/welcome/WelcomeMainPage.tsx @@ -0,0 +1,157 @@ +import * as H from 'history' +import CloudUploadIcon from 'mdi-react/CloudUploadIcon' +import * as React from 'react' +import { Link } from 'react-router-dom' +import { ExtensionsControllerProps } from '../../../../../shared/src/extensions/controller' +import * as GQL from '../../../../../shared/src/graphql/schema' +import { PlatformContextProps } from '../../../../../shared/src/platform/context' +import { eventLogger } from '../../../tracking/eventLogger' +import { WelcomeMainPageDemos } from './WelcomeMainPageDemos' +import { WelcomeMainPageLogos } from './WelcomeMainPageLogos' + +// Lambdas are OK in this component because it is not performance sensitive and using them +// simplifies the code. +// +// tslint:disable:jsx-no-lambda + +interface Props extends ExtensionsControllerProps, PlatformContextProps { + authenticatedUser: GQL.IUser | null + isLightTheme: boolean + location: H.Location + history: H.History +} + +/** + * The welcome main page, which describes Sourcegraph functionality and other general information. + */ +export class WelcomeMainPage extends React.Component { + public render(): JSX.Element | null { + return ( +
+
+
+
+
+ +

+ + Search, navigate, and review code. + {' '} + Find answers. +

+

Sourcegraph is a web-based code search and navigation tool for dev teams.

+ +

+ + See how it's used + {' '} + to build better software faster at: +

+
+ + + …and thousands of other organizations. + +
+
+
+
+ eventLogger.log('WelcomeDeploySelfHosted')} + > + Deploy self-hosted Sourcegraph + + + For use with your organization's private code. Runs securely on your infra (in a + single Docker container or on a cluster). + +
+
+ eventLogger.log('WelcomeInstallBrowserExtension')} + > + Install browser extension + + + Adds go-to-definition and find-references to GitHub and other code hosts. For + private code, connect it to your self-hosted Sourcegraph instance. + +
+ {!this.props.authenticatedUser && ( +
+ eventLogger.log('WelcomeSignUpForSourcegraphDotCom')} + > + Sign up on Sourcegraph.com + + + A public Sourcegraph instance for public code only. + +
+ )} +
+
+
+ +