diff --git a/.gitignore b/.gitignore index 18532909f..5fa06343a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ # Dependency directories (remove the comment below to include it) # vendor/ +node_modules +.DS_Store +dist \ No newline at end of file diff --git a/net/web/babel.config.js b/net/web/babel.config.js deleted file mode 100644 index 842219d35..000000000 --- a/net/web/babel.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - presets: [ - '@babel/preset-env', - ['@babel/preset-react', {runtime: 'automatic'}], - ], -}; diff --git a/net/web/index.html b/net/web/index.html new file mode 100644 index 000000000..20a58ddf1 --- /dev/null +++ b/net/web/index.html @@ -0,0 +1,21 @@ + + + + + + + + + + + Databag + + + +
+ + + diff --git a/net/web/jest.config.js b/net/web/jest.config.js new file mode 100644 index 000000000..5b47a8925 --- /dev/null +++ b/net/web/jest.config.js @@ -0,0 +1,12 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +export default { + preset: 'ts-jest', + testEnvironment: 'jsdom', + modulePaths: ['/src/'], + testMatch: ['**/test/**'], + moduleNameMapper: { + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/mock/fileMock.js', + '\\.(css|less|scss|sass)$': 'identity-obj-proxy', + // "(.*)": "/src/$1", + }, +}; diff --git a/net/web/jsconfig.json b/net/web/jsconfig.json deleted file mode 100644 index 5875dc5b6..000000000 --- a/net/web/jsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "src" - }, - "include": ["src"] -} diff --git a/net/web/package.json b/net/web/package.json index b54e50df7..36bee8cce 100644 --- a/net/web/package.json +++ b/net/web/package.json @@ -2,19 +2,7 @@ "name": "databag", "version": "0.1.0", "private": true, - "jest": { - "testEnvironment": "jsdom", - "modulePaths": [ - "/src/" - ], - "testMatch": [ - "**/test/**" - ], - "moduleNameMapper": { - "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/mock/fileMock.js", - "\\.(css|less|scss|sass)$": "identity-obj-proxy" - } - }, + "type": "module", "dependencies": { "@charliewilco/gluejar": "^1.0.0", "@testing-library/jest-dom": "^5.14.1", @@ -33,15 +21,13 @@ "react-image-file-resizer": "^0.4.8", "react-resize-detector": "^7.0.0", "react-router-dom": "^6.2.2", - "react-scripts": "5.0.0", "styled-components": "^5.3.3", "web-vitals": "^2.1.0" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "start": "vite", + "build": "vite build", + "test": "jest" }, "eslintConfig": { "extends": [ @@ -62,14 +48,25 @@ ] }, "devDependencies": { - "@babel/preset-env": "^7.20.2", - "@babel/preset-react": "^7.18.6", "@testing-library/dom": "^8.19.1", "@testing-library/react": "^13.4.0", + "@types/jest": "^29.5.12", + "@types/react": "^18.2.66", + "@types/react-dom": "^18.2.22", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@vitejs/plugin-react-swc": "^3.5.0", "babel-jest": "^29.3.1", + "eslint": "^8.57.0", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.6", "identity-obj-proxy": "^3.0.0", - "jest": "^29.3.1", + "jest": "^29.7.0", "jest-environment-jsdom": "^29.3.1", - "react-test-renderer": "^18.2.0" + "react-test-renderer": "^18.2.0", + "ts-jest": "^29.1.2", + "typescript": "^5.4.5", + "vite": "^5.2.0", + "vite-tsconfig-paths": "^4.3.2" } } diff --git a/net/web/public/index.html b/net/web/public/index.html deleted file mode 100644 index aa9324710..000000000 --- a/net/web/public/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - Databag - - - -
- - - diff --git a/net/web/src/App.styled.js b/net/web/src/App.styled.ts similarity index 100% rename from net/web/src/App.styled.js rename to net/web/src/App.styled.ts diff --git a/net/web/src/App.test.js b/net/web/src/App.test.tsx similarity index 100% rename from net/web/src/App.test.js rename to net/web/src/App.test.tsx diff --git a/net/web/src/App.js b/net/web/src/App.tsx similarity index 100% rename from net/web/src/App.js rename to net/web/src/App.tsx diff --git a/net/web/src/access/Access.styled.js b/net/web/src/access/Access.styled.ts similarity index 100% rename from net/web/src/access/Access.styled.js rename to net/web/src/access/Access.styled.ts diff --git a/net/web/src/access/Access.jsx b/net/web/src/access/Access.tsx similarity index 100% rename from net/web/src/access/Access.jsx rename to net/web/src/access/Access.tsx diff --git a/net/web/src/access/admin/Admin.styled.js b/net/web/src/access/admin/Admin.styled.ts similarity index 100% rename from net/web/src/access/admin/Admin.styled.js rename to net/web/src/access/admin/Admin.styled.ts diff --git a/net/web/src/access/admin/Admin.jsx b/net/web/src/access/admin/Admin.tsx similarity index 100% rename from net/web/src/access/admin/Admin.jsx rename to net/web/src/access/admin/Admin.tsx diff --git a/net/web/src/access/admin/useAdmin.hook.js b/net/web/src/access/admin/useAdmin.hook.ts similarity index 97% rename from net/web/src/access/admin/useAdmin.hook.js rename to net/web/src/access/admin/useAdmin.hook.ts index 2cde10e06..8ab14909f 100644 --- a/net/web/src/access/admin/useAdmin.hook.js +++ b/net/web/src/access/admin/useAdmin.hook.ts @@ -13,7 +13,7 @@ export function useAdmin() { placeholder: '', unclaimed: null, busy: false, - strings: {}, + strings: {} as Record, menuStyle: {}, }); diff --git a/net/web/src/access/createAccount/CreateAccount.styled.js b/net/web/src/access/createAccount/CreateAccount.styled.ts similarity index 100% rename from net/web/src/access/createAccount/CreateAccount.styled.js rename to net/web/src/access/createAccount/CreateAccount.styled.ts diff --git a/net/web/src/access/createAccount/CreateAccount.jsx b/net/web/src/access/createAccount/CreateAccount.tsx similarity index 100% rename from net/web/src/access/createAccount/CreateAccount.jsx rename to net/web/src/access/createAccount/CreateAccount.tsx diff --git a/net/web/src/access/createAccount/useCreateAccount.hook.js b/net/web/src/access/createAccount/useCreateAccount.hook.ts similarity index 98% rename from net/web/src/access/createAccount/useCreateAccount.hook.js rename to net/web/src/access/createAccount/useCreateAccount.hook.ts index ddf26cf20..4aed591ff 100644 --- a/net/web/src/access/createAccount/useCreateAccount.hook.js +++ b/net/web/src/access/createAccount/useCreateAccount.hook.ts @@ -14,7 +14,7 @@ export function useCreateAccount() { busy: false, validatetatus: 'success', help: '', - strings: {}, + strings: {} as Record, menuStyle: {}, }); diff --git a/net/web/src/access/login/Login.styled.js b/net/web/src/access/login/Login.styled.ts similarity index 100% rename from net/web/src/access/login/Login.styled.js rename to net/web/src/access/login/Login.styled.ts diff --git a/net/web/src/access/login/Login.jsx b/net/web/src/access/login/Login.tsx similarity index 100% rename from net/web/src/access/login/Login.jsx rename to net/web/src/access/login/Login.tsx diff --git a/net/web/src/access/login/useLogin.hook.js b/net/web/src/access/login/useLogin.hook.ts similarity index 98% rename from net/web/src/access/login/useLogin.hook.js rename to net/web/src/access/login/useLogin.hook.ts index dc27d49ce..ffeca5410 100644 --- a/net/web/src/access/login/useLogin.hook.js +++ b/net/web/src/access/login/useLogin.hook.ts @@ -13,7 +13,7 @@ export function useLogin() { availableSet: false, disabled: true, busy: false, - strings: {}, + strings: {} as Record, menuStyle: {}, }); diff --git a/net/web/src/access/useAccess.hook.js b/net/web/src/access/useAccess.hook.ts similarity index 94% rename from net/web/src/access/useAccess.hook.js rename to net/web/src/access/useAccess.hook.ts index a79314f66..fab82e8c9 100644 --- a/net/web/src/access/useAccess.hook.js +++ b/net/web/src/access/useAccess.hook.ts @@ -13,7 +13,7 @@ export function useAccess() { themes: [], language: null, languages: [], - strings: {}, + strings: {} as Record, }); const navigate = useNavigate(); @@ -32,7 +32,7 @@ export function useAccess() { }, [app.state, navigate]); useEffect(() => { - let params = new URLSearchParams(location); + let params = new URLSearchParams(location+""); let token = params.get("access"); if (token) { const access = async () => { diff --git a/net/web/src/api/addAccount.js b/net/web/src/api/addAccount.ts similarity index 100% rename from net/web/src/api/addAccount.js rename to net/web/src/api/addAccount.ts diff --git a/net/web/src/api/addAccountAccess.js b/net/web/src/api/addAccountAccess.ts similarity index 100% rename from net/web/src/api/addAccountAccess.js rename to net/web/src/api/addAccountAccess.ts diff --git a/net/web/src/api/addAccountCreate.js b/net/web/src/api/addAccountCreate.ts similarity index 100% rename from net/web/src/api/addAccountCreate.js rename to net/web/src/api/addAccountCreate.ts diff --git a/net/web/src/api/addCall.js b/net/web/src/api/addCall.ts similarity index 100% rename from net/web/src/api/addCall.js rename to net/web/src/api/addCall.ts diff --git a/net/web/src/api/addCard.js b/net/web/src/api/addCard.ts similarity index 100% rename from net/web/src/api/addCard.js rename to net/web/src/api/addCard.ts diff --git a/net/web/src/api/addChannel.js b/net/web/src/api/addChannel.ts similarity index 100% rename from net/web/src/api/addChannel.js rename to net/web/src/api/addChannel.ts diff --git a/net/web/src/api/addChannelTopic.js b/net/web/src/api/addChannelTopic.ts similarity index 100% rename from net/web/src/api/addChannelTopic.js rename to net/web/src/api/addChannelTopic.ts diff --git a/net/web/src/api/addContactChannelTopic.js b/net/web/src/api/addContactChannelTopic.ts similarity index 100% rename from net/web/src/api/addContactChannelTopic.js rename to net/web/src/api/addContactChannelTopic.ts diff --git a/net/web/src/api/addContactRing.js b/net/web/src/api/addContactRing.ts similarity index 100% rename from net/web/src/api/addContactRing.js rename to net/web/src/api/addContactRing.ts diff --git a/net/web/src/api/clearChannelCard.js b/net/web/src/api/clearChannelCard.ts similarity index 100% rename from net/web/src/api/clearChannelCard.js rename to net/web/src/api/clearChannelCard.ts diff --git a/net/web/src/api/clearLogin.js b/net/web/src/api/clearLogin.ts similarity index 100% rename from net/web/src/api/clearLogin.js rename to net/web/src/api/clearLogin.ts diff --git a/net/web/src/api/createAccount.js b/net/web/src/api/createAccount.ts similarity index 100% rename from net/web/src/api/createAccount.js rename to net/web/src/api/createAccount.ts diff --git a/net/web/src/api/fetchUtil.js b/net/web/src/api/fetchUtil.ts similarity index 65% rename from net/web/src/api/fetchUtil.js rename to net/web/src/api/fetchUtil.ts index a5ed506d6..20220a4f3 100644 --- a/net/web/src/api/fetchUtil.js +++ b/net/web/src/api/fetchUtil.ts @@ -12,17 +12,17 @@ export function checkResponse(response) { } } -export async function fetchWithTimeout(url, options) { +export async function fetchWithTimeout(url, options):Promise { return Promise.race([ fetch(url, options).catch(err => { throw new Error(url + ' failed'); }), - new Promise((_, reject) => setTimeout(() => reject(new Error(url + ' timeout')), TIMEOUT)) + new Promise((_, reject) => setTimeout(() => reject(new Error(url + ' timeout')), TIMEOUT)) ]); } -export async function fetchWithCustomTimeout(url, options, timeout) { +export async function fetchWithCustomTimeout(url, options, timeout):Promise { return Promise.race([ fetch(url, options).catch(err => { throw new Error(url + ' failed'); }), - new Promise((_, reject) => setTimeout(() => reject(new Error(url + ' timeout')), timeout)) + new Promise((_, reject) => setTimeout(() => reject(new Error(url + ' timeout')), timeout)) ]); } diff --git a/net/web/src/api/getAccountImageUrl.js b/net/web/src/api/getAccountImageUrl.ts similarity index 100% rename from net/web/src/api/getAccountImageUrl.js rename to net/web/src/api/getAccountImageUrl.ts diff --git a/net/web/src/api/getAccountStatus.js b/net/web/src/api/getAccountStatus.ts similarity index 100% rename from net/web/src/api/getAccountStatus.js rename to net/web/src/api/getAccountStatus.ts diff --git a/net/web/src/api/getAvailable.js b/net/web/src/api/getAvailable.ts similarity index 100% rename from net/web/src/api/getAvailable.js rename to net/web/src/api/getAvailable.ts diff --git a/net/web/src/api/getCardCloseMessage.js b/net/web/src/api/getCardCloseMessage.ts similarity index 100% rename from net/web/src/api/getCardCloseMessage.js rename to net/web/src/api/getCardCloseMessage.ts diff --git a/net/web/src/api/getCardDetail.js b/net/web/src/api/getCardDetail.ts similarity index 100% rename from net/web/src/api/getCardDetail.js rename to net/web/src/api/getCardDetail.ts diff --git a/net/web/src/api/getCardImageUrl.js b/net/web/src/api/getCardImageUrl.ts similarity index 100% rename from net/web/src/api/getCardImageUrl.js rename to net/web/src/api/getCardImageUrl.ts diff --git a/net/web/src/api/getCardOpenMessage.js b/net/web/src/api/getCardOpenMessage.ts similarity index 100% rename from net/web/src/api/getCardOpenMessage.js rename to net/web/src/api/getCardOpenMessage.ts diff --git a/net/web/src/api/getCardProfile.js b/net/web/src/api/getCardProfile.ts similarity index 100% rename from net/web/src/api/getCardProfile.js rename to net/web/src/api/getCardProfile.ts diff --git a/net/web/src/api/getCards.js b/net/web/src/api/getCards.ts similarity index 100% rename from net/web/src/api/getCards.js rename to net/web/src/api/getCards.ts diff --git a/net/web/src/api/getChannelDetail.js b/net/web/src/api/getChannelDetail.ts similarity index 100% rename from net/web/src/api/getChannelDetail.js rename to net/web/src/api/getChannelDetail.ts diff --git a/net/web/src/api/getChannelSummary.js b/net/web/src/api/getChannelSummary.ts similarity index 100% rename from net/web/src/api/getChannelSummary.js rename to net/web/src/api/getChannelSummary.ts diff --git a/net/web/src/api/getChannelTopic.js b/net/web/src/api/getChannelTopic.ts similarity index 100% rename from net/web/src/api/getChannelTopic.js rename to net/web/src/api/getChannelTopic.ts diff --git a/net/web/src/api/getChannelTopicAssetUrl.js b/net/web/src/api/getChannelTopicAssetUrl.ts similarity index 100% rename from net/web/src/api/getChannelTopicAssetUrl.js rename to net/web/src/api/getChannelTopicAssetUrl.ts diff --git a/net/web/src/api/getChannelTopics.js b/net/web/src/api/getChannelTopics.ts similarity index 100% rename from net/web/src/api/getChannelTopics.js rename to net/web/src/api/getChannelTopics.ts diff --git a/net/web/src/api/getChannels.js b/net/web/src/api/getChannels.ts similarity index 100% rename from net/web/src/api/getChannels.js rename to net/web/src/api/getChannels.ts diff --git a/net/web/src/api/getContactChannelDetail.js b/net/web/src/api/getContactChannelDetail.ts similarity index 100% rename from net/web/src/api/getContactChannelDetail.js rename to net/web/src/api/getContactChannelDetail.ts diff --git a/net/web/src/api/getContactChannelSummary.js b/net/web/src/api/getContactChannelSummary.ts similarity index 100% rename from net/web/src/api/getContactChannelSummary.js rename to net/web/src/api/getContactChannelSummary.ts diff --git a/net/web/src/api/getContactChannelTopic.js b/net/web/src/api/getContactChannelTopic.ts similarity index 100% rename from net/web/src/api/getContactChannelTopic.js rename to net/web/src/api/getContactChannelTopic.ts diff --git a/net/web/src/api/getContactChannelTopicAssetUrl.js b/net/web/src/api/getContactChannelTopicAssetUrl.ts similarity index 100% rename from net/web/src/api/getContactChannelTopicAssetUrl.js rename to net/web/src/api/getContactChannelTopicAssetUrl.ts diff --git a/net/web/src/api/getContactChannelTopics.js b/net/web/src/api/getContactChannelTopics.ts similarity index 100% rename from net/web/src/api/getContactChannelTopics.js rename to net/web/src/api/getContactChannelTopics.ts diff --git a/net/web/src/api/getContactChannels.js b/net/web/src/api/getContactChannels.ts similarity index 96% rename from net/web/src/api/getContactChannels.js rename to net/web/src/api/getContactChannels.ts index 579385ed1..9da7ead4c 100644 --- a/net/web/src/api/getContactChannels.js +++ b/net/web/src/api/getContactChannels.ts @@ -1,6 +1,6 @@ import { checkResponse, fetchWithTimeout } from './fetchUtil'; -export async function getContactChannels(server, token, viewRevision, channelRevision) { +export async function getContactChannels(server, token, viewRevision?, channelRevision?) { let host = ""; if (server) { host = `https://${server}`; diff --git a/net/web/src/api/getContactProfile.js b/net/web/src/api/getContactProfile.ts similarity index 100% rename from net/web/src/api/getContactProfile.js rename to net/web/src/api/getContactProfile.ts diff --git a/net/web/src/api/getGroups.js b/net/web/src/api/getGroups.ts similarity index 100% rename from net/web/src/api/getGroups.js rename to net/web/src/api/getGroups.ts diff --git a/net/web/src/api/getListing.js b/net/web/src/api/getListing.ts similarity index 100% rename from net/web/src/api/getListing.js rename to net/web/src/api/getListing.ts diff --git a/net/web/src/api/getListingImageUrl.js b/net/web/src/api/getListingImageUrl.ts similarity index 100% rename from net/web/src/api/getListingImageUrl.js rename to net/web/src/api/getListingImageUrl.ts diff --git a/net/web/src/api/getListingMessage.js b/net/web/src/api/getListingMessage.ts similarity index 100% rename from net/web/src/api/getListingMessage.js rename to net/web/src/api/getListingMessage.ts diff --git a/net/web/src/api/getNodeAccounts.js b/net/web/src/api/getNodeAccounts.ts similarity index 100% rename from net/web/src/api/getNodeAccounts.js rename to net/web/src/api/getNodeAccounts.ts diff --git a/net/web/src/api/getNodeConfig.js b/net/web/src/api/getNodeConfig.ts similarity index 100% rename from net/web/src/api/getNodeConfig.js rename to net/web/src/api/getNodeConfig.ts diff --git a/net/web/src/api/getNodeStatus.js b/net/web/src/api/getNodeStatus.ts similarity index 100% rename from net/web/src/api/getNodeStatus.js rename to net/web/src/api/getNodeStatus.ts diff --git a/net/web/src/api/getProfile.js b/net/web/src/api/getProfile.ts similarity index 100% rename from net/web/src/api/getProfile.js rename to net/web/src/api/getProfile.ts diff --git a/net/web/src/api/getProfileImageUrl.js b/net/web/src/api/getProfileImageUrl.ts similarity index 100% rename from net/web/src/api/getProfileImageUrl.js rename to net/web/src/api/getProfileImageUrl.ts diff --git a/net/web/src/api/getUsername.js b/net/web/src/api/getUsername.ts similarity index 100% rename from net/web/src/api/getUsername.js rename to net/web/src/api/getUsername.ts diff --git a/net/web/src/api/keepCall.js b/net/web/src/api/keepCall.ts similarity index 100% rename from net/web/src/api/keepCall.js rename to net/web/src/api/keepCall.ts diff --git a/net/web/src/api/removeAccount.js b/net/web/src/api/removeAccount.ts similarity index 100% rename from net/web/src/api/removeAccount.js rename to net/web/src/api/removeAccount.ts diff --git a/net/web/src/api/removeCall.js b/net/web/src/api/removeCall.ts similarity index 100% rename from net/web/src/api/removeCall.js rename to net/web/src/api/removeCall.ts diff --git a/net/web/src/api/removeCard.js b/net/web/src/api/removeCard.ts similarity index 100% rename from net/web/src/api/removeCard.js rename to net/web/src/api/removeCard.ts diff --git a/net/web/src/api/removeChannel.js b/net/web/src/api/removeChannel.ts similarity index 100% rename from net/web/src/api/removeChannel.js rename to net/web/src/api/removeChannel.ts diff --git a/net/web/src/api/removeChannelTopic.js b/net/web/src/api/removeChannelTopic.ts similarity index 100% rename from net/web/src/api/removeChannelTopic.js rename to net/web/src/api/removeChannelTopic.ts diff --git a/net/web/src/api/removeContactCall.js b/net/web/src/api/removeContactCall.ts similarity index 100% rename from net/web/src/api/removeContactCall.js rename to net/web/src/api/removeContactCall.ts diff --git a/net/web/src/api/removeContactChannel.js b/net/web/src/api/removeContactChannel.ts similarity index 100% rename from net/web/src/api/removeContactChannel.js rename to net/web/src/api/removeContactChannel.ts diff --git a/net/web/src/api/removeContactChannelTopic.js b/net/web/src/api/removeContactChannelTopic.ts similarity index 100% rename from net/web/src/api/removeContactChannelTopic.js rename to net/web/src/api/removeContactChannelTopic.ts diff --git a/net/web/src/api/setAccountAccess.js b/net/web/src/api/setAccountAccess.ts similarity index 100% rename from net/web/src/api/setAccountAccess.js rename to net/web/src/api/setAccountAccess.ts diff --git a/net/web/src/api/setAccountLogin.js b/net/web/src/api/setAccountLogin.ts similarity index 100% rename from net/web/src/api/setAccountLogin.js rename to net/web/src/api/setAccountLogin.ts diff --git a/net/web/src/api/setAccountSeal.js b/net/web/src/api/setAccountSeal.ts similarity index 100% rename from net/web/src/api/setAccountSeal.js rename to net/web/src/api/setAccountSeal.ts diff --git a/net/web/src/api/setAccountSearchable.js b/net/web/src/api/setAccountSearchable.ts similarity index 100% rename from net/web/src/api/setAccountSearchable.js rename to net/web/src/api/setAccountSearchable.ts diff --git a/net/web/src/api/setAccountStatus.js b/net/web/src/api/setAccountStatus.ts similarity index 100% rename from net/web/src/api/setAccountStatus.js rename to net/web/src/api/setAccountStatus.ts diff --git a/net/web/src/api/setCardCloseMessage.js b/net/web/src/api/setCardCloseMessage.ts similarity index 100% rename from net/web/src/api/setCardCloseMessage.js rename to net/web/src/api/setCardCloseMessage.ts diff --git a/net/web/src/api/setCardOpenMessage.js b/net/web/src/api/setCardOpenMessage.ts similarity index 100% rename from net/web/src/api/setCardOpenMessage.js rename to net/web/src/api/setCardOpenMessage.ts diff --git a/net/web/src/api/setCardProfile.js b/net/web/src/api/setCardProfile.ts similarity index 100% rename from net/web/src/api/setCardProfile.js rename to net/web/src/api/setCardProfile.ts diff --git a/net/web/src/api/setCardStatus.js b/net/web/src/api/setCardStatus.ts similarity index 100% rename from net/web/src/api/setCardStatus.js rename to net/web/src/api/setCardStatus.ts diff --git a/net/web/src/api/setChannelCard.js b/net/web/src/api/setChannelCard.ts similarity index 100% rename from net/web/src/api/setChannelCard.js rename to net/web/src/api/setChannelCard.ts diff --git a/net/web/src/api/setChannelSubject.js b/net/web/src/api/setChannelSubject.ts similarity index 100% rename from net/web/src/api/setChannelSubject.js rename to net/web/src/api/setChannelSubject.ts diff --git a/net/web/src/api/setChannelTopicAsset.js b/net/web/src/api/setChannelTopicAsset.ts similarity index 100% rename from net/web/src/api/setChannelTopicAsset.js rename to net/web/src/api/setChannelTopicAsset.ts diff --git a/net/web/src/api/setChannelTopicSubject.js b/net/web/src/api/setChannelTopicSubject.ts similarity index 100% rename from net/web/src/api/setChannelTopicSubject.js rename to net/web/src/api/setChannelTopicSubject.ts diff --git a/net/web/src/api/setContactChannelTopicAsset.js b/net/web/src/api/setContactChannelTopicAsset.ts similarity index 100% rename from net/web/src/api/setContactChannelTopicAsset.js rename to net/web/src/api/setContactChannelTopicAsset.ts diff --git a/net/web/src/api/setContactChannelTopicSubject.js b/net/web/src/api/setContactChannelTopicSubject.ts similarity index 100% rename from net/web/src/api/setContactChannelTopicSubject.js rename to net/web/src/api/setContactChannelTopicSubject.ts diff --git a/net/web/src/api/setLogin.js b/net/web/src/api/setLogin.ts similarity index 100% rename from net/web/src/api/setLogin.js rename to net/web/src/api/setLogin.ts diff --git a/net/web/src/api/setNodeConfig.js b/net/web/src/api/setNodeConfig.ts similarity index 100% rename from net/web/src/api/setNodeConfig.js rename to net/web/src/api/setNodeConfig.ts diff --git a/net/web/src/api/setNodeStatus.js b/net/web/src/api/setNodeStatus.ts similarity index 100% rename from net/web/src/api/setNodeStatus.js rename to net/web/src/api/setNodeStatus.ts diff --git a/net/web/src/api/setProfileData.js b/net/web/src/api/setProfileData.ts similarity index 100% rename from net/web/src/api/setProfileData.js rename to net/web/src/api/setProfileData.ts diff --git a/net/web/src/api/setProfileImage.js b/net/web/src/api/setProfileImage.ts similarity index 100% rename from net/web/src/api/setProfileImage.js rename to net/web/src/api/setProfileImage.ts diff --git a/net/web/src/carousel/Carousel.styled.js b/net/web/src/carousel/Carousel.styled.ts similarity index 100% rename from net/web/src/carousel/Carousel.styled.js rename to net/web/src/carousel/Carousel.styled.ts diff --git a/net/web/src/carousel/Carousel.jsx b/net/web/src/carousel/Carousel.tsx similarity index 67% rename from net/web/src/carousel/Carousel.jsx rename to net/web/src/carousel/Carousel.tsx index f399f1927..d40265e12 100644 --- a/net/web/src/carousel/Carousel.jsx +++ b/net/web/src/carousel/Carousel.tsx @@ -2,15 +2,21 @@ import React, { useState, useEffect, useRef } from 'react'; import { CarouselWrapper } from './Carousel.styled'; import { CloseOutlined } from '@ant-design/icons'; import ReactResizeDetector from 'react-resize-detector'; +interface Props { + pad?:any + items?:any + itemRenderer?:any + itemRemove?:any -export function Carousel({ pad, items, itemRenderer, itemRemove }) { +} +export function Carousel({ pad, items, itemRenderer, itemRemove }:Props) { const [slots, setSlots] = useState([]); - let carousel = useRef(); + let carousel = useRef(); const RemoveItem = ({ index }) => { if (itemRemove) { - return
itemRemove(index)}>
+ return
itemRemove(index)}>
} return <> } @@ -22,8 +28,8 @@ export function Carousel({ pad, items, itemRenderer, itemRemove }) { {({ width, height }) => { return ( -
-
{ itemRenderer(items[i], i) }
+
+
{ itemRenderer(items[i], i) }
); @@ -32,14 +38,14 @@ export function Carousel({ pad, items, itemRenderer, itemRemove }) { )); } if (items.length > 0) { - assets.push(
) + assets.push(
) } setSlots(assets); }, [items, itemRenderer]); return ( -