Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Release Alpha0.1 (#58)
Browse files Browse the repository at this point in the history
* delete vercel.json

* add vercel.json with rewrites

* update vercel.json

* add github workflow

* remove redirection in webapp

* update the tag for staging

* fix regex to check wether staging

* update the notification bot

* fix set width and add notification in github action

* fix notification build to telegram

* fix push history to close messaging

* add build prod on push main branch

* add notification in prod workflows

* update notification

* fix newline in notification actions to telegram

* chore: remove source map

* chore: remove source map
* fix: better placement to remove sourcemaps on github workflows

* chore: route based code splitting

* chore: add prettier
* refactor: route based code splitting

* enhancement/update login text (#57)

* update the login text in button

* update fallback in route suspense

Co-authored-by: Sigit Prabowo <[email protected]>
  • Loading branch information
mgilangjanuar and sprabowo authored Oct 14, 2021
1 parent 398cbe7 commit 6752c5c
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
node-version: '14.x'
- run: yarn install
- run: REACT_APP_API_URL=https://teledriveapp.com yarn workspaces run build
- run: REACT_APP_API_URL=https://teledriveapp.com GENERATE_SOURCEMAP=false yarn workspaces run build
- name: Compress node_modules root
if: ${{ github.event_name == 'push' }}
run: tar -czf build-root.tar.gz node_modules
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"web",
"server"
]
}
}
10 changes: 10 additions & 0 deletions web/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false
}
21 changes: 12 additions & 9 deletions web/craco.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const CracoAntDesignPlugin = require('craco-antd')
const CracoLessPlugin = require('craco-less')

module.exports = {
plugins: [
{
plugin: CracoAntDesignPlugin,
plugin: CracoLessPlugin,
options: {
customizeTheme: {
'@primary-color': '#0088CC'
},
},
},
],
}
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': '#0088CC' },
javascriptEnabled: true
}
}
}
}
]
}
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@types/react-router-dom": "^5.1.8",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"craco-less": "^1.20.0",
"eslint": "^7.32.0",
"workbox-background-sync": "^5.1.3",
"workbox-broadcast-update": "^5.1.3",
Expand Down
69 changes: 45 additions & 24 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
import { Layout } from 'antd'
import React, { useEffect } from 'react'
import React, { lazy, Suspense, useEffect } from 'react'
import { Route, Switch, useLocation } from 'react-router-dom'
import NotFound from './pages/errors/NotFound'
import Dashboard from './pages/dashboard'
import Contact from './pages/Contact'
import Faq from './pages/Faq'
import Home from './pages/Home'
import Login from './pages/Login'
import Pricing from './pages/Pricing'
import Privacy from './pages/Privacy'
import Terms from './pages/Terms'
import View from './pages/View'

import 'antd/dist/antd.min.css'
import './App.less'

const Dashboard = lazy(
() => import(/* webpackChunkName: 'DashboardPage' */ './pages/dashboard')
)
const Home = lazy(
() => import(/* webpackChunkName: 'HomePage' */ './pages/Home')
)
const View = lazy(
() => import(/* webpackChunkName: 'ViewPage' */ './pages/View')
)
const Login = lazy(
() => import(/* webpackChunkName: 'LoginPage' */ './pages/Login')
)
const Terms = lazy(
() => import(/* webpackChunkName: 'TermsPage' */ './pages/Terms')
)
const Privacy = lazy(
() => import(/* webpackChunkName: 'PrivacyPage' */ './pages/Privacy')
)
const Pricing = lazy(
() => import(/* webpackChunkName: 'PricingPage' */ './pages/Pricing')
)
const Contact = lazy(
() => import(/* webpackChunkName: 'ContactPage' */ './pages/Contact')
)
const Faq = lazy(() => import(/* webpackChunkName: 'FaqPage' */ './pages/Faq'))
const NotFound = lazy(
() => import(/* webpackChunkName: 'NotFoundPage' */ './pages/errors/NotFound')
)

function App(): React.ReactElement {
// if (location.host !== 'teledriveapp.com' && localStorage.getItem('environment') !== 'staging') {
// location.replace(location.href.replace(location.host, 'teledriveapp.com'))
Expand All @@ -24,20 +43,22 @@ function App(): React.ReactElement {

return (
<Layout className="App">
<Switch>
<Route path="/dashboard/:type?" exact component={Dashboard} />
<Route path="/view/:id" exact component={View} />
<Route path="/login" exact component={Login} />
<Route path="/terms" exact component={Terms} />
<Route path="/privacy" exact component={Privacy} />
<Route path="/pricing" exact component={Pricing} />
<Route path="/contact" exact component={Contact} />
<Route path="/faq" exact component={Faq} />
<Route path="/" exact component={Home} />
<Route component={NotFound} />
</Switch>
<Suspense fallback={<></>}>
<Switch>
<Route path="/dashboard/:type?" exact component={Dashboard} />
<Route path="/view/:id" exact component={View} />
<Route path="/login" exact component={Login} />
<Route path="/terms" exact component={Terms} />
<Route path="/privacy" exact component={Privacy} />
<Route path="/pricing" exact component={Pricing} />
<Route path="/contact" exact component={Contact} />
<Route path="/faq" exact component={Faq} />
<Route path="/" exact component={Home} />
<Route component={NotFound} />
</Switch>
</Suspense>
</Layout>
)
}

export default App
export default App
2 changes: 1 addition & 1 deletion web/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const Login: React.FC = () => {
<Input.Password />
</Form.Item>
<Form.Item style={{ marginTop: '50px' }} wrapperCol={{ span: 24 }}>
<Button shape="round" block size="large" type="primary" htmlType="submit" loading={loadingLogin} icon={<LoginOutlined />}>Login</Button>
<Button shape="round" block size="large" type="primary" htmlType="submit" loading={loadingLogin} icon={<LoginOutlined />}>Login with Telegram</Button>
</Form.Item>
</Form>
</Card>
Expand Down
54 changes: 51 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4533,6 +4533,14 @@ [email protected]:
less "^3.11.1"
less-loader "^6.1.0"

craco-less@^1.20.0:
version "1.20.0"
resolved "https://registry.yarnpkg.com/craco-less/-/craco-less-1.20.0.tgz#7f68679b84c7756f785f9c5ee4e4f795662acad1"
integrity sha512-oP7kMRFOwwCPAlS+RBfA0yt9qAfSH8EOzJOQyzspVOECDtATTLXYyEYd0ghoybbReVRZbOmGxNtPWh4ALpVRng==
dependencies:
less "^4.1.1"
less-loader "^7.3.0"

create-ecdh@^4.0.0:
version "4.0.4"
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e"
Expand Down Expand Up @@ -6892,7 +6900,7 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

[email protected]:
[email protected], iconv-lite@^0.4.4:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
Expand Down Expand Up @@ -8356,6 +8364,15 @@ less-loader@^6.1.0:
loader-utils "^2.0.0"
schema-utils "^2.7.0"

less-loader@^7.3.0:
version "7.3.0"
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-7.3.0.tgz#f9d6d36d18739d642067a05fb5bd70c8c61317e5"
integrity sha512-Mi8915g7NMaLlgi77mgTTQvK022xKRQBIVDSyfl3ErTuBhmZBQab0mjeJjNNqGbdR+qrfTleKXqbGI4uEFavxg==
dependencies:
klona "^2.0.4"
loader-utils "^2.0.0"
schema-utils "^3.0.0"

less-vars-to-js@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/less-vars-to-js/-/less-vars-to-js-1.3.0.tgz#c322cf43a3c8fc3fab655da3e51a14c1499ab571"
Expand All @@ -8379,6 +8396,23 @@ less@^3.11.1, less@^3.11.3:
native-request "^1.0.5"
source-map "~0.6.0"

less@^4.1.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/less/-/less-4.1.2.tgz#6099ee584999750c2624b65f80145f8674e4b4b0"
integrity sha512-EoQp/Et7OSOVu0aJknJOtlXZsnr8XE8KwuzTHOLeVSEx8pVWUICc8Q0VYRHgzyjX78nMEyC/oztWFbgyhtNfDA==
dependencies:
copy-anything "^2.0.1"
parse-node-version "^1.0.1"
tslib "^2.3.0"
optionalDependencies:
errno "^0.1.1"
graceful-fs "^4.1.2"
image-size "~0.5.0"
make-dir "^2.1.0"
mime "^1.4.1"
needle "^2.5.2"
source-map "~0.6.0"

leven@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
Expand Down Expand Up @@ -9443,6 +9477,15 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=

needle@^2.5.2:
version "2.9.1"
resolved "https://registry.yarnpkg.com/needle/-/needle-2.9.1.tgz#22d1dffbe3490c2b83e301f7709b6736cd8f2684"
integrity sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==
dependencies:
debug "^3.2.6"
iconv-lite "^0.4.4"
sax "^1.2.4"

[email protected]:
version "0.6.2"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
Expand Down Expand Up @@ -10082,6 +10125,11 @@ parse-json@^5.0.0:
json-parse-even-better-errors "^2.3.0"
lines-and-columns "^1.1.6"

parse-node-version@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b"
integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==

parse5-htmlparser2-tree-adapter@^6.0.0:
version "6.0.1"
resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6"
Expand Down Expand Up @@ -12590,7 +12638,7 @@ sass-loader@^10.0.5:
schema-utils "^3.0.0"
semver "^7.3.2"

sax@>=0.6.0, sax@~1.2.4:
sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
Expand Down Expand Up @@ -13823,7 +13871,7 @@ tslib@^1.10.0, tslib@^1.8.1:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0:
tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
Expand Down

0 comments on commit 6752c5c

Please sign in to comment.