mirror of https://github.com/kern/filepizza
Migrate some stuff
parent
60aea54f6f
commit
b601c89eeb
@ -1,99 +0,0 @@
|
|||||||
import FrozenHead from 'react-frozenhead'
|
|
||||||
import React from 'react'
|
|
||||||
import { RouteHandler } from 'react-router'
|
|
||||||
import ga from 'react-google-analytics'
|
|
||||||
import SupportStore from '../stores/SupportStore'
|
|
||||||
import ErrorPage from './ErrorPage'
|
|
||||||
import Bootstrap from './Bootstrap'
|
|
||||||
|
|
||||||
if (process.env.GA_ACCESS_TOKEN) {
|
|
||||||
ga('create', process.env.GA_ACCESS_TOKEN, 'auto')
|
|
||||||
ga('send', 'pageview')
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class App extends React.Component {
|
|
||||||
constructor() {
|
|
||||||
super()
|
|
||||||
this.state = SupportStore.getState()
|
|
||||||
|
|
||||||
this._onChange = () => {
|
|
||||||
this.setState(SupportStore.getState())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
SupportStore.listen(this._onChange)
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
SupportStore.unlisten(this._onChange)
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<html lang="en">
|
|
||||||
<FrozenHead>
|
|
||||||
<meta charSet="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<meta name="monetization" content="$twitter.xrptipbot.com/kernio" />
|
|
||||||
<meta property="og:url" content="https://file.pizza" />
|
|
||||||
<meta
|
|
||||||
property="og:title"
|
|
||||||
content="FilePizza - Your files, delivered."
|
|
||||||
/>
|
|
||||||
<meta
|
|
||||||
property="og:description"
|
|
||||||
content="Peer-to-peer file transfers in your web browser."
|
|
||||||
/>
|
|
||||||
<meta
|
|
||||||
property="og:image"
|
|
||||||
content="https://file.pizza/images/fb.png"
|
|
||||||
/>
|
|
||||||
<title>FilePizza - Your files, delivered.</title>
|
|
||||||
<link rel="stylesheet" href="/fonts/fonts.css" />
|
|
||||||
<Bootstrap data={this.props.data} />
|
|
||||||
<script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js" />
|
|
||||||
<script src="/app.js" />
|
|
||||||
</FrozenHead>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div className="container">
|
|
||||||
{this.state.isSupported ? <RouteHandler /> : <ErrorPage />}
|
|
||||||
</div>
|
|
||||||
<footer className="footer">
|
|
||||||
<p>
|
|
||||||
<strong>Like FilePizza?</strong> Support its development!{' '}
|
|
||||||
<a
|
|
||||||
href="https://commerce.coinbase.com/checkout/247b6ffe-fb4e-47a8-9a76-e6b7ef83ea22"
|
|
||||||
className="donate-button"
|
|
||||||
>
|
|
||||||
donate
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p className="byline">
|
|
||||||
Cooked up by{' '}
|
|
||||||
<a href="http://kern.io" target="_blank">
|
|
||||||
Alex Kern
|
|
||||||
</a>{' '}
|
|
||||||
&{' '}
|
|
||||||
<a href="http://neeraj.io" target="_blank">
|
|
||||||
Neeraj Baid
|
|
||||||
</a>{' '}
|
|
||||||
while eating <strong>Sliver</strong> @ UC Berkeley ·{' '}
|
|
||||||
<a href="https://github.com/kern/filepizza#faq" target="_blank">
|
|
||||||
FAQ
|
|
||||||
</a>{' '}
|
|
||||||
·{' '}
|
|
||||||
<a href="https://github.com/kern/filepizza" target="_blank">
|
|
||||||
Fork us
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</footer>
|
|
||||||
<script>FilePizza()</script>
|
|
||||||
{process.env.GA_ACCESS_TOKEN ? <ga.Initializer /> : <div></div>}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
|
|
||||||
export default class Bootstrap extends React.Component {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<script
|
|
||||||
id="bootstrap"
|
|
||||||
type="application/json"
|
|
||||||
dangerouslySetInnerHTML={{ __html: this.props.data }}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export const Footer: React.FC = () => (
|
||||||
|
<footer className="footer">
|
||||||
|
<p>
|
||||||
|
<strong>Like FilePizza?</strong> Support its development!{' '}
|
||||||
|
<a
|
||||||
|
href="https://commerce.coinbase.com/checkout/247b6ffe-fb4e-47a8-9a76-e6b7ef83ea22"
|
||||||
|
className="donate-button"
|
||||||
|
>
|
||||||
|
donate
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p className="byline">
|
||||||
|
Cooked up by{' '}
|
||||||
|
<a href="http://kern.io" target="_blank">
|
||||||
|
Alex Kern
|
||||||
|
</a>{' '}
|
||||||
|
&{' '}
|
||||||
|
<a href="http://neeraj.io" target="_blank">
|
||||||
|
Neeraj Baid
|
||||||
|
</a>{' '}
|
||||||
|
while eating <strong>Sliver</strong> @ UC Berkeley ·{' '}
|
||||||
|
<a href="https://github.com/kern/filepizza#faq" target="_blank">
|
||||||
|
FAQ
|
||||||
|
</a>{' '}
|
||||||
|
·{' '}
|
||||||
|
<a href="https://github.com/kern/filepizza" target="_blank">
|
||||||
|
Fork us
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default Footer
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import type { AppProps } from 'next/app'
|
||||||
|
import Head from 'next/head'
|
||||||
|
import Footer from '../components/Footer'
|
||||||
|
|
||||||
|
const App: React.FC<AppProps> = ({ Component, pageProps }: AppProps) => (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<meta charSet="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta name="monetization" content="$twitter.xrptipbot.com/kernio" />
|
||||||
|
<meta property="og:url" content="https://file.pizza" />
|
||||||
|
<meta property="og:title" content="FilePizza • Your files, delivered." />
|
||||||
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content="Peer-to-peer file transfers in your web browser."
|
||||||
|
/>
|
||||||
|
<meta property="og:image" content="https://file.pizza/images/fb.png" />
|
||||||
|
<title>FilePizza • Your files, delivered.</title>
|
||||||
|
<meta property="og:title" content="FilePizza" key="title" />
|
||||||
|
</Head>
|
||||||
|
|
||||||
|
<Component {...pageProps} />
|
||||||
|
|
||||||
|
<Footer />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default App
|
||||||
Loading…
Reference in New Issue