diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 65896df..0000000 --- a/.drone.yml +++ /dev/null @@ -1,32 +0,0 @@ -kind: pipeline -name: default - -steps: - - name: build - image: node:12-alpine - pull: always - commands: - - node -v - - npm -v - - yarn - - yarn run build - - - name: deploy - image: cupcakearmy/drone-deploy - pull: always - settings: - host: nicco.io - user: root - key: - from_secret: ssh_key - port: 1312 - target: /srv/web/rauchmelder - sources: - - ./dist - - ./docker-compose.prod.yml - commands: - - docker-compose -f docker-compose.prod.yml down - - docker-compose -f docker-compose.prod.yml up -d - when: - event: push - branch: master \ No newline at end of file diff --git a/.gitignore b/.gitignore index 87df5a8..640aaa5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ pnpm-lock.yaml dist .idea -.vscode \ No newline at end of file +.vscode +.vercel \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml deleted file mode 100644 index ffd6d06..0000000 --- a/docker-compose.prod.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3.6' - -services: - home: - image: nginx:alpine - restart: always - ports: - - 80 - volumes: - - ./dist:/usr/share/nginx/html:ro - networks: - - traefik - labels: - - traefik.enable=true - - traefik.port=80 - - traefik.docker.network=traefik - - traefik.backend=rauchmelder - - traefik.frontend.rule=Host:rauchmelder.nicco.io - -networks: - traefik: - external: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 7469a30..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' - -services: - home: - image: nginx:alpine - restart: always - ports: - - 80 - volumes: - - ./public:/usr/share/nginx/html:ro \ No newline at end of file diff --git a/package.json b/package.json index 152924c..d9a54da 100755 --- a/package.json +++ b/package.json @@ -7,18 +7,18 @@ ], "scripts": { "dev": "parcel ./src/index.html", - "build": "parcel build ./src/index.html" + "build": "parcel build --no-source-maps ./src/index.html" }, "dependencies": { - "moment": "^2.24.0", + "dayjs": "^1.10.4", "react": "16.9", "react-dom": "16.9" }, "devDependencies": { "@types/react": "16.9", "@types/react-dom": "16.9", - "stylus": "^0.54.7", "parcel-bundler": "^1.12.4", + "stylus": "^0.54.7", "typescript": "^3.7" } -} \ No newline at end of file +} diff --git a/src/Components/App.tsx b/src/Components/App.tsx index 242b820..0488c54 100644 --- a/src/Components/App.tsx +++ b/src/Components/App.tsx @@ -1,35 +1,41 @@ import React, { useState, useCallback } from 'react' -import moment from 'moment' +import Duration from 'dayjs/plugin/duration' +import RelativeTime from 'dayjs/plugin/relativeTime' +import dj from 'dayjs' + +dj.extend(Duration) +dj.extend(RelativeTime) import ShowTime from './ShowTime' import Switcher from './Switcher' export const Glories = { - Cosi: moment('2019-02-12').unix(), - Georg: moment('2019-11-08').unix() + Cosi: dj('2019-02-12').unix(), + Georg: dj('2019-11-08').unix(), } export type Person = keyof typeof Glories -const init: Person = window.localStorage.getItem('selected') as Person || 'Cosi' +const init: Person = (window.localStorage.getItem('selected') as Person) || 'Cosi' const App: React.FC = () => { + const [person, setPerson] = useState(init) - const [person, setPerson] = useState(init) + const _set = useCallback((p: Person) => { + window.localStorage.setItem('selected', p) + setPerson(p) + }, []) - const _set = useCallback((p: Person) => { - window.localStorage.setItem('selected', p) - setPerson(p) - }, []) - - return