initial conversion
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -25,3 +25,6 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
|
.cache
|
||||||
|
public
|
||||||
10
gatsby-browser.js
Normal file
10
gatsby-browser.js
Normal 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
7
gatsby-config.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
{
|
||||||
|
resolve: `gatsby-plugin-emotion`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
9
gatsby-node.js
Normal file
9
gatsby-node.js
Normal 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
10
gatsby-ssr.js
Normal 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>
|
||||||
|
)
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
"date-fns": "^1.30.1",
|
"date-fns": "^1.30.1",
|
||||||
"emotion-theming": "^10.0.10",
|
"emotion-theming": "^10.0.10",
|
||||||
"firebase": "^5.9.0",
|
"firebase": "^5.9.0",
|
||||||
|
"gatsby": "^2.4.3",
|
||||||
|
"gatsby-plugin-emotion": "^4.0.6",
|
||||||
"react": "^16.8.4",
|
"react": "^16.8.4",
|
||||||
"react-dom": "^16.8.4",
|
"react-dom": "^16.8.4",
|
||||||
"react-feather": "^1.1.6",
|
"react-feather": "^1.1.6",
|
||||||
|
|||||||
@@ -1,45 +1 @@
|
|||||||
<!DOCTYPE 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>
|
||||||
<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>
|
|
||||||
20
src/App.js
20
src/App.js
@@ -97,39 +97,39 @@ class App extends Component {
|
|||||||
<RouteLayout>
|
<RouteLayout>
|
||||||
<PrivateRoute
|
<PrivateRoute
|
||||||
authed={authed}
|
authed={authed}
|
||||||
path="/:year(\d+)"
|
path="/app/:year(\d+)"
|
||||||
component={Year}
|
component={Year}
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
<PrivateRoute
|
<PrivateRoute
|
||||||
authed={authed}
|
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}
|
component={Month}
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
<PrivateRoute
|
<PrivateRoute
|
||||||
authed={authed}
|
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}
|
component={Day}
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
<PrivateRoute
|
<PrivateRoute
|
||||||
authed={authed}
|
authed={authed}
|
||||||
path="/search"
|
path="/app/search"
|
||||||
component={Search}
|
component={Search}
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
<PrivateRoute
|
<PrivateRoute
|
||||||
authed={authed}
|
authed={authed}
|
||||||
path="/user"
|
path="/app/user"
|
||||||
component={User}
|
component={User}
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
<Route path="/login" component={Login} exact />
|
<Route path="/app/login" component={Login} exact />
|
||||||
<Route path="/register" component={Register} exact />
|
<Route path="/app/register" component={Register} exact />
|
||||||
<Route path="/terms" component={Terms} exact />
|
<Route path="/app/terms" component={Terms} exact />
|
||||||
<Route path="/privacy" component={Privacy} exact />
|
<Route path="/app/privacy" component={Privacy} exact />
|
||||||
<Route path="/" component={Start} exact />
|
<Route path="/app" component={Start} exact />
|
||||||
</RouteLayout>
|
</RouteLayout>
|
||||||
</FullscreenLayout>
|
</FullscreenLayout>
|
||||||
</Router>
|
</Router>
|
||||||
|
|||||||
20
src/components/Layout/Layout.js
Normal file
20
src/components/Layout/Layout.js
Normal 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}
|
||||||
|
</>
|
||||||
|
)
|
||||||
2
src/components/Layout/index.js
Normal file
2
src/components/Layout/index.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import Layout from "./Layout"
|
||||||
|
export default Layout
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import React from "react"
|
||||||
import { withTheme } from "emotion-theming"
|
import { withTheme } from "emotion-theming"
|
||||||
import { Link } from "react-router-dom"
|
import { Link } from "react-router-dom"
|
||||||
import styled from "@emotion/styled"
|
import styled from "@emotion/styled"
|
||||||
@@ -57,7 +58,9 @@ export const P = styled.p`
|
|||||||
color: ${props => props.theme.colors.secondary};
|
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;
|
text-decoration: none;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from "react"
|
import React, { Component } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { AppLink as Link } from "../../../components/elements"
|
||||||
import styled from "@emotion/styled"
|
import styled from "@emotion/styled"
|
||||||
import {
|
import {
|
||||||
isAfter,
|
isAfter,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component } from "react"
|
import { Component } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { AppLink as Link } from "../../elements"
|
||||||
/** @jsx jsx */
|
/** @jsx jsx */
|
||||||
import { jsx, css, keyframes } from "@emotion/core"
|
import { jsx, css, keyframes } from "@emotion/core"
|
||||||
import styled from "@emotion/styled"
|
import styled from "@emotion/styled"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from "react"
|
import React, { Component } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { AppLink as Link } from "../../elements"
|
||||||
import styled from "@emotion/styled"
|
import styled from "@emotion/styled"
|
||||||
import { withTheme } from "emotion-theming"
|
import { withTheme } from "emotion-theming"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from "react"
|
import React, { Component } from "react"
|
||||||
import { Link } from "react-router-dom"
|
import { AppLink as Link } from "../../../components/elements"
|
||||||
import styled from "@emotion/styled"
|
import styled from "@emotion/styled"
|
||||||
import { addYears, subYears, format, isThisYear, getMonth } from "date-fns"
|
import { addYears, subYears, format, isThisYear, getMonth } from "date-fns"
|
||||||
import { withTheme } from "emotion-theming"
|
import { withTheme } from "emotion-theming"
|
||||||
|
|||||||
10
src/pages/app.js
Normal file
10
src/pages/app.js
Normal 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
2
src/pages/index.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import Index from "../components/screens/Start/index"
|
||||||
|
export default Index
|
||||||
Reference in New Issue
Block a user