From 6dbce7a869baed320ff739c74a094b3e5f94748f Mon Sep 17 00:00:00 2001 From: YH_hao_are_you Date: Thu, 26 Jan 2023 23:06:03 +0900 Subject: [PATCH] User auth for Forum (#421) * feat: User login & verify auth when opening thread form and creating new thread * chore: add todo message for implementing submitting new thread API * feat: Add auth for comment form * feat: value and onChange func for new thread form --- apps/forum/package.json | 3 + apps/forum/pnpm-lock.yaml | 704 +++++++++++++----- apps/forum/src/components/CommentForm.tsx | 72 +- apps/forum/src/components/CreateThread.tsx | 65 +- .../forum/src/components/SchoolFilterForm.tsx | 6 +- apps/forum/src/components/icons/CloseIcon.tsx | 6 + apps/forum/src/components/icons/SendIcon.tsx | 8 + apps/forum/src/root.component.tsx | 3 + 8 files changed, 669 insertions(+), 198 deletions(-) create mode 100644 apps/forum/src/components/icons/CloseIcon.tsx create mode 100644 apps/forum/src/components/icons/SendIcon.tsx diff --git a/apps/forum/package.json b/apps/forum/package.json index 8c6496680..876d6221c 100644 --- a/apps/forum/package.json +++ b/apps/forum/package.json @@ -54,13 +54,16 @@ "typescript": "4.6.2" }, "dependencies": { + "@aws-amplify/api": "4.0.42", "@aws-amplify/auth": "4.4.4", "@bit/wasedatime.core.theme.colors": "^0.0.5", "@bit/wasedatime.core.ts.constants.langs": "0.0.5", "@bit/wasedatime.core.ts.ui.header": "0.2.21", "@bit/wasedatime.core.ts.ui.loading-spinner": "0.1.5", + "@bit/wasedatime.core.ts.ui.sign-in-modal": "0.1.6", "@bit/wasedatime.core.ts.utils.i18n": "0.0.4", "@bit/wasedatime.core.ts.utils.responsive-utils": "0.0.1", + "@bit/wasedatime.core.ts.utils.user": "0.0.4", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "@fortawesome/free-solid-svg-icons": "6.0.0", diff --git a/apps/forum/pnpm-lock.yaml b/apps/forum/pnpm-lock.yaml index a9618e5d6..d0846576d 100644 --- a/apps/forum/pnpm-lock.yaml +++ b/apps/forum/pnpm-lock.yaml @@ -4,6 +4,7 @@ overrides: esbuild: 0.14.43 specifiers: + '@aws-amplify/api': 4.0.42 '@aws-amplify/auth': 4.4.4 '@babel/core': 7.17.5 '@babel/eslint-parser': 7.17.0 @@ -18,8 +19,10 @@ specifiers: '@bit/wasedatime.core.ts.constants.langs': 0.0.5 '@bit/wasedatime.core.ts.ui.header': 0.2.21 '@bit/wasedatime.core.ts.ui.loading-spinner': 0.1.5 + '@bit/wasedatime.core.ts.ui.sign-in-modal': 0.1.6 '@bit/wasedatime.core.ts.utils.i18n': 0.0.4 '@bit/wasedatime.core.ts.utils.responsive-utils': 0.0.1 + '@bit/wasedatime.core.ts.utils.user': 0.0.4 '@emotion/react': 11.9.0 '@emotion/styled': 11.8.1 '@fortawesome/fontawesome-svg-core': 1.3.0 @@ -74,13 +77,16 @@ specifiers: vite-plugin-dynamic-import: ^0.7.1 dependencies: + '@aws-amplify/api': 4.0.42_react-native@0.68.5 '@aws-amplify/auth': 4.4.4_react-native@0.68.5 - '@bit/wasedatime.core.theme.colors': 0.0.5 - '@bit/wasedatime.core.ts.constants.langs': 0.0.5_react-dom@17.0.2+react@17.0.2 - '@bit/wasedatime.core.ts.ui.header': 0.2.21_85437955bddca72fa9ee81a991b14a9d - '@bit/wasedatime.core.ts.ui.loading-spinner': 0.1.5_af520ff3c650e6a6d05e9a79e9549b09 - '@bit/wasedatime.core.ts.utils.i18n': 0.0.4_1622241db2281c7eeaec01382c7056b3 - '@bit/wasedatime.core.ts.utils.responsive-utils': 0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.theme.colors': node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.5 + '@bit/wasedatime.core.ts.constants.langs': node.bit.dev/@bit/wasedatime.core.ts.constants.langs/0.0.5_react-dom@17.0.2+react@17.0.2 + '@bit/wasedatime.core.ts.ui.header': node.bit.dev/@bit/wasedatime.core.ts.ui.header/0.2.21_85437955bddca72fa9ee81a991b14a9d + '@bit/wasedatime.core.ts.ui.loading-spinner': node.bit.dev/@bit/wasedatime.core.ts.ui.loading-spinner/0.1.5_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.ts.ui.sign-in-modal': node.bit.dev/@bit/wasedatime.core.ts.ui.sign-in-modal/0.1.6_f77ae0e4b6d953df59adc94f9e4d5b61 + '@bit/wasedatime.core.ts.utils.i18n': node.bit.dev/@bit/wasedatime.core.ts.utils.i18n/0.0.4_1622241db2281c7eeaec01382c7056b3 + '@bit/wasedatime.core.ts.utils.responsive-utils': node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.ts.utils.user': node.bit.dev/@bit/wasedatime.core.ts.utils.user/0.0.4_a508a016322cb0cfa568f892dc7f22d1 '@emotion/react': 11.9.0_7c3ecd89bd75b61b41f2029715ea2305 '@emotion/styled': 11.8.1_aa14098c2ea011cbc634dc0640a5389f '@fortawesome/free-solid-svg-icons': 6.0.0 @@ -154,6 +160,44 @@ packages: '@jridgewell/gen-mapping': 0.1.1 '@jridgewell/trace-mapping': 0.3.17 + /@aws-amplify/api-graphql/2.3.6_react-native@0.68.5: + resolution: {integrity: sha512-bAFApP7Yw2uLythEG4og0nDm8xVqqEMLKiT5AUpElKmlzU5t106gYissRLet+oHeiE2DMnIWCL9g/rOn93Z1NQ==} + dependencies: + '@aws-amplify/api-rest': 2.0.42_react-native@0.68.5 + '@aws-amplify/auth': 4.5.6_react-native@0.68.5 + '@aws-amplify/cache': 4.0.44_react-native@0.68.5 + '@aws-amplify/core': 4.5.6_react-native@0.68.5 + '@aws-amplify/pubsub': 4.4.3_react-native@0.68.5 + graphql: 15.8.0 + uuid: 3.4.0 + zen-observable-ts: 0.8.19 + transitivePeerDependencies: + - debug + - encoding + - react-native + dev: false + + /@aws-amplify/api-rest/2.0.42_react-native@0.68.5: + resolution: {integrity: sha512-37BUCnI1PM273jUwWceEZVi0frO0mHY8dY/9EZ2zUmA6Rbscbm5ZpyB8E+txtO+odbbBxnU5JHdc7JnWr7Fwpw==} + dependencies: + '@aws-amplify/core': 4.5.6_react-native@0.68.5 + axios: 0.21.4 + transitivePeerDependencies: + - debug + - react-native + dev: false + + /@aws-amplify/api/4.0.42_react-native@0.68.5: + resolution: {integrity: sha512-h+nm6Frbu4G2Ftc7s0SVdQEoLOE9tVlfRM6q0JrQ48Ilu1myQdQ3wormWUxdhlpkuTq+UOYcDTcIUeiD3CC2mA==} + dependencies: + '@aws-amplify/api-graphql': 2.3.6_react-native@0.68.5 + '@aws-amplify/api-rest': 2.0.42_react-native@0.68.5 + transitivePeerDependencies: + - debug + - encoding + - react-native + dev: false + /@aws-amplify/auth/4.4.4_react-native@0.68.5: resolution: {integrity: sha512-/iQB8teOXxb6XkOK2nPBxldU5YZjMLy6vTpihWMOPP96TWqldgnKSZykYtsrTb6uYK8iF1VWr7DI9OE7UpKONQ==} dependencies: @@ -166,6 +210,30 @@ packages: - react-native dev: false + /@aws-amplify/auth/4.5.6_react-native@0.68.5: + resolution: {integrity: sha512-G0pxqKaVouuhVK6qH0EBHG5ziNVRT7AzKSj8jN2I7klHtFJHnY/F6NEEjr/e99IgbyzspjWX5xFRBAQecgF44A==} + dependencies: + '@aws-amplify/cache': 4.0.44_react-native@0.68.5 + '@aws-amplify/core': 4.5.6_react-native@0.68.5 + amazon-cognito-identity-js: 5.2.9 + crypto-js: 4.1.1 + transitivePeerDependencies: + - encoding + - react-native + dev: false + + /@aws-amplify/auth/4.6.16_react-native@0.68.5: + resolution: {integrity: sha512-VSUTkh29xClpdLGF12hx6dyEcxwcP9sJrDnUBkugnWjM+KWPDphrcFR+p2h8cv3N1AIVnA/r+Zq35KuJQ++KlQ==} + dependencies: + '@aws-amplify/cache': 4.0.65_react-native@0.68.5 + '@aws-amplify/core': 4.7.14_react-native@0.68.5 + amazon-cognito-identity-js: 5.2.14 + crypto-js: 4.1.1 + transitivePeerDependencies: + - encoding + - react-native + dev: false + /@aws-amplify/cache/4.0.37_react-native@0.68.5: resolution: {integrity: sha512-SlUYGVTCv848TAOVW+8PhMQKUaC6fAiflEqvW6LkXN0Etj1tetsUhXoSDFVevxkKQEXXouFrj9dSWnYE6SOIhA==} dependencies: @@ -174,6 +242,22 @@ packages: - react-native dev: false + /@aws-amplify/cache/4.0.44_react-native@0.68.5: + resolution: {integrity: sha512-lfybDAXaJWzHPprPJILPcSNCfow9xkgskP5tkNdG2/dlkgTwN2aUJVkQdguO5q5zUxgM0xoS7bbVY3kvoQ2b6Q==} + dependencies: + '@aws-amplify/core': 4.5.6_react-native@0.68.5 + transitivePeerDependencies: + - react-native + dev: false + + /@aws-amplify/cache/4.0.65_react-native@0.68.5: + resolution: {integrity: sha512-C80LcnqJavjUWkH2mLtjRqTM2znX2IxU56mYUwmPWugMPJ8klvJlru9HA+rcMg+yqp2fNsRaiMtqrzx2oFNX6A==} + dependencies: + '@aws-amplify/core': 4.7.14_react-native@0.68.5 + transitivePeerDependencies: + - react-native + dev: false + /@aws-amplify/core/4.4.2_react-native@0.68.5: resolution: {integrity: sha512-5Q6Te5WcLaUcJpXPVVCb/i/HLBr7dS2KyODqiadb2G4ocqmr6DQaMGo7f77LjQ6WqMDETSijqsLjU8nK+2xOpg==} dependencies: @@ -189,6 +273,51 @@ packages: - react-native dev: false + /@aws-amplify/core/4.5.6_react-native@0.68.5: + resolution: {integrity: sha512-TmtKtxMno7TubMqiXQpqdFIfIBm2bCqK6sW1BUk8N8WoHnuA3hBPf1qmZeDHTaSjTFBV1AOxfVgVZ9RGErZQzw==} + dependencies: + '@aws-crypto/sha256-js': 1.0.0-alpha.0 + '@aws-sdk/client-cloudwatch-logs': 3.6.1_react-native@0.68.5 + '@aws-sdk/client-cognito-identity': 3.6.1_react-native@0.68.5 + '@aws-sdk/credential-provider-cognito-identity': 3.6.1_react-native@0.68.5 + '@aws-sdk/types': 3.6.1 + '@aws-sdk/util-hex-encoding': 3.6.1 + universal-cookie: 4.0.4 + zen-observable-ts: 0.8.19 + transitivePeerDependencies: + - react-native + dev: false + + /@aws-amplify/core/4.7.14_react-native@0.68.5: + resolution: {integrity: sha512-hrjeDLlx7a0zlaiDRzOagP7zsAye8k9krmjV1o49Db2NRqVmFzIiFg8SZ+xX+5xk4TI7rwxnCQ4zFJAHsrcSmw==} + dependencies: + '@aws-crypto/sha256-js': 1.0.0-alpha.0 + '@aws-sdk/client-cloudwatch-logs': 3.6.1_react-native@0.68.5 + '@aws-sdk/client-cognito-identity': 3.6.1_react-native@0.68.5 + '@aws-sdk/credential-provider-cognito-identity': 3.6.1_react-native@0.68.5 + '@aws-sdk/types': 3.6.1 + '@aws-sdk/util-hex-encoding': 3.6.1 + universal-cookie: 4.0.4 + zen-observable-ts: 0.8.19 + transitivePeerDependencies: + - react-native + dev: false + + /@aws-amplify/pubsub/4.4.3_react-native@0.68.5: + resolution: {integrity: sha512-bpjucdYHpnrz0fq+0PZ/UfaUR67z7RUm13iDL3GnX8TMCRTTaquOF7S2Sfn9zlWzwDOFzrne6JAl8lnwBmjuEw==} + dependencies: + '@aws-amplify/auth': 4.5.6_react-native@0.68.5 + '@aws-amplify/cache': 4.0.44_react-native@0.68.5 + '@aws-amplify/core': 4.5.6_react-native@0.68.5 + graphql: 15.8.0 + paho-mqtt: 1.1.0 + uuid: 3.4.0 + zen-observable-ts: 0.8.19 + transitivePeerDependencies: + - encoding + - react-native + dev: false + /@aws-crypto/ie11-detection/1.0.0: resolution: {integrity: sha512-kCKVhCF1oDxFYgQrxXmIrS5oaWulkvRcPz+QBDMsUr2crbF4VGgGT6+uQhSwJFdUAQ2A//Vq+uT83eJrkzFgXA==} dependencies: @@ -2113,189 +2242,6 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - /@bit/wasedatime.core.assets.locales.en/0.0.1_react-dom@17.0.2+react@17.0.2: - resolution: {integrity: sha1-a2MtBzbhje+oHJ4Tz+L5B/2n2Qs=, tarball: wasedatime.core.assets.locales.en/-/wasedatime.core.assets.locales.en-0.0.1.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - dev: false - - /@bit/wasedatime.core.assets.locales.ja/0.0.1_react-dom@17.0.2+react@17.0.2: - resolution: {integrity: sha1-q3GVnjO0kmRflqwouUeS5dFCHHU=, tarball: wasedatime.core.assets.locales.ja/-/wasedatime.core.assets.locales.ja-0.0.1.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - dev: false - - /@bit/wasedatime.core.theme.colors/0.0.2: - resolution: {integrity: sha1-O0I7As2DSqrSnqY7AX/O43j09GI=, tarball: wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.2.tgz} - dev: false - - /@bit/wasedatime.core.theme.colors/0.0.3: - resolution: {integrity: sha1-6Fj0r3lf0e0ogkF168OnyzlWmj0=, tarball: wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.3.tgz} - dev: false - - /@bit/wasedatime.core.theme.colors/0.0.5: - resolution: {integrity: sha1-K7sD8kjDztzqeg0jgeHErLF4mYE=, tarball: wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.5.tgz} - dev: false - - /@bit/wasedatime.core.ts.constants.langs/0.0.5_react-dom@17.0.2+react@17.0.2: - resolution: {integrity: sha1-Bp87IFStXHsG1iyN/PONMyD5IyM=, tarball: wasedatime.core.ts.constants.langs/-/wasedatime.core.ts.constants.langs-0.0.5.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - dev: false - - /@bit/wasedatime.core.ts.styles.overlay/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: - resolution: {integrity: sha1-eXYMnbkdhymg3EBNS9RBSuz1Wbk=, tarball: wasedatime.core.ts.styles.overlay/-/wasedatime.core.ts.styles.overlay-0.0.1.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 - transitivePeerDependencies: - - react-is - dev: false - - /@bit/wasedatime.core.ts.styles.wrapper/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: - resolution: {integrity: sha1-cszBxS3eDqwoxe9Tl162+7hc9Og=, tarball: wasedatime.core.ts.styles.wrapper/-/wasedatime.core.ts.styles.wrapper-0.0.1.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 - transitivePeerDependencies: - - react-is - dev: false - - /@bit/wasedatime.core.ts.ui.header/0.2.21_85437955bddca72fa9ee81a991b14a9d: - resolution: {integrity: sha1-G11o7+B0VeSU/zNXhfpuxw2gG3A=, tarball: wasedatime.core.ts.ui.header/-/wasedatime.core.ts.ui.header-0.2.21.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - '@bit/wasedatime.core.theme.colors': 0.0.5 - '@bit/wasedatime.core.ts.ui.language-menu': 0.1.6_d0856df9c36df34128afc1855d88d727 - '@bit/wasedatime.core.ts.ui.logo': 0.1.2_react-dom@17.0.2+react@17.0.2 - '@bit/wasedatime.core.ts.ui.theme-toggle': 0.1.3_e772c680e5225e7694da1542f10ccf72 - '@bit/wasedatime.core.ts.utils.responsive-utils': 0.0.1_af520ff3c650e6a6d05e9a79e9549b09 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - react-responsive: 8.2.0_react@17.0.2 - react-router-dom: 6.7.0_react-dom@17.0.2+react@17.0.2 - transitivePeerDependencies: - - '@fortawesome/fontawesome-svg-core' - - '@types/react' - - react-is - dev: false - - /@bit/wasedatime.core.ts.ui.language-menu/0.1.6_d0856df9c36df34128afc1855d88d727: - resolution: {integrity: sha1-2DVMCUn47JdgJXHQBIXv5GI6iUk=, tarball: wasedatime.core.ts.ui.language-menu/-/wasedatime.core.ts.ui.language-menu-0.1.6.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - '@bit/wasedatime.core.theme.colors': 0.0.5 - '@bit/wasedatime.core.ts.utils.responsive-utils': 0.0.1_af520ff3c650e6a6d05e9a79e9549b09 - '@fortawesome/fontawesome-svg-core': 1.3.0 - '@fortawesome/free-solid-svg-icons': 5.15.4 - '@fortawesome/react-fontawesome': 0.1.17_4bd8f766d7cd56ce339ee1b51a510026 - '@material-ui/core': 4.12.4_b8fdba992ce7d797017dc07106486496 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - react-responsive: 8.2.0_react@17.0.2 - transitivePeerDependencies: - - '@types/react' - - react-is - dev: false - - /@bit/wasedatime.core.ts.ui.loading-spinner/0.1.5_af520ff3c650e6a6d05e9a79e9549b09: - resolution: {integrity: sha1-44SvUvzJtH0xwoEOvbiIFMpiSfU=, tarball: wasedatime.core.ts.ui.loading-spinner/-/wasedatime.core.ts.ui.loading-spinner-0.1.5.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - '@bit/wasedatime.core.theme.colors': 0.0.3 - '@bit/wasedatime.core.ts.styles.overlay': 0.0.1_af520ff3c650e6a6d05e9a79e9549b09 - '@bit/wasedatime.core.ts.styles.wrapper': 0.0.1_af520ff3c650e6a6d05e9a79e9549b09 - '@bit/wasedatime.core.ts.ui.logo': 0.1.2_react-dom@17.0.2+react@17.0.2 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - transitivePeerDependencies: - - react-is - dev: false - - /@bit/wasedatime.core.ts.ui.logo/0.1.2_react-dom@17.0.2+react@17.0.2: - resolution: {integrity: sha1-74P2D7rW83R16bst5QxwLAh4PKI=, tarball: wasedatime.core.ts.ui.logo/-/wasedatime.core.ts.ui.logo-0.1.2.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - dev: false - - /@bit/wasedatime.core.ts.ui.theme-toggle/0.1.3_e772c680e5225e7694da1542f10ccf72: - resolution: {integrity: sha1-YTDn/Cp/YgdPYdeR4APo2mVmyXo=, tarball: wasedatime.core.ts.ui.theme-toggle/-/wasedatime.core.ts.ui.theme-toggle-0.1.3.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - '@bit/wasedatime.core.theme.colors': 0.0.2 - '@fortawesome/free-solid-svg-icons': 6.0.0 - '@fortawesome/react-fontawesome': 0.1.17_4bd8f766d7cd56ce339ee1b51a510026 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - transitivePeerDependencies: - - '@fortawesome/fontawesome-svg-core' - dev: false - - /@bit/wasedatime.core.ts.utils.i18n/0.0.4_1622241db2281c7eeaec01382c7056b3: - resolution: {integrity: sha1-Mi/S9B83NRoFmQTS6EgSF8Ymqlo=, tarball: wasedatime.core.ts.utils.i18n/-/wasedatime.core.ts.utils.i18n-0.0.4.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - '@bit/wasedatime.core.assets.locales.en': 0.0.1_react-dom@17.0.2+react@17.0.2 - '@bit/wasedatime.core.assets.locales.ja': 0.0.1_react-dom@17.0.2+react@17.0.2 - '@bit/wasedatime.core.ts.constants.langs': 0.0.5_react-dom@17.0.2+react@17.0.2 - i18next-browser-languagedetector: 6.1.8 - i18next-http-backend: 1.4.5 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - react-i18next: 11.15.6_1622241db2281c7eeaec01382c7056b3 - transitivePeerDependencies: - - encoding - - i18next - - react-native - dev: false - - /@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: - resolution: {integrity: sha1-5/QLjuULwrwyclYP8m96BV+Mnq8=, tarball: wasedatime.core.ts.utils.responsive-utils/-/wasedatime.core.ts.utils.responsive-utils-0.0.1.tgz} - peerDependencies: - react: ^17.0.1 - react-dom: ^17.0.1 - dependencies: - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 - transitivePeerDependencies: - - react-is - dev: false - /@emotion/babel-plugin/11.10.5_@babel+core@7.17.5: resolution: {integrity: sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA==} peerDependencies: @@ -2486,6 +2432,12 @@ packages: deprecated: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/ requiresBuild: true + /@fortawesome/fontawesome-common-types/6.2.1: + resolution: {integrity: sha512-Sz07mnQrTekFWLz5BMjOzHl/+NooTdW8F8kDQxjWwbpOJcnoSg4vUDng8d/WR1wOxM0O+CY9Zw0nR054riNYtQ==} + engines: {node: '>=6'} + requiresBuild: true + dev: false + /@fortawesome/fontawesome-svg-core/1.3.0: resolution: {integrity: sha512-UIL6crBWhjTNQcONt96ExjUnKt1D68foe3xjEensLDclqQ6YagwCRYVQdrp/hW0ALRp/5Fv/VKw+MqTUWYYvPg==} engines: {node: '>=6'} @@ -2494,6 +2446,14 @@ packages: dependencies: '@fortawesome/fontawesome-common-types': 0.3.0 + /@fortawesome/free-brands-svg-icons/6.2.1: + resolution: {integrity: sha512-L8l4MfdHPmZlJ72PvzdfwOwbwcCAL0vx48tJRnI6u1PJXh+j2f3yDoKyQgO3qjEsgD5Fr2tQV/cPP8F/k6aUig==} + engines: {node: '>=6'} + requiresBuild: true + dependencies: + '@fortawesome/fontawesome-common-types': 6.2.1 + dev: false + /@fortawesome/free-solid-svg-icons/5.15.4: resolution: {integrity: sha512-JLmQfz6tdtwxoihXLg6lT78BorrFyCf59SAwBM6qV/0zXyVeDygJVb3fk+j5Qat+Yvcxp1buLTY5iDh1ZSAQ8w==} engines: {node: '>=6'} @@ -3639,6 +3599,18 @@ packages: uri-js: 4.4.1 dev: true + /amazon-cognito-identity-js/5.2.14: + resolution: {integrity: sha512-9LMgLZfbypbbGTpARQ+QqglE09b1MWti11NXhcD/wPom0uhU/L90dfmUOpTwknz//eE6/dGYf004mJucWzrfxQ==} + dependencies: + buffer: 4.9.2 + crypto-js: 4.1.1 + fast-base64-decode: 1.0.0 + isomorphic-unfetch: 3.1.0 + js-cookie: 2.2.1 + transitivePeerDependencies: + - encoding + dev: false + /amazon-cognito-identity-js/5.2.8: resolution: {integrity: sha512-ikHbIBtdJeXUeHIKFDF+qptRbTX81ZIe+ItvsgjcNXEKuW0ZgjnHw6tgPmOFOweQfUyzW+RpA+T3fG+YqOklbw==} dependencies: @@ -3651,6 +3623,18 @@ packages: - encoding dev: false + /amazon-cognito-identity-js/5.2.9: + resolution: {integrity: sha512-2ZLVOE1fb0eziAaV6kXCDMe35HNFkdz3HyMwb9i+lqm1G2q3SHrliL30MHbc2KwMeu5qu/ysw5BSU+b1Y5AIaQ==} + dependencies: + buffer: 4.9.2 + crypto-js: 4.1.1 + fast-base64-decode: 1.0.0 + isomorphic-unfetch: 3.1.0 + js-cookie: 2.2.1 + transitivePeerDependencies: + - encoding + dev: false + /anser/1.4.10: resolution: {integrity: sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==} dev: true @@ -3868,6 +3852,14 @@ packages: engines: {node: '>=4'} dev: true + /axios/0.21.4: + resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} + dependencies: + follow-redirects: 1.15.2 + transitivePeerDependencies: + - debug + dev: false + /axobject-query/2.2.0: resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} dev: true @@ -5712,6 +5704,10 @@ packages: strip-eof: 1.0.0 dev: true + /exenv/1.2.2: + resolution: {integrity: sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==} + dev: false + /expand-brackets/2.1.4: resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} engines: {node: '>=0.10.0'} @@ -5876,6 +5872,16 @@ packages: engines: {node: '>=0.4.0'} dev: true + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + /for-each/0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -6053,6 +6059,11 @@ packages: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true + /graphql/15.8.0: + resolution: {integrity: sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==} + engines: {node: '>= 10.x'} + dev: false + /hamt_plus/1.0.2: resolution: {integrity: sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==} dev: false @@ -7438,6 +7449,10 @@ packages: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} dev: true + /no-scroll/2.1.1: + resolution: {integrity: sha512-YTzGAJOo/B6hkodeT5SKKHpOhAzjMfkUCCXjLJwjWk2F4/InIg+HbdH9kmT7bKpleDuqLZDTRy2OdNtAj0IVyQ==} + dev: false + /nocache/2.1.0: resolution: {integrity: sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==} engines: {node: '>=4.0.0'} @@ -7727,6 +7742,10 @@ packages: engines: {node: '>=6'} dev: true + /paho-mqtt/1.1.0: + resolution: {integrity: sha512-KPbL9KAB0ASvhSDbOrZBaccXS+/s7/LIofbPyERww8hM5Ko71GUJQ6Nmg0BWqj8phAIT8zdf/Sd/RftHU9i2HA==} + dev: false + /parent-module/1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -8379,6 +8398,25 @@ packages: /react-is/18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + /react-lifecycles-compat/3.0.4: + resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} + dev: false + + /react-modal/3.16.1_react-dom@17.0.2+react@17.0.2: + resolution: {integrity: sha512-VStHgI3BVcGo7OXczvnJN7yT2TWHJPDXZWyI/a0ssFNhGZWsPmB8cF0z33ewDXq4VfYMO1vXgiv/g8Nj9NDyWg==} + engines: {node: '>=8'} + peerDependencies: + react: ^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18 + react-dom: ^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18 + dependencies: + exenv: 1.2.2 + prop-types: 15.8.1 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-lifecycles-compat: 3.0.4 + warning: 4.0.3 + dev: false + /react-native-codegen/0.0.18_@babel+preset-env@7.16.11: resolution: {integrity: sha512-XPI9aVsFy3dvgDZvyGWrFnknNiyb22kg5nHgxa0vjWTH9ENLBgVRZt9A64xHZ8BYihH+gl0p/1JNOCIEUzRPBg==} dependencies: @@ -9731,6 +9769,12 @@ packages: makeerror: 1.0.12 dev: true + /warning/4.0.3: + resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==} + dependencies: + loose-envify: 1.4.0 + dev: false + /wcwidth/1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: @@ -9942,3 +9986,285 @@ packages: /zen-observable/0.8.15: resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} dev: false + + node.bit.dev/@bit/wasedatime.core.assets.locales.en/0.0.1_react-dom@17.0.2+react@17.0.2: + resolution: {integrity: sha1-a2MtBzbhje+oHJ4Tz+L5B/2n2Qs=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.assets.locales.en/-/wasedatime.core.assets.locales.en-0.0.1.tgz} + id: node.bit.dev/@bit/wasedatime.core.assets.locales.en/0.0.1 + name: wasedatime.core.assets.locales.en + version: 0.0.1 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.assets.locales.ja/0.0.1_react-dom@17.0.2+react@17.0.2: + resolution: {integrity: sha1-q3GVnjO0kmRflqwouUeS5dFCHHU=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.assets.locales.ja/-/wasedatime.core.assets.locales.ja-0.0.1.tgz} + id: node.bit.dev/@bit/wasedatime.core.assets.locales.ja/0.0.1 + name: wasedatime.core.assets.locales.ja + version: 0.0.1 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.2: + resolution: {integrity: sha1-O0I7As2DSqrSnqY7AX/O43j09GI=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.2.tgz} + name: wasedatime.core.theme.colors + version: 0.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.3: + resolution: {integrity: sha1-6Fj0r3lf0e0ogkF168OnyzlWmj0=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.3.tgz} + name: wasedatime.core.theme.colors + version: 0.0.3 + dev: false + + node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.5: + resolution: {integrity: sha1-K7sD8kjDztzqeg0jgeHErLF4mYE=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.theme.colors/-/wasedatime.core.theme.colors-0.0.5.tgz} + name: wasedatime.core.theme.colors + version: 0.0.5 + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.constants.langs/0.0.5_react-dom@17.0.2+react@17.0.2: + resolution: {integrity: sha1-Bp87IFStXHsG1iyN/PONMyD5IyM=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.constants.langs/-/wasedatime.core.ts.constants.langs-0.0.5.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.constants.langs/0.0.5 + name: wasedatime.core.ts.constants.langs + version: 0.0.5 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.styles.overlay/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: + resolution: {integrity: sha1-eXYMnbkdhymg3EBNS9RBSuz1Wbk=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.styles.overlay/-/wasedatime.core.ts.styles.overlay-0.0.1.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.styles.overlay/0.0.1 + name: wasedatime.core.ts.styles.overlay + version: 0.0.1 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 + transitivePeerDependencies: + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.styles.wrapper/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: + resolution: {integrity: sha1-cszBxS3eDqwoxe9Tl162+7hc9Og=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.styles.wrapper/-/wasedatime.core.ts.styles.wrapper-0.0.1.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.styles.wrapper/0.0.1 + name: wasedatime.core.ts.styles.wrapper + version: 0.0.1 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 + transitivePeerDependencies: + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.header/0.2.21_85437955bddca72fa9ee81a991b14a9d: + resolution: {integrity: sha1-G11o7+B0VeSU/zNXhfpuxw2gG3A=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.header/-/wasedatime.core.ts.ui.header-0.2.21.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.header/0.2.21 + name: wasedatime.core.ts.ui.header + version: 0.2.21 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.theme.colors': node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.5 + '@bit/wasedatime.core.ts.ui.language-menu': node.bit.dev/@bit/wasedatime.core.ts.ui.language-menu/0.1.6_d0856df9c36df34128afc1855d88d727 + '@bit/wasedatime.core.ts.ui.logo': node.bit.dev/@bit/wasedatime.core.ts.ui.logo/0.1.2_react-dom@17.0.2+react@17.0.2 + '@bit/wasedatime.core.ts.ui.theme-toggle': node.bit.dev/@bit/wasedatime.core.ts.ui.theme-toggle/0.1.3_e772c680e5225e7694da1542f10ccf72 + '@bit/wasedatime.core.ts.utils.responsive-utils': node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-responsive: 8.2.0_react@17.0.2 + react-router-dom: 6.7.0_react-dom@17.0.2+react@17.0.2 + transitivePeerDependencies: + - '@fortawesome/fontawesome-svg-core' + - '@types/react' + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.language-menu/0.1.6_d0856df9c36df34128afc1855d88d727: + resolution: {integrity: sha1-2DVMCUn47JdgJXHQBIXv5GI6iUk=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.language-menu/-/wasedatime.core.ts.ui.language-menu-0.1.6.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.language-menu/0.1.6 + name: wasedatime.core.ts.ui.language-menu + version: 0.1.6 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.theme.colors': node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.5 + '@bit/wasedatime.core.ts.utils.responsive-utils': node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@fortawesome/fontawesome-svg-core': 1.3.0 + '@fortawesome/free-solid-svg-icons': 5.15.4 + '@fortawesome/react-fontawesome': 0.1.17_4bd8f766d7cd56ce339ee1b51a510026 + '@material-ui/core': 4.12.4_b8fdba992ce7d797017dc07106486496 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-responsive: 8.2.0_react@17.0.2 + transitivePeerDependencies: + - '@types/react' + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.loading-spinner/0.1.5_af520ff3c650e6a6d05e9a79e9549b09: + resolution: {integrity: sha1-44SvUvzJtH0xwoEOvbiIFMpiSfU=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.loading-spinner/-/wasedatime.core.ts.ui.loading-spinner-0.1.5.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.loading-spinner/0.1.5 + name: wasedatime.core.ts.ui.loading-spinner + version: 0.1.5 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.theme.colors': node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.3 + '@bit/wasedatime.core.ts.styles.overlay': node.bit.dev/@bit/wasedatime.core.ts.styles.overlay/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.ts.styles.wrapper': node.bit.dev/@bit/wasedatime.core.ts.styles.wrapper/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.ts.ui.logo': node.bit.dev/@bit/wasedatime.core.ts.ui.logo/0.1.2_react-dom@17.0.2+react@17.0.2 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + transitivePeerDependencies: + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.logo/0.1.2_react-dom@17.0.2+react@17.0.2: + resolution: {integrity: sha1-74P2D7rW83R16bst5QxwLAh4PKI=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.logo/-/wasedatime.core.ts.ui.logo-0.1.2.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.logo/0.1.2 + name: wasedatime.core.ts.ui.logo + version: 0.1.2 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.modal/0.0.8_react-dom@17.0.2: + resolution: {integrity: sha1-xkKmBXxGPJmAXzBQAeIqi71+V1E=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.modal/-/wasedatime.core.ts.ui.modal-0.0.8.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.modal/0.0.8 + name: wasedatime.core.ts.ui.modal + version: 0.0.8 + peerDependencies: + react-dom: ^17.0.1 + dependencies: + no-scroll: 2.1.1 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-modal: 3.16.1_react-dom@17.0.2+react@17.0.2 + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.sign-in-modal/0.1.6_f77ae0e4b6d953df59adc94f9e4d5b61: + resolution: {integrity: sha1-2AsM/+8z11HHHjRVHuMy8YjmyVk=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.sign-in-modal/-/wasedatime.core.ts.ui.sign-in-modal-0.1.6.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.sign-in-modal/0.1.6 + name: wasedatime.core.ts.ui.sign-in-modal + version: 0.1.6 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.ts.ui.modal': node.bit.dev/@bit/wasedatime.core.ts.ui.modal/0.0.8_react-dom@17.0.2 + '@bit/wasedatime.core.ts.utils.responsive-utils': node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09 + '@bit/wasedatime.core.ts.utils.user': node.bit.dev/@bit/wasedatime.core.ts.utils.user/0.0.4_a508a016322cb0cfa568f892dc7f22d1 + '@fortawesome/free-brands-svg-icons': 6.2.1 + '@fortawesome/react-fontawesome': 0.1.17_4bd8f766d7cd56ce339ee1b51a510026 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-i18next: 11.15.6_1622241db2281c7eeaec01382c7056b3 + react-responsive: 8.2.0_react@17.0.2 + transitivePeerDependencies: + - '@fortawesome/fontawesome-svg-core' + - encoding + - i18next + - react-is + - react-native + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.ui.theme-toggle/0.1.3_e772c680e5225e7694da1542f10ccf72: + resolution: {integrity: sha1-YTDn/Cp/YgdPYdeR4APo2mVmyXo=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.ui.theme-toggle/-/wasedatime.core.ts.ui.theme-toggle-0.1.3.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.ui.theme-toggle/0.1.3 + name: wasedatime.core.ts.ui.theme-toggle + version: 0.1.3 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.theme.colors': node.bit.dev/@bit/wasedatime.core.theme.colors/0.0.2 + '@fortawesome/free-solid-svg-icons': 6.0.0 + '@fortawesome/react-fontawesome': 0.1.17_4bd8f766d7cd56ce339ee1b51a510026 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + transitivePeerDependencies: + - '@fortawesome/fontawesome-svg-core' + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.utils.i18n/0.0.4_1622241db2281c7eeaec01382c7056b3: + resolution: {integrity: sha1-Mi/S9B83NRoFmQTS6EgSF8Ymqlo=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.utils.i18n/-/wasedatime.core.ts.utils.i18n-0.0.4.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.utils.i18n/0.0.4 + name: wasedatime.core.ts.utils.i18n + version: 0.0.4 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@bit/wasedatime.core.assets.locales.en': node.bit.dev/@bit/wasedatime.core.assets.locales.en/0.0.1_react-dom@17.0.2+react@17.0.2 + '@bit/wasedatime.core.assets.locales.ja': node.bit.dev/@bit/wasedatime.core.assets.locales.ja/0.0.1_react-dom@17.0.2+react@17.0.2 + '@bit/wasedatime.core.ts.constants.langs': node.bit.dev/@bit/wasedatime.core.ts.constants.langs/0.0.5_react-dom@17.0.2+react@17.0.2 + i18next-browser-languagedetector: 6.1.8 + i18next-http-backend: 1.4.5 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + react-i18next: 11.15.6_1622241db2281c7eeaec01382c7056b3 + transitivePeerDependencies: + - encoding + - i18next + - react-native + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1_af520ff3c650e6a6d05e9a79e9549b09: + resolution: {integrity: sha1-5/QLjuULwrwyclYP8m96BV+Mnq8=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.utils.responsive-utils/-/wasedatime.core.ts.utils.responsive-utils-0.0.1.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.utils.responsive-utils/0.0.1 + name: wasedatime.core.ts.utils.responsive-utils + version: 0.0.1 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + styled-components: 5.3.3_af520ff3c650e6a6d05e9a79e9549b09 + transitivePeerDependencies: + - react-is + dev: false + + node.bit.dev/@bit/wasedatime.core.ts.utils.user/0.0.4_a508a016322cb0cfa568f892dc7f22d1: + resolution: {integrity: sha1-oXb9G56lFH2zi1fg1GCWAJpy1xU=, registry: https://node.bit.dev/, tarball: https://node.bit.dev/wasedatime.core.ts.utils.user/-/wasedatime.core.ts.utils.user-0.0.4.tgz} + id: node.bit.dev/@bit/wasedatime.core.ts.utils.user/0.0.4 + name: wasedatime.core.ts.utils.user + version: 0.0.4 + peerDependencies: + react: ^17.0.1 + react-dom: ^17.0.1 + dependencies: + '@aws-amplify/auth': 4.6.16_react-native@0.68.5 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + transitivePeerDependencies: + - encoding + - react-native + dev: false diff --git a/apps/forum/src/components/CommentForm.tsx b/apps/forum/src/components/CommentForm.tsx index e134517da..aef730eab 100644 --- a/apps/forum/src/components/CommentForm.tsx +++ b/apps/forum/src/components/CommentForm.tsx @@ -1,13 +1,81 @@ -import React from "react"; +import React, { ChangeEvent, useState } from "react"; +import API from "@aws-amplify/api"; +import SignInModal from "@bit/wasedatime.core.ts.ui.sign-in-modal"; +import { getIdToken } from "@bit/wasedatime.core.ts.utils.user"; +import { SendIcon } from "./icons/SendIcon"; const CommentForm = () => { + const [userToken, setUserToken] = useState(""); + const [isSignInModalOpen, setSignInModalOpen] = useState(false); + const [comment, setComment] = useState(""); + + const handleFocusForm = async () => { + if (userToken?.length <= 0) { + const idToken = await getIdToken(); + if (idToken?.length > 0) { + setUserToken(idToken); + } else { + if (document.activeElement instanceof HTMLElement) { + document.activeElement.blur(); + } + setSignInModalOpen(true); + } + } + } + + const handleTextChange = (e: ChangeEvent) => { + setComment(e.target.value); + } + + const handleSubmit = async () => { + if (comment.length <= 0 || comment.length > 200) return; + + let idToken = userToken; + if (idToken?.length <= 0) { + idToken = await getIdToken(); + if (idToken?.length <= 0) return; + } + + console.log(comment); + // TODO: Implement submitting new comment API + /* + API.post("wasedatime-dev", "/forum/blablabla", { + body: { data: { comment } }, + headers: { + Authorization: idToken, + }, + }); + */ + + setComment(""); + } + return (
+ + + + { + isSignInModalOpen && ( + setSignInModalOpen(false)} + /> + ) + } +
); }; diff --git a/apps/forum/src/components/CreateThread.tsx b/apps/forum/src/components/CreateThread.tsx index 65540e530..849789bdc 100644 --- a/apps/forum/src/components/CreateThread.tsx +++ b/apps/forum/src/components/CreateThread.tsx @@ -1,11 +1,18 @@ -import React, { useEffect, useState } from "react"; +import React, { ChangeEvent, useEffect, useState } from "react"; import { useParams } from "react-router-dom"; +import API from "@aws-amplify/api"; +import { CloseIcon } from "@app/components/icons/CloseIcon"; import boards from "@app/constants/boards.json"; +import SignInModal from "@bit/wasedatime.core.ts.ui.sign-in-modal"; +import { getIdToken } from "@bit/wasedatime.core.ts.utils.user"; const CreateThread = () => { const [isExpanded, setIsExpanded] = useState(false); const [expandTags, setExpandTags] = useState(false); const [expandGroups, setExpandGroups] = useState(false); + const [userToken, setUserToken] = useState(""); + const [isSignInModalOpen, setSignInModalOpen] = useState(false); + const [textContent, setTextContent] = useState(""); // Tags and Group buttons might be best moved to their respective components but this is how I will leave it for now. @@ -17,6 +24,47 @@ const CreateThread = () => { setExpandGroups(false); }, [boardSlug]); + const handleOpenForm = async () => { + if (userToken?.length > 0) { + setIsExpanded(true); + } else { + const idToken = await getIdToken(); + if (idToken?.length > 0) { + setUserToken(idToken); + setIsExpanded(true); + } else { + setSignInModalOpen(true); + } + } + } + + const handleTextChange = (e: ChangeEvent) => { + setTextContent(e.target.value); + } + + const handleSubmit = async () => { + if (textContent.length <= 0 || textContent.length > 2000) return; + + let idToken = userToken; + if (idToken?.length <= 0) { + idToken = await getIdToken(); + if (idToken?.length <= 0) return; + } + + console.log(textContent); + // TODO: Implement submitting new thread API + /* + API.post("wasedatime-dev", "/forum/blablabla", { + body: { data: { textContent } }, + headers: { + Authorization: idToken, + }, + }); + */ + + setTextContent(""); + } + const findBoardIndex: number = boards.findIndex( (board) => board.slug == boardSlug ); @@ -26,12 +74,14 @@ const CreateThread = () => {