Skip to content

Commit 4731477

Browse files
new ui (#130)
Revamp UI to align with the latest design.
1 parent 1051375 commit 4731477

File tree

107 files changed

+35557
-38111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+35557
-38111
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "dependency/googleapis"]
22
path = dependency/googleapis
33
url = https://github.com/googleapis/googleapis.git
4-
[submodule "web/shared-ui"]
5-
path = web/shared-ui
4+
[submodule "web/packages/shared-ui"]
5+
path = web/packages/shared-ui
66
url = https://github.com/plgd-dev/shared-ui.git

tools/.DS_Store

6 KB
Binary file not shown.

web/.babelrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"presets": [
3+
[
4+
"react-app",
5+
{
6+
"flow": false,
7+
"typescript": true,
8+
"helpers": false
9+
}
10+
]
11+
],
12+
"plugins": [
13+
"@emotion/babel-plugin",
14+
[
15+
"@babel/plugin-transform-react-jsx",
16+
{
17+
"runtime": "automatic",
18+
"importSource": "@emotion/react"
19+
}
20+
]
21+
],
22+
"comments": false
23+
}

web/.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/*
2+
node_modules/*
3+
src/react-app-env.d.ts
4+
src/declarations.d.ts

web/.eslintrc.js

Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,340 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// Inspired by https://github.com/airbnb/javascript but less opinionated.
9+
10+
// We use eslint-loader so even warnings are very visible.
11+
// This is why we only use "WARNING" level for potential errors,
12+
// and we don't use "ERROR" level at all.
13+
14+
// In the future, we might create a separate list of rules for production.
15+
// It would probably be more strict.
16+
17+
// The ESLint browser environment defines all browser globals as valid,
18+
// even though most people don't know some of them exist (e.g. `name` or `status`).
19+
// This is dangerous as it hides accidentally undefined variables.
20+
// We blacklist the globals that we deem potentially confusing.
21+
// To use them, explicitly reference them, e.g. `window.name` or `window.status`.
22+
const restrictedGlobals = require('confusing-browser-globals')
23+
24+
module.exports = {
25+
root: true,
26+
27+
parser: '@typescript-eslint/parser',
28+
29+
plugins: [
30+
'import',
31+
'jsx-a11y',
32+
'react',
33+
'react-hooks',
34+
'@typescript-eslint',
35+
'prettier',
36+
'@emotion'
37+
],
38+
39+
extends: [
40+
'prettier',
41+
],
42+
43+
env: {
44+
browser: true,
45+
commonjs: true,
46+
es6: true,
47+
jest: true,
48+
node: true,
49+
},
50+
51+
parserOptions: {
52+
ecmaVersion: 2018,
53+
sourceType: 'module',
54+
ecmaFeatures: {
55+
jsx: true,
56+
},
57+
},
58+
59+
settings: {
60+
react: {
61+
version: 'detect',
62+
},
63+
},
64+
65+
overrides: [
66+
{
67+
files: ['**/*.ts?(x)'],
68+
parser: '@typescript-eslint/parser',
69+
parserOptions: {
70+
ecmaVersion: 2018,
71+
sourceType: 'module',
72+
ecmaFeatures: {
73+
jsx: true,
74+
},
75+
76+
// typescript-eslint specific options
77+
warnOnUnsupportedTypeScriptVersion: true,
78+
},
79+
plugins: ['@typescript-eslint'],
80+
// If adding a typescript-eslint version of an existing ESLint rule,
81+
// make sure to disable the ESLint rule here.
82+
rules: {
83+
// TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
84+
'default-case': 'off',
85+
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
86+
'no-dupe-class-members': 'off',
87+
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
88+
'no-undef': 'off',
89+
90+
// Add TypeScript specific rules (and turn off ESLint equivalents)
91+
'@typescript-eslint/consistent-type-assertions': 'warn',
92+
'no-array-constructor': 'off',
93+
'@typescript-eslint/no-array-constructor': 'warn',
94+
'no-redeclare': 'off',
95+
'@typescript-eslint/no-redeclare': 'warn',
96+
'no-use-before-define': 'off',
97+
'@typescript-eslint/no-use-before-define': [
98+
'warn',
99+
{
100+
functions: false,
101+
classes: false,
102+
variables: false,
103+
typedefs: false,
104+
},
105+
],
106+
'no-unused-expressions': 'off',
107+
'@typescript-eslint/no-unused-expressions': [
108+
'error',
109+
{
110+
allowShortCircuit: true,
111+
allowTernary: true,
112+
allowTaggedTemplates: true,
113+
},
114+
],
115+
'no-unused-vars': 'off',
116+
'@typescript-eslint/no-unused-vars': [
117+
'warn',
118+
{
119+
args: 'none',
120+
ignoreRestSiblings: true,
121+
},
122+
],
123+
'no-useless-constructor': 'off',
124+
'@typescript-eslint/no-useless-constructor': 'warn',
125+
},
126+
},
127+
],
128+
129+
rules: {
130+
// http://eslint.org/docs/rules/
131+
'array-callback-return': 'warn',
132+
'default-case': ['warn', { commentPattern: '^no default$' }],
133+
'dot-location': ['warn', 'property'],
134+
eqeqeq: ['warn', 'smart'],
135+
'new-parens': 'warn',
136+
'no-array-constructor': 'warn',
137+
'no-caller': 'warn',
138+
'no-cond-assign': ['warn', 'always'],
139+
'no-const-assign': 'warn',
140+
'no-control-regex': 'warn',
141+
'no-delete-var': 'warn',
142+
'no-dupe-args': 'warn',
143+
'no-dupe-class-members': 'warn',
144+
'no-dupe-keys': 'warn',
145+
'no-duplicate-case': 'warn',
146+
'no-empty-character-class': 'warn',
147+
'no-empty-pattern': 'warn',
148+
'no-eval': 'warn',
149+
'no-ex-assign': 'warn',
150+
'no-extend-native': 'warn',
151+
'no-extra-bind': 'warn',
152+
'no-extra-label': 'warn',
153+
'no-fallthrough': 'warn',
154+
'no-func-assign': 'warn',
155+
'no-implied-eval': 'warn',
156+
'no-invalid-regexp': 'warn',
157+
'no-iterator': 'warn',
158+
'no-label-var': 'warn',
159+
'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
160+
'no-lone-blocks': 'warn',
161+
'no-loop-func': 'warn',
162+
'no-mixed-operators': [
163+
'warn',
164+
{
165+
groups: [
166+
['&', '|', '^', '~', '<<', '>>', '>>>'],
167+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
168+
['&&', '||'],
169+
['in', 'instanceof'],
170+
],
171+
allowSamePrecedence: false,
172+
},
173+
],
174+
'no-multi-str': 'warn',
175+
'no-native-reassign': 'warn',
176+
'no-negated-in-lhs': 'warn',
177+
'no-new-func': 'warn',
178+
'no-new-object': 'warn',
179+
'no-new-symbol': 'warn',
180+
'no-new-wrappers': 'warn',
181+
'no-obj-calls': 'warn',
182+
'no-octal': 'warn',
183+
'no-octal-escape': 'warn',
184+
'no-redeclare': 'warn',
185+
'no-regex-spaces': 'warn',
186+
'no-restricted-syntax': ['warn', 'WithStatement'],
187+
'no-script-url': 'warn',
188+
'no-self-assign': 'warn',
189+
'no-self-compare': 'warn',
190+
'no-sequences': 'warn',
191+
'no-shadow-restricted-names': 'warn',
192+
'no-sparse-arrays': 'warn',
193+
'no-template-curly-in-string': 'warn',
194+
'no-this-before-super': 'warn',
195+
'no-throw-literal': 'warn',
196+
'no-undef': 'error',
197+
'no-restricted-globals': ['error'].concat(restrictedGlobals),
198+
'no-unexpected-multiline': 'warn',
199+
'no-unreachable': 'warn',
200+
'no-unused-expressions': [
201+
'warn',
202+
{
203+
allowShortCircuit: true,
204+
allowTernary: true,
205+
allowTaggedTemplates: true,
206+
},
207+
],
208+
'no-unused-labels': 'warn',
209+
'no-unused-vars': [
210+
'warn',
211+
{
212+
args: 'none',
213+
ignoreRestSiblings: true,
214+
},
215+
],
216+
'no-use-before-define': [
217+
'warn',
218+
{
219+
functions: false,
220+
classes: false,
221+
variables: false,
222+
},
223+
],
224+
'no-useless-computed-key': 'warn',
225+
'no-useless-concat': 'warn',
226+
'no-useless-constructor': 'warn',
227+
'no-useless-escape': 'warn',
228+
'no-useless-rename': [
229+
'warn',
230+
{
231+
ignoreDestructuring: false,
232+
ignoreImport: false,
233+
ignoreExport: false,
234+
},
235+
],
236+
'no-with': 'warn',
237+
'no-whitespace-before-property': 'warn',
238+
'react-hooks/exhaustive-deps': 'warn',
239+
'require-yield': 'warn',
240+
'rest-spread-spacing': ['warn', 'never'],
241+
strict: ['warn', 'never'],
242+
'unicode-bom': ['warn', 'never'],
243+
'use-isnan': 'warn',
244+
'valid-typeof': 'warn',
245+
'no-restricted-properties': [
246+
'error',
247+
{
248+
object: 'require',
249+
property: 'ensure',
250+
message:
251+
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
252+
},
253+
{
254+
object: 'System',
255+
property: 'import',
256+
message:
257+
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
258+
},
259+
],
260+
'getter-return': 'warn',
261+
262+
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
263+
'import/first': 'error',
264+
'import/no-amd': 'error',
265+
// we use !!snip-loader! in presenter to display snippets code
266+
// 'import/no-webpack-loader-syntax': 'error',
267+
268+
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
269+
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
270+
"react/jsx-curly-brace-presence": ['warn', { props: "never", "children": "ignore" }],
271+
'react/jsx-no-comment-textnodes': 'warn',
272+
'react/jsx-no-duplicate-props': 'warn',
273+
'react/jsx-no-target-blank': 'warn',
274+
'react/jsx-no-undef': 'error',
275+
'react/jsx-pascal-case': [
276+
'warn',
277+
{
278+
allowAllCaps: true,
279+
ignore: [],
280+
},
281+
],
282+
'react/jsx-uses-react': 'warn',
283+
'react/jsx-uses-vars': 'warn',
284+
'react/jsx-sort-props': [
285+
'warn',
286+
{
287+
shorthandFirst: true,
288+
},
289+
],
290+
'react/no-danger-with-children': 'warn',
291+
// Disabled because of undesirable warnings
292+
// See https://github.com/facebook/create-react-app/issues/5204 for
293+
// blockers until its re-enabled
294+
// 'react/no-deprecated': 'warn',
295+
'react/no-direct-mutation-state': 'warn',
296+
'react/no-is-mounted': 'warn',
297+
'react/no-typos': 'error',
298+
'react/react-in-jsx-scope': 'off',
299+
'react/require-render-return': 'error',
300+
// Disabled because Tooltip uses style property
301+
// 'react/style-prop-object': 'warn',
302+
303+
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
304+
'jsx-a11y/alt-text': 'warn',
305+
'jsx-a11y/anchor-has-content': 'warn',
306+
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
307+
'jsx-a11y/aria-props': 'warn',
308+
'jsx-a11y/aria-proptypes': 'warn',
309+
'jsx-a11y/aria-role': ['warn', { ignoreNonDOM: true }],
310+
'jsx-a11y/aria-unsupported-elements': 'warn',
311+
'jsx-a11y/heading-has-content': 'warn',
312+
'jsx-a11y/iframe-has-title': 'warn',
313+
'jsx-a11y/img-redundant-alt': 'warn',
314+
'jsx-a11y/no-access-key': 'warn',
315+
'jsx-a11y/no-distracting-elements': 'warn',
316+
'jsx-a11y/no-redundant-roles': 'warn',
317+
'jsx-a11y/role-has-required-aria-props': 'warn',
318+
'jsx-a11y/role-supports-aria-props': 'warn',
319+
'jsx-a11y/scope': 'warn',
320+
321+
// https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
322+
'react-hooks/rules-of-hooks': 'error',
323+
324+
// custom rules
325+
// https://standardjs.com/rules.html
326+
'no-duplicate-imports': 'warn',
327+
'no-extra-boolean-cast': 'warn',
328+
'no-inner-declarations': 'warn',
329+
'no-irregular-whitespace': 'warn',
330+
'no-path-concat': 'warn',
331+
'spaced-comment': 'warn',
332+
'yoda': 'warn',
333+
// 'camelcase': 'warn', Can't be used until we will have UNSAFE_* methods
334+
'no-tabs': 'warn',
335+
336+
// Prettier
337+
'prettier/prettier': ['error', { singleQuote: true }],
338+
// "@emotion/jsx-import": "error"
339+
},
340+
}

web/.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Exclude everything by default
2+
/**/*
3+
4+
# But don't exclude folders
5+
!/**/*/
6+
7+
# Include specific file extensions if they appear under a "src" folder
8+
!src/**/*.js
9+
!src/**/*.jsx
10+
!src/**/*.ts
11+
!src/**/*.tsx

0 commit comments

Comments
 (0)