initial conversion

This commit is contained in:
Kyle Gill
2019-05-13 19:01:11 -06:00
parent 02b42f623d
commit d4b9465c49
18 changed files with 3452 additions and 177 deletions

3
.gitignore vendored
View File

@@ -25,3 +25,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.cache
public

10
gatsby-browser.js Normal file
View File

@@ -0,0 +1,10 @@
import React from "react"
import { ThemeProvider } from "emotion-theming"
import Firebase, { FirebaseContext } from "./src/components/firebase"
import theme from "./src/styles/theme"
export const wrapRootElement = ({ element }) => (
<FirebaseContext.Provider value={new Firebase()}>
<ThemeProvider theme={theme.DARK}>{element}</ThemeProvider>
</FirebaseContext.Provider>
)

7
gatsby-config.js Normal file
View File

@@ -0,0 +1,7 @@
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-emotion`,
},
],
}

9
gatsby-node.js Normal file
View File

@@ -0,0 +1,9 @@
exports.onCreatePage = async ({ page, actions }) => {
const { createPage } = actions
if (page.path.match(/^\/app/)) {
page.matchPath = "/app/*"
createPage(page)
}
}

10
gatsby-ssr.js Normal file
View File

@@ -0,0 +1,10 @@
import React from "react"
import { ThemeProvider } from "emotion-theming"
import Firebase, { FirebaseContext } from "./src/components/firebase"
import theme from "./src/styles/theme"
export const wrapRootElement = ({ element }) => (
<FirebaseContext.Provider value={new Firebase()}>
<ThemeProvider theme={theme.LIGHT}>{element}</ThemeProvider>
</FirebaseContext.Provider>
)

View File

@@ -9,6 +9,8 @@
"date-fns": "^1.30.1",
"emotion-theming": "^10.0.10",
"firebase": "^5.9.0",
"gatsby": "^2.4.3",
"gatsby-plugin-emotion": "^4.0.6",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-feather": "^1.1.6",

View File

@@ -1,45 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link
href="https://fonts.googleapis.com/css?family=Montserrat:400,700"
rel="stylesheet"
/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Sol Journal</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><script src="/socket.io/socket.io.js"></script></head><body><noscript id="gatsby-noscript">This app works best with JavaScript enabled.</noscript><div id="___gatsby"></div><script src="/commons.js"></script></body></html>

View File

@@ -97,39 +97,39 @@ class App extends Component {
<RouteLayout>
<PrivateRoute
authed={authed}
path="/:year(\d+)"
path="/app/:year(\d+)"
component={Year}
exact
/>
<PrivateRoute
authed={authed}
path="/:year(\d+)/:month(0[1-9]|1[0-2]+)"
path="/app/:year(\d+)/:month(0[1-9]|1[0-2]+)"
component={Month}
exact
/>
<PrivateRoute
authed={authed}
path="/:year(\d+)/:month(0[1-9]|1[0-2]+)/:day(\d+)"
path="/app/:year(\d+)/:month(0[1-9]|1[0-2]+)/:day(\d+)"
component={Day}
exact
/>
<PrivateRoute
authed={authed}
path="/search"
path="/app/search"
component={Search}
exact
/>
<PrivateRoute
authed={authed}
path="/user"
path="/app/user"
component={User}
exact
/>
<Route path="/login" component={Login} exact />
<Route path="/register" component={Register} exact />
<Route path="/terms" component={Terms} exact />
<Route path="/privacy" component={Privacy} exact />
<Route path="/" component={Start} exact />
<Route path="/app/login" component={Login} exact />
<Route path="/app/register" component={Register} exact />
<Route path="/app/terms" component={Terms} exact />
<Route path="/app/privacy" component={Privacy} exact />
<Route path="/app" component={Start} exact />
</RouteLayout>
</FullscreenLayout>
</Router>

View File

@@ -0,0 +1,20 @@
import React from "react"
import { Global, css } from "@emotion/core"
import styled from "@emotion/styled"
export default ({ children }) => (
<>
<Global
styles={css`
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
}
`}
/>
{children}
</>
)

View File

@@ -0,0 +1,2 @@
import Layout from "./Layout"
export default Layout

View File

@@ -1,3 +1,4 @@
import React from "react"
import { withTheme } from "emotion-theming"
import { Link } from "react-router-dom"
import styled from "@emotion/styled"
@@ -57,7 +58,9 @@ export const P = styled.p`
color: ${props => props.theme.colors.secondary};
`
export const StyledLink = withTheme(styled(Link)`
export const AppLink = props => <Link {...props} to={"/app" + props.to} />
export const StyledLink = withTheme(styled(AppLink)`
text-decoration: none;
border-radius: 12px;
outline: none;

View File

@@ -1,5 +1,5 @@
import React, { Component } from "react"
import { Link } from "react-router-dom"
import { AppLink as Link } from "../../../components/elements"
import styled from "@emotion/styled"
import {
isAfter,

View File

@@ -1,5 +1,5 @@
import { Component } from "react"
import { Link } from "react-router-dom"
import { AppLink as Link } from "../../elements"
/** @jsx jsx */
import { jsx, css, keyframes } from "@emotion/core"
import styled from "@emotion/styled"

View File

@@ -1,5 +1,5 @@
import React, { Component } from "react"
import { Link } from "react-router-dom"
import { AppLink as Link } from "../../elements"
import styled from "@emotion/styled"
import { withTheme } from "emotion-theming"

View File

@@ -1,5 +1,5 @@
import React, { Component } from "react"
import { Link } from "react-router-dom"
import { AppLink as Link } from "../../../components/elements"
import styled from "@emotion/styled"
import { addYears, subYears, format, isThisYear, getMonth } from "date-fns"
import { withTheme } from "emotion-theming"

10
src/pages/app.js Normal file
View File

@@ -0,0 +1,10 @@
import React from "react"
import App from "../App"
import Layout from "../components/Layout"
export default () => (
<Layout>
<App />
</Layout>
)

2
src/pages/index.js Normal file
View File

@@ -0,0 +1,2 @@
import Index from "../components/screens/Start/index"
export default Index

3475
yarn.lock

File diff suppressed because it is too large Load Diff