Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
tidy top-level routes, assets, favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller committed Apr 21, 2020
1 parent de42f00 commit b6bc68a
Show file tree
Hide file tree
Showing 40 changed files with 173 additions and 131 deletions.
4 changes: 2 additions & 2 deletions control/auth/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/url"

"gitlab.com/beneath-hq/beneath/control/entity"
"gitlab.com/beneath-hq/beneath/internal/middleware"
"gitlab.com/beneath-hq/beneath/pkg/httputil"
"gitlab.com/beneath-hq/beneath/pkg/log"
"gitlab.com/beneath-hq/beneath/internal/middleware"

"github.com/go-chi/chi"
"github.com/markbates/goth/gothic"
Expand Down Expand Up @@ -88,7 +88,7 @@ func authCallbackHandler(w http.ResponseWriter, r *http.Request) error {
}

// redirect to client, setting token
url := fmt.Sprintf("%s/auth/callback/login?token=%s", gothConfig.ClientHost, url.QueryEscape(secret.Token.String()))
url := fmt.Sprintf("%s/-/redirects/auth/login/callback?token=%s", gothConfig.ClientHost, url.QueryEscape(secret.Token.String()))
http.Redirect(w, r, url, http.StatusTemporaryRedirect)

// done
Expand Down
4 changes: 2 additions & 2 deletions web/apollo/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ const makeErrorHook = ({ token, res }) => {
if (networkError?.result?.error?.match(/authentication error.*/)) {
if (token) {
if (process.browser) {
document.location.href = "/auth/logout";
document.location.href = "/-/redirects/auth/logout";
} else {
res.redirect("/auth/logout");
res.redirect("/-/redirects/auth/logout");
}
}
}
Expand Down
21 changes: 11 additions & 10 deletions web/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
} from "@material-ui/icons";

const tabs = [
{ label: "Terminal", href: "/terminal", selectRegex: "^/(terminal|project|stream|user).*$", external: false },
{ label: "Docs", href: "https://about.beneath.dev/docs", selectRegex: "^/docs$", external: true },
{ label: "Blog", href: "https://about.beneath.dev/blog", selectRegex: "^/blog$", external: true },
{ label: "Terminal", href: "/", selectRegex: "^/.*$", external: false },
{ label: "Docs", href: "https://about.beneath.dev/docs", selectRegex: "^$", external: true },
{ label: "Blog", href: "https://about.beneath.dev/blog", selectRegex: "^$", external: true },
];

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -108,7 +108,7 @@ const Header: FC<HeaderProps> = ({ toggleMobileDrawer }) => {
makeButton("Login", {
color: "inherit",
size: "small",
href: "/auth",
href: "/-/auth",
})}
{me && (
<React.Fragment>
Expand Down Expand Up @@ -149,13 +149,14 @@ const Header: FC<HeaderProps> = ({ toggleMobileDrawer }) => {
as: `/${me.user.username}/-/secrets`,
href: `/organization?organization_name=${me.user.username}&tab=secrets`,
})}
{!me.billingOrganization.personal && makeMenuItem("Organization", {
onClick: closeMenu,
as: `/${me.billingOrganization.name}`,
href: `/organization?organization_name=${me.billingOrganization.name}`,
})}
{!me.billingOrganization.personal &&
makeMenuItem("Organization", {
onClick: closeMenu,
as: `/${me.billingOrganization.name}`,
href: `/organization?organization_name=${me.billingOrganization.name}`,
})}
{makeMenuItem("Logout", {
href: `/auth/logout`,
href: `/-/redirects/auth/logout`,
})}
</Menu>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion web/components/PageTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Head from "next/head";
export default (props) => (
<Head>
<title>
{props.title ? props.title + " | " : ""} Beneath – Data Science for the Decentralised Economy
{props.title ? props.title + " | " : ""} Beneath
</title>
</Head>
);
6 changes: 3 additions & 3 deletions web/components/Subheader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ interface TerminalCrumbProps {
}

const TerminalCrumb: FC<TerminalCrumbProps> = ({ isCurrent }) => (
<Crumb href="/terminal" as="/terminal" label="Terminal" isCurrent={isCurrent} />
<Crumb href="/" as="/" label="Terminal" isCurrent={isCurrent} />
);

interface ProjectCrumbProps {
Expand All @@ -131,8 +131,8 @@ interface ProjectCrumbProps {
const ProjectCrumb: FC<ProjectCrumbProps> = ({ organization, project, isCurrent }) => (
<Crumb
href={`/project?organization_name=${organization}&project_name=${project}`}
as={`/${organization}/${project}`}
label={project}
as={`/${organization}/${project}`}
label={project}
isCurrent={isCurrent} />
);

Expand Down
2 changes: 1 addition & 1 deletion web/components/stream/StreamAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StreamAPI: FC<StreamAPIProps> = ({ stream }) => {
)}
{!me && (
<>
You'll first have to <LinkTypography href="/auth">create a user</LinkTypography> to get a secret for
You'll first have to <LinkTypography href="/-/auth">create a user</LinkTypography> to get a secret for
connecting to Beneath (don't worry, it's free and we won't share your data with anyone)
</>
)}
Expand Down
24 changes: 10 additions & 14 deletions web/components/terminal/Welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React, { FC } from "react";
import {
Button,
Container,
Grid,
makeStyles,
Theme,
Typography,
} from "@material-ui/core";
import clsx from "clsx";
import NextMuiLinkList from "../NextMuiLinkList";
import React, { FC } from "react";

import { Button, Container, Grid, makeStyles, Theme, Typography } from "@material-ui/core";

import TopProjects from "../../components/terminal/TopProjects";
import NextMuiLinkList from "../NextMuiLinkList";

const useStyles = makeStyles((theme: Theme) => ({
title: {
Expand All @@ -32,15 +27,16 @@ const Welcome: FC = () => {
const classes = useStyles();

return (
<React.Fragment>
<>
<Container maxWidth="lg">
<Typography className={classes.title} component="h1" variant="h1" align="center" gutterBottom>
Welcome to the Beneath Data Terminal
</Typography>
</Container>
<Container maxWidth="md">
<Typography className={classes.subtitle} component="h2" variant="subtitle1" align="center" gutterBottom>
Discover real-time data streams that have been shared with the world. Consume public data or create your own stream in minutes.
Discover real-time data streams that have been shared with the world.
Consume public data or create your own stream in minutes.
</Typography>
<Grid className={classes.buttons} container spacing={2} justify="center">
<Grid item>
Expand All @@ -60,7 +56,7 @@ const Welcome: FC = () => {
color="primary"
variant="outlined"
className={clsx(classes.button, classes.primaryButton)}
href={`/auth`}
href={`/-/auth`}
component={NextMuiLinkList}
>
Create Account
Expand All @@ -69,7 +65,7 @@ const Welcome: FC = () => {
</Grid>
</Container>
<TopProjects/>
</React.Fragment>
</>
)
}

Expand Down
10 changes: 5 additions & 5 deletions web/pages/auth.tsx → web/pages/-/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
} from "@material-ui/core";
import { NextPage } from "next";

import { withApollo } from "../apollo/withApollo";
import { GithubIcon, GoogleIcon } from "../components/Icons";
import Page from "../components/Page";
import VSpace from "../components/VSpace";
import connection from "../lib/connection";
import { withApollo } from "../../apollo/withApollo";
import { GithubIcon, GoogleIcon } from "../../components/Icons";
import Page from "../../components/Page";
import VSpace from "../../components/VSpace";
import connection from "../../lib/connection";

const useStyles = makeStyles((theme: Theme) => ({
authButton: {
Expand Down
33 changes: 23 additions & 10 deletions web/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,31 @@ export default class MyDocument extends Document {
<Head>
{/* This shoud really be the only place you make any changes */}

{/* Meta tags */}
<meta name="robots" content="index, follow" />
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
<meta name="theme-color" content={theme.palette.primary.main} />

{/* Description tag */}
<meta
name="description"
content="Blockchain data science, Ethereum data API, cryptocurrency investigations, dapp analytics"
/>
<meta name="description" content="Beneath is a single platform for building data apps" />

{/* Blog RSS feed */}
<link rel="alternate" href="https://about.beneath.dev/feed.xml" type="application/rss+xml" title="Blog Feed | Beneath" />

{/* <link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono:300,300i,600" rel="stylesheet" /> */}
{/* Favicon */}
<meta name="theme-color" content={theme.palette.background.default} />
<meta name="msapplication-TileColor" content="#10182e" />
<meta name="msapplication-TileImage" content="/assets/favicon/ms-icon-144x144.png" />
<meta name="msapplication-config" content="/assets/favicon/browserconfig.xml" />
<link rel="manifest" href="/assets/favicon/manifest.json" />
<link rel="apple-touch-icon" sizes="57x57" href="/assets/favicon/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="/assets/favicon/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/assets/favicon/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/assets/favicon/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/assets/favicon/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="/assets/favicon/apple-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/assets/favicon/apple-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/assets/favicon/apple-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="192x192" href="/assets/favicon/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/assets/favicon/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png" />

{/* Stripe tag */}
<script src="https://js.stripe.com/v3/"></script>
Expand Down
31 changes: 16 additions & 15 deletions web/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { NextPage } from "next";
import Router from "next/router";
import React from "react";

const Index: NextPage = (props) => {
return <></>;
};
import { withApollo } from "../apollo/withApollo";
import Page from "../components/Page";
import Springboard from "../components/terminal/Springboard";
import Welcome from "../components/terminal/Welcome";
import useMe from "../hooks/useMe";

const Terminal: NextPage = () => {
const me = useMe();
const loggedIn = !!me;

Index.getInitialProps = async ({ res }) => {
if (res) {
res.writeHead(302, {
Location: "/terminal",
});
res.end();
} else {
Router.replace("/terminal");
}
return {};
return (
<Page title="Terminal" contentMarginTop="normal">
{loggedIn && <Springboard />}
{!loggedIn && <Welcome />}
</Page>
);
};

export default Index;
export default withApollo(Terminal);
26 changes: 0 additions & 26 deletions web/pages/terminal.tsx

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions web/public/assets/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file added web/public/assets/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions web/public/assets/favicon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added web/public/assets/favicon/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/assets/favicon/ms-icon-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions web/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /-/auth
Loading

0 comments on commit b6bc68a

Please sign in to comment.