mirror of https://github.com/kern/filepizza
Add lint + build to CI
parent
544408479d
commit
1b8c3cdc92
@ -0,0 +1,3 @@
|
|||||||
|
legacy/
|
||||||
|
node_modules/
|
||||||
|
.next/
|
||||||
@ -1,5 +1,8 @@
|
|||||||
on: push
|
name: main
|
||||||
name: Build on push
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Docker build, tag, and push
|
name: Docker build, tag, and push
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
name: tests
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 14
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- run: npm i -g yarn@1
|
||||||
|
- run: yarn
|
||||||
|
- run: yarn lint
|
||||||
|
- run: yarn build
|
||||||
@ -1,40 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import DownloadStore from '../stores/DownloadStore'
|
|
||||||
import SupportStore from '../stores/SupportStore'
|
|
||||||
|
|
||||||
function getState() {
|
|
||||||
return {
|
|
||||||
active: SupportStore.getState().isChrome && DownloadStore.getState().fileSize >= 500000000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class ChromeNotice extends React.Component {
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super()
|
|
||||||
this.state = getState()
|
|
||||||
|
|
||||||
this._onChange = () => {
|
|
||||||
this.setState(getState())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
DownloadStore.listen(this._onChange)
|
|
||||||
SupportStore.listen(this._onChange)
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
DownloadStore.unlisten(this._onChange)
|
|
||||||
SupportStore.unlisten(this._onChange)
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
if (this.state.active) {
|
|
||||||
return <p className="notice">Chrome has issues downloading files > 500 MB. Try using Firefox instead.</p>
|
|
||||||
} else {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue