From 32e7c4fe0e007521415a762bf36452463e9d4e9a Mon Sep 17 00:00:00 2001 From: Kenny Jung Date: Mon, 11 Sep 2023 22:41:31 +0900 Subject: [PATCH 1/3] Add webpack-bundle-analyzer --- craco.config.js | 6 ++++ package.json | 4 ++- yarn.lock | 93 +++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 99 insertions(+), 4 deletions(-) diff --git a/craco.config.js b/craco.config.js index 16594b27..ad696b9a 100644 --- a/craco.config.js +++ b/craco.config.js @@ -13,6 +13,9 @@ const themeOverride = } : {}; +const BundleAanlyzerPlugin = + require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + module.exports = { plugins: [ { @@ -33,4 +36,7 @@ module.exports = { ], ], }, + webpack: { + plugins: [new BundleAanlyzerPlugin({ analyzerMode: 'server' })], + }, }; diff --git a/package.json b/package.json index 4cde6834..8d82388c 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "uuid": "^8.3.1" }, "scripts": { + "analyze": "source-map-explorer 'build/static/js/*.js'", "start": "nodemon -w craco.config.js -w ./antd.customize.less --exec \"npx craco start\"", "build": "craco build", "test": "craco test --coverage", @@ -85,6 +86,7 @@ "prettier": "^2.1.2", "redux-devtools": "^3.5.0", "tslint": "^6.1.3", - "tslint-config-prettier": "^1.18.0" + "tslint-config-prettier": "^1.18.0", + "webpack-bundle-analyzer": "^4.9.1" } } diff --git a/yarn.lock b/yarn.lock index 106d17ae..c7a4c59b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1336,6 +1336,11 @@ resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz#b6c75a56a1947cc916ea058772d666a2c8932f31" integrity sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA== +"@discoveryjs/json-ext@0.5.7": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== + "@emotion/is-prop-valid@^1.1.0": version "1.2.1" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc" @@ -1758,6 +1763,11 @@ schema-utils "^3.0.0" source-map "^0.7.3" +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.23" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.23.tgz#498e41218ab3b6a1419c735e5c6ae2c5ed609b6c" + integrity sha512-C16M+IYz0rgRhWZdCmK+h58JMv8vijAA61gmz2rspCSwKwzBebpdcsiUmwrtJRdphuY30i6BSLEOP8ppbNLyLg== + "@rc-component/portal@^1.0.0-8", "@rc-component/portal@^1.0.2", "@rc-component/portal@^1.1.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@rc-component/portal/-/portal-1.1.2.tgz#55db1e51d784e034442e9700536faaa6ab63fc71" @@ -2799,7 +2809,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1: +acorn-walk@^8.0.0, acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -2809,7 +2819,7 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -6053,6 +6063,11 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" @@ -7060,6 +7075,21 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw== + +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g== + +lodash.invokemap@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.invokemap/-/lodash.invokemap-4.6.0.tgz#1748cda5d8b0ef8369c4eb3ec54c21feba1f2d62" + integrity sha512-CfkycNtMqgUlfjfdh2BhKO/ZXrP8ePOX5lEU/g0R3ItJcnuxWDwokMGKx1hWcfOikmyOVx6X9IwWnDGlgKl61w== + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -7070,6 +7100,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.pullall@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.pullall/-/lodash.pullall-4.2.0.tgz#9d98b8518b7c965b0fae4099bd9fb7df8bbf38ba" + integrity sha512-VhqxBKH0ZxPpLhiu68YD1KnHmbhQJQctcipvmFnqIBDYzcIHzf3Zpu0tpeOKtR4x76p9yohc506eGdOjTmyIBg== + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -7080,6 +7115,11 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== +lodash.uniqby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" + integrity sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww== + lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -7284,6 +7324,11 @@ moment@^2.24.0, moment@^2.29.2, moment@^2.29.4: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== +mrmime@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" + integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -7578,6 +7623,11 @@ open@^8.0.9, open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -9687,6 +9737,15 @@ simple-update-notifier@^1.0.7: dependencies: semver "~7.0.0" +sirv@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.3.tgz#ca5868b87205a74bef62a469ed0296abceccd446" + integrity sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA== + dependencies: + "@polka/url" "^1.0.0-next.20" + mrmime "^1.0.0" + totalist "^3.0.0" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -10281,6 +10340,11 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + touch@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" @@ -10727,6 +10791,29 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webpack-bundle-analyzer@^4.9.1: + version "4.9.1" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.9.1.tgz#d00bbf3f17500c10985084f22f1a2bf45cb2f09d" + integrity sha512-jnd6EoYrf9yMxCyYDPj8eutJvtjQNp8PHmni/e/ulydHBWhT5J3menXt3HEkScsu9YqMAcG4CfFjs3rj5pVU1w== + dependencies: + "@discoveryjs/json-ext" "0.5.7" + acorn "^8.0.4" + acorn-walk "^8.0.0" + commander "^7.2.0" + escape-string-regexp "^4.0.0" + gzip-size "^6.0.0" + is-plain-object "^5.0.0" + lodash.debounce "^4.0.8" + lodash.escape "^4.0.1" + lodash.flatten "^4.4.0" + lodash.invokemap "^4.6.0" + lodash.pullall "^4.2.0" + lodash.uniqby "^4.7.0" + opener "^1.5.2" + picocolors "^1.0.0" + sirv "^2.0.3" + ws "^7.3.1" + webpack-dev-middleware@^5.3.1: version "5.3.3" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" @@ -11152,7 +11239,7 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.4.6: +ws@^7.3.1, ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== From 1aa3cfd9f2e09e1f8a06d6d243d0fd099d1a2208 Mon Sep 17 00:00:00 2001 From: Kenny Jung Date: Mon, 11 Sep 2023 23:48:41 +0900 Subject: [PATCH 2/3] Reduce bundle sizes for ant-design/icons and antd --- package.json | 1 - src/App.tsx | 2 +- src/components/adoptedSitesTable/index.tsx | 2 +- src/components/blockCard/index.tsx | 5 +++-- src/components/blockTabs/index.tsx | 3 ++- src/components/careEntry/index.tsx | 11 ++++++++-- src/components/copyText/index.tsx | 3 ++- .../emailerFilterControls/index.tsx | 16 +++++++------- src/components/entryList/index.tsx | 3 ++- src/components/featuredStats/index.tsx | 4 +++- .../forms/changeEmailForm/index.tsx | 4 +++- .../forms/changePasswordForm/index.tsx | 4 +++- .../forms/changePrivilegeForm/index.tsx | 5 ++++- .../forms/changeUsernameForm/index.tsx | 4 +++- .../forms/deleteAccountForm/index.tsx | 4 +++- src/components/forms/ducks/types.ts | 2 +- src/components/forms/editSiteForm/index.tsx | 6 ++++-- .../forms/editTreeNameForm/index.tsx | 5 +++-- src/components/forms/exportDataForm/index.tsx | 14 ++++++------- src/components/forms/loginForm/index.tsx | 5 +++-- src/components/forms/sendEmailForm/index.tsx | 4 +++- src/components/forms/signupForm/index.tsx | 5 +++-- .../forms/stewardshipForm/index.tsx | 6 +++++- src/components/forms/updateSiteForm/index.tsx | 11 +++++++--- .../forms/uploadSitesForm/index.tsx | 9 +++++--- src/components/goalInfo/index.tsx | 3 ++- src/components/greetingContainer/index.tsx | 2 +- src/components/infoCard/index.tsx | 7 ++++--- src/components/landingContent/index.tsx | 2 +- src/components/landingTreeStats/index.tsx | 2 +- .../leaderboard/leaderboardSpace/index.tsx | 5 +++-- .../leaderboard/leaderboardTab/index.tsx | 3 ++- .../leaderboard/leaderboardTabs/index.tsx | 3 ++- src/components/linkButton/index.tsx | 2 +- src/components/linkCard/index.tsx | 2 +- src/components/linkCarousel/index.tsx | 2 +- src/components/mapComponents/logic/event.ts | 2 +- src/components/mapComponents/logic/init.ts | 4 ++-- src/components/mapComponents/logic/style.ts | 2 +- .../mapDisplays/blocksMapDisplay/index.tsx | 4 +++- .../mapDisplays/selectorMapDisplay/index.tsx | 3 ++- .../mapDisplays/treeMapDisplay/index.tsx | 4 +++- .../mapComponents/mapLegend/index.tsx | 3 ++- .../mapPageComponents/mapPage/index.tsx | 2 +- .../mapPageComponents/mapSidebar/index.tsx | 2 +- .../mobileLandingBar/index.tsx | 2 +- .../mapPageComponents/siteLegend/index.tsx | 9 ++++++-- .../mapComponents/maps/mapWithPopup/index.tsx | 3 ++- .../mapComponents/maps/treeMap/index.tsx | 2 +- .../mobileComponents/mobileFooter/index.tsx | 2 +- .../mobileComponents/mobileInfoCard/index.tsx | 3 ++- src/components/navBar/mobileNavBar/index.tsx | 7 ++++--- src/components/navBar/navExtra/index.tsx | 6 ++++-- src/components/navBar/navMenu/index.tsx | 2 +- src/components/pageLayout/index.tsx | 2 +- src/components/reservationModal/index.tsx | 5 ++++- src/components/shareButton/index.tsx | 4 ++-- src/components/shareMenu/index.tsx | 5 ++++- src/components/siteEntryTable/index.tsx | 7 +++++-- src/components/siteFeatures/index.tsx | 3 ++- src/components/slideDown/index.tsx | 3 ++- .../tables/adoptionReportTable/index.tsx | 2 +- src/components/tables/siteLink/index.tsx | 2 +- .../tables/stewardshipReportTable/index.tsx | 2 +- src/components/tables/tags/index.tsx | 2 +- src/components/teamMember/index.tsx | 5 +++-- src/components/themedComponents/index.tsx | 20 ++++++++---------- src/components/titleStack/index.tsx | 2 +- src/components/treeActivity/index.tsx | 5 ++++- src/components/treeCard/index.tsx | 3 ++- src/components/treeInfo/index.tsx | 4 +++- src/components/treePageHeader/index.tsx | 7 ++++--- src/components/treePopup/index.tsx | 4 ++-- src/components/treeSidebar/index.tsx | 2 +- src/containers/addSites/index.tsx | 8 +++++-- src/containers/adminDashboard/index.tsx | 21 +++++++++++-------- src/containers/availableTeams/index.tsx | 5 +++-- src/containers/email/index.tsx | 20 ++++++++---------- src/containers/faq/index.tsx | 3 ++- src/containers/forgotPassword/index.tsx | 5 ++++- src/containers/forgotPasswordReset/index.tsx | 5 ++++- src/containers/home/index.tsx | 3 ++- src/containers/landing/index.tsx | 3 ++- src/containers/login/index.tsx | 4 +++- src/containers/myTrees/index.tsx | 2 +- src/containers/notFound/index.tsx | 2 +- src/containers/reports/index.tsx | 6 +++++- src/containers/settings/index.tsx | 6 +++++- src/containers/signup/index.tsx | 7 ++++++- src/containers/sitePage/index.tsx | 7 +++++-- src/containers/teamPage/index.tsx | 5 ++++- src/containers/treePage/index.tsx | 7 ++++++- src/utils/formRules.tsx | 2 +- src/utils/treeFunctions.tsx | 2 +- 94 files changed, 281 insertions(+), 164 deletions(-) diff --git a/package.json b/package.json index 8d82388c..d9a117ab 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "uuid": "^8.3.1" }, "scripts": { - "analyze": "source-map-explorer 'build/static/js/*.js'", "start": "nodemon -w craco.config.js -w ./antd.customize.less --exec \"npx craco start\"", "build": "craco build", "test": "craco test --coverage", diff --git a/src/App.tsx b/src/App.tsx index cce15cb5..8621adc5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,7 +18,7 @@ import Landing from './containers/landing'; import AdminDashboard from './containers/adminDashboard'; import TreePage from './containers/treePage'; import MyTrees from './containers/myTrees'; -import { Layout } from 'antd'; +import Layout from 'antd/es/layout'; import Home from './containers/home'; import Signup from './containers/signup'; import Login from './containers/login'; diff --git a/src/components/adoptedSitesTable/index.tsx b/src/components/adoptedSitesTable/index.tsx index 4b8c8b72..e953d3d6 100644 --- a/src/components/adoptedSitesTable/index.tsx +++ b/src/components/adoptedSitesTable/index.tsx @@ -1,5 +1,5 @@ import React, { SetStateAction, useMemo, useState } from 'react'; -import { Table } from 'antd'; +import Table from 'antd/es/table'; import type { ColumnsType } from 'antd/es/table'; import { EmailerTableData, FilteredSite } from '../../containers/email/types'; import { NEIGHBORHOOD_IDS } from '../../assets/content'; diff --git a/src/components/blockCard/index.tsx b/src/components/blockCard/index.tsx index fdd6e473..ce7c7e16 100644 --- a/src/components/blockCard/index.tsx +++ b/src/components/blockCard/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { Card, Typography } from 'antd'; -import { CloseCircleOutlined } from '@ant-design/icons'; +import Card from 'antd/es/card'; +import Typography from 'antd/es/typography'; +import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined'; import styled from 'styled-components'; import { CardInfo } from '../themedComponents'; import { MID_GREEN, TEXT_GREY, LIGHT_GREY } from '../../utils/colors'; diff --git a/src/components/blockTabs/index.tsx b/src/components/blockTabs/index.tsx index 9e67e0de..d98fa87a 100644 --- a/src/components/blockTabs/index.tsx +++ b/src/components/blockTabs/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { List, Tabs } from 'antd'; +import List from 'antd/es/list'; +import Tabs from 'antd/es/tabs'; import styled from 'styled-components'; import { StyledListItem, ScrollableListContainer } from '../themedComponents'; import { DARK_GREY } from '../../utils/colors'; diff --git a/src/components/careEntry/index.tsx b/src/components/careEntry/index.tsx index 44909a93..22c6d359 100644 --- a/src/components/careEntry/index.tsx +++ b/src/components/careEntry/index.tsx @@ -1,6 +1,12 @@ import React, { useState } from 'react'; import { TreeCare } from '../../containers/treePage/ducks/types'; -import { Row, Col, Typography, Button, Form, Modal, message } from 'antd'; +import Row from 'antd/es/row'; +import Col from 'antd/es/col'; +import Typography from 'antd/es/typography'; +import Button from 'antd/es/button'; +import Form from 'antd/es/form'; +import Modal from 'antd/es/modal'; +import message from 'antd/es/message'; import { DARK_GREEN, TEXT_GREY, @@ -9,7 +15,8 @@ import { WHITE, } from '../../utils/colors'; import { treeCareToMoment } from '../../utils/treeFunctions'; -import { EditOutlined, DeleteOutlined } from '@ant-design/icons'; +import EditOutlined from '@ant-design/icons/EditOutlined'; +import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import { useDispatch, useSelector } from 'react-redux'; import { isAdmin, getUserID } from '../../auth/ducks/selectors'; import styled from 'styled-components'; diff --git a/src/components/copyText/index.tsx b/src/components/copyText/index.tsx index 9cc4e333..560498d1 100644 --- a/src/components/copyText/index.tsx +++ b/src/components/copyText/index.tsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; -import { Button, Tooltip } from 'antd'; +import Button from 'antd/es/button'; +import Tooltip from 'antd/es/tooltip'; import styled from 'styled-components'; interface CopyTextProps { diff --git a/src/components/emailerFilterControls/index.tsx b/src/components/emailerFilterControls/index.tsx index f4be7a5c..6bb1e831 100644 --- a/src/components/emailerFilterControls/index.tsx +++ b/src/components/emailerFilterControls/index.tsx @@ -1,15 +1,13 @@ import React, { useState, useEffect } from 'react'; import moment from 'moment'; import { EmailerFilters } from '../../containers/email/types'; -import { - Collapse, - Slider, - DatePicker, - Select, - message, - SelectProps, -} from 'antd'; -import { SliderMarks } from 'antd/lib/slider'; +import Collapse from 'antd/es/collapse'; +import Slider from 'antd/es/slider'; +import type { SliderMarks } from 'antd/es/slider'; +import DatePicker from 'antd/es/date-picker'; +import Select from 'antd/es/select'; +import type { SelectProps } from 'antd/es/select'; +import message from 'antd/es/message'; import { Neighborhoods } from '../../assets/content'; import apiClient from '../../api/apiClient'; import { formatActivityCountRange } from '../../utils/stringFormat'; diff --git a/src/components/entryList/index.tsx b/src/components/entryList/index.tsx index e5c4e357..62acb2cc 100644 --- a/src/components/entryList/index.tsx +++ b/src/components/entryList/index.tsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; -import { Button, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Typography from 'antd/es/typography'; import { Entry } from '../../containers/treePage/ducks/types'; import { DARK_GREEN, diff --git a/src/components/featuredStats/index.tsx b/src/components/featuredStats/index.tsx index e6cdaba3..7a524dcc 100644 --- a/src/components/featuredStats/index.tsx +++ b/src/components/featuredStats/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; import styled from 'styled-components'; -import { Card, Statistic, Typography } from 'antd'; +import Card from 'antd/es/card'; +import Statistic from 'antd/es/statistic'; +import Typography from 'antd/es/typography'; const FeaturedStatsContainer = styled.div` display: flex; diff --git a/src/components/forms/changeEmailForm/index.tsx b/src/components/forms/changeEmailForm/index.tsx index 3a7a2fe1..7fbd3f57 100644 --- a/src/components/forms/changeEmailForm/index.tsx +++ b/src/components/forms/changeEmailForm/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { useDispatch } from 'react-redux'; -import { message, Form, Input } from 'antd'; +import message from 'antd/es/message'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { enterEmailRules, loginPasswordRules } from '../../../utils/formRules'; import { ChangeEmailRequest } from '../ducks/types'; diff --git a/src/components/forms/changePasswordForm/index.tsx b/src/components/forms/changePasswordForm/index.tsx index 53b3b6c0..cbc002b9 100644 --- a/src/components/forms/changePasswordForm/index.tsx +++ b/src/components/forms/changePasswordForm/index.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { message, Form, Input } from 'antd'; +import message from 'antd/es/message'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { confirmPasswordRules, diff --git a/src/components/forms/changePrivilegeForm/index.tsx b/src/components/forms/changePrivilegeForm/index.tsx index 410da6b0..92a56931 100644 --- a/src/components/forms/changePrivilegeForm/index.tsx +++ b/src/components/forms/changePrivilegeForm/index.tsx @@ -1,5 +1,8 @@ import React from 'react'; -import { Form, Input, message, Select } from 'antd'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; +import message from 'antd/es/message'; +import Select from 'antd/es/select'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { loginPasswordRules, diff --git a/src/components/forms/changeUsernameForm/index.tsx b/src/components/forms/changeUsernameForm/index.tsx index 18929aeb..f5a54dc9 100644 --- a/src/components/forms/changeUsernameForm/index.tsx +++ b/src/components/forms/changeUsernameForm/index.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { message, Form, Input } from 'antd'; +import message from 'antd/es/message'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { loginPasswordRules, usernameRules } from '../../../utils/formRules'; import { ChangeUsernameRequest } from '../ducks/types'; diff --git a/src/components/forms/deleteAccountForm/index.tsx b/src/components/forms/deleteAccountForm/index.tsx index c17bb995..b14dd85a 100644 --- a/src/components/forms/deleteAccountForm/index.tsx +++ b/src/components/forms/deleteAccountForm/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; -import { message, Form, Input } from 'antd'; +import message from 'antd/es/message'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { loginPasswordRules } from '../../../utils/formRules'; import { AuthRequest } from '../ducks/types'; diff --git a/src/components/forms/ducks/types.ts b/src/components/forms/ducks/types.ts index b7322e92..b6efbe65 100644 --- a/src/components/forms/ducks/types.ts +++ b/src/components/forms/ducks/types.ts @@ -1,4 +1,4 @@ -import { CheckboxOptionType } from 'antd/lib/checkbox/Group'; +import type { CheckboxOptionType } from 'antd/es/checkbox/Group'; import moment from 'moment'; import { PrivilegeLevel, SignupRequest } from '../../../auth/ducks/types'; import { SiteEntryStatus } from '../../../containers/treePage/ducks/types'; diff --git a/src/components/forms/editSiteForm/index.tsx b/src/components/forms/editSiteForm/index.tsx index 3b10870c..8cc32297 100644 --- a/src/components/forms/editSiteForm/index.tsx +++ b/src/components/forms/editSiteForm/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; -import { Form, Input, Select } from 'antd'; -import { FormInstance } from 'antd/es/form'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import Input from 'antd/es/input'; +import Select from 'antd/es/select'; import { requiredRule, zipCodeRules } from '../../../utils/formRules'; import { EditSiteRequest } from '../ducks/types'; import { NEIGHBORHOOD_OPTS } from '../../../assets/content'; diff --git a/src/components/forms/editTreeNameForm/index.tsx b/src/components/forms/editTreeNameForm/index.tsx index 71580b40..39954903 100644 --- a/src/components/forms/editTreeNameForm/index.tsx +++ b/src/components/forms/editTreeNameForm/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { Form, Input } from 'antd'; -import { FormInstance } from 'antd/es/form'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import Input from 'antd/es/input'; import { treeNameRules } from '../../../utils/formRules'; import { NameSiteEntryRequest } from '../ducks/types'; import { GreenButton, WhiteButton } from '../../themedComponents'; diff --git a/src/components/forms/exportDataForm/index.tsx b/src/components/forms/exportDataForm/index.tsx index e5b0f08d..e3ba2602 100644 --- a/src/components/forms/exportDataForm/index.tsx +++ b/src/components/forms/exportDataForm/index.tsx @@ -1,13 +1,11 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { - Button, - Form, - FormInstance, - InputNumber, - Select, - Typography, -} from 'antd'; +import Button from 'antd/es/button'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import InputNumber from 'antd/es/input-number'; +import Select from 'antd/es/select'; +import Typography from 'antd/es/typography'; import { site } from '../../../constants'; import { positiveNumberRules, requiredRule } from '../../../utils/formRules'; import { InlineFormItem } from '../../themedComponents'; diff --git a/src/components/forms/loginForm/index.tsx b/src/components/forms/loginForm/index.tsx index eee13b9a..04560cbb 100644 --- a/src/components/forms/loginForm/index.tsx +++ b/src/components/forms/loginForm/index.tsx @@ -1,9 +1,10 @@ import React from 'react'; import { LoginRequest } from '../../../auth/ducks/types'; -import { Form, Input } from 'antd'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import Input from 'antd/es/input'; import styled from 'styled-components'; import { WindowTypes } from '../../windowDimensions'; -import { FormInstance } from 'antd/es/form'; import { enterEmailRules, loginPasswordRules } from '../../../utils/formRules'; import { SubmitButton } from '../../themedComponents'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/forms/sendEmailForm/index.tsx b/src/components/forms/sendEmailForm/index.tsx index 23eeffa7..ecf4bf40 100644 --- a/src/components/forms/sendEmailForm/index.tsx +++ b/src/components/forms/sendEmailForm/index.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { Form, Input, message } from 'antd'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; +import message from 'antd/es/message'; import { SubmitButton } from '../../../components/themedComponents'; import ProtectedApiClient from '../../../api/protectedApiClient'; import { diff --git a/src/components/forms/signupForm/index.tsx b/src/components/forms/signupForm/index.tsx index 68935189..e5764ef6 100644 --- a/src/components/forms/signupForm/index.tsx +++ b/src/components/forms/signupForm/index.tsx @@ -1,12 +1,13 @@ import React, { PropsWithChildren } from 'react'; -import { Form, Input } from 'antd'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import Input from 'antd/es/input'; import { FormHalfItem, FormRow, FullWidthSpace, Gap, } from '../../themedComponents'; -import { FormInstance } from 'antd/es/form'; import { confirmPasswordRules, enterEmailRules, diff --git a/src/components/forms/stewardshipForm/index.tsx b/src/components/forms/stewardshipForm/index.tsx index 4f2beb93..b8a03f33 100644 --- a/src/components/forms/stewardshipForm/index.tsx +++ b/src/components/forms/stewardshipForm/index.tsx @@ -1,6 +1,10 @@ import React from 'react'; import moment from 'moment'; -import { Form, Checkbox, Typography, DatePicker, FormInstance } from 'antd'; +import Form from 'antd/es/form'; +import type { FormInstance } from 'antd/es/form'; +import Checkbox from 'antd/es/checkbox'; +import Typography from 'antd/es/typography'; +import DatePicker from 'antd/es/date-picker'; import styled from 'styled-components'; import { activitiesDateRules, activitiesRules } from '../../../utils/formRules'; import { SubmitButton } from '../../themedComponents'; diff --git a/src/components/forms/updateSiteForm/index.tsx b/src/components/forms/updateSiteForm/index.tsx index d941b535..2fcc0fed 100644 --- a/src/components/forms/updateSiteForm/index.tsx +++ b/src/components/forms/updateSiteForm/index.tsx @@ -1,6 +1,12 @@ import React from 'react'; -import { Form, Input, Radio, Row, Space, DatePicker } from 'antd'; -import { FormInstance, Rule } from 'antd/es/form'; +import Form from 'antd/es/form'; +import type { FormInstance, Rule } from 'antd/es/form'; +import Input from 'antd/es/input'; +import Radio from 'antd/es/radio'; +import type { CheckboxOptionType } from 'antd/es/checkbox/Group'; +import Row from 'antd/es/row'; +import Space from 'antd/es/space'; +import DatePicker from 'antd/es/date-picker'; import { BOOL_RADIO_OPTS, STATUS_RADIO_OPTS, @@ -13,7 +19,6 @@ import { SiteEntryFields, } from '../../../containers/treePage/ducks/types'; import { stringNumberRules } from '../../../utils/formRules'; -import { CheckboxOptionType } from 'antd/es/checkbox/Group'; import { getSEFieldDisplayName } from '../../../utils/stringFormat'; import { useTranslation } from 'react-i18next'; import { n } from '../../../utils/stringFormat'; diff --git a/src/components/forms/uploadSitesForm/index.tsx b/src/components/forms/uploadSitesForm/index.tsx index f0827822..65a6834b 100644 --- a/src/components/forms/uploadSitesForm/index.tsx +++ b/src/components/forms/uploadSitesForm/index.tsx @@ -1,9 +1,12 @@ import React from 'react'; -import { message, Upload, Form, Button } from 'antd'; +import message from 'antd/es/message'; +import Upload from 'antd/es/upload'; +import type { UploadProps } from 'antd/lib/upload/interface'; +import Form from 'antd/es/form'; +import Button from 'antd/es/button'; import { requiredRule } from '../../../utils/formRules'; import { SubmitButton } from '../../themedComponents'; -import { UploadOutlined } from '@ant-design/icons'; -import { UploadProps } from 'antd/lib/upload/interface'; +import UploadOutlined from '@ant-design/icons/UploadOutlined'; import ProtectedClient from '../../../api/protectedApiClient'; interface UploadSitesFormRule { diff --git a/src/components/goalInfo/index.tsx b/src/components/goalInfo/index.tsx index 7e6a41be..346e8f1f 100644 --- a/src/components/goalInfo/index.tsx +++ b/src/components/goalInfo/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import styled from 'styled-components'; -import { Card, Typography } from 'antd'; +import Card from 'antd/es/card'; +import Typography from 'antd/es/typography'; import { DARK_GREEN, TEXT_GREY } from '../../utils/colors'; interface GoalInfoProps { diff --git a/src/components/greetingContainer/index.tsx b/src/components/greetingContainer/index.tsx index 7f276e1d..0590e811 100644 --- a/src/components/greetingContainer/index.tsx +++ b/src/components/greetingContainer/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import { BACKGROUND_GREEN, BLACK } from '../../utils/colors'; import styled from 'styled-components'; import logo from '../../assets/images/logo.png'; diff --git a/src/components/infoCard/index.tsx b/src/components/infoCard/index.tsx index 784dc700..26f91a19 100644 --- a/src/components/infoCard/index.tsx +++ b/src/components/infoCard/index.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { Card, Typography } from 'antd'; -import { ParagraphProps } from 'antd/lib/typography/Paragraph'; -import { TitleProps } from 'antd/lib/typography/Title'; +import Card from 'antd/es/card'; +import Typography from 'antd/es/typography'; +import type { TitleProps } from 'antd/lib/typography/Title'; +import type { ParagraphProps } from 'antd/lib/typography/Paragraph'; import styled from 'styled-components'; import { TEXT_GREY } from '../../utils/colors'; diff --git a/src/components/landingContent/index.tsx b/src/components/landingContent/index.tsx index fc349b8d..a8182f96 100644 --- a/src/components/landingContent/index.tsx +++ b/src/components/landingContent/index.tsx @@ -1,5 +1,5 @@ import OrderedList from '../orderedList'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { CONTACT_EMAIL } from '../../assets/links'; diff --git a/src/components/landingTreeStats/index.tsx b/src/components/landingTreeStats/index.tsx index 640ace8e..61555dfb 100644 --- a/src/components/landingTreeStats/index.tsx +++ b/src/components/landingTreeStats/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'styled-components'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import useWindowDimensions, { WindowTypes } from '../windowDimensions'; import { TEXT_GREY, MID_GREEN } from '../../utils/colors'; import MobileInfoCard from '../mobileComponents/mobileInfoCard'; diff --git a/src/components/leaderboard/leaderboardSpace/index.tsx b/src/components/leaderboard/leaderboardSpace/index.tsx index 43690891..32a16a4e 100644 --- a/src/components/leaderboard/leaderboardSpace/index.tsx +++ b/src/components/leaderboard/leaderboardSpace/index.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; -import { ParagraphProps } from 'antd/lib/typography/Paragraph'; +import Collapse from 'antd/es/collapse'; +import Typography from 'antd/es/typography'; +import type { ParagraphProps } from 'antd/lib/typography/Paragraph'; import { BLACK, LIGHT_GREEN } from '../../../utils/colors'; import styled from 'styled-components'; -import { Collapse, Typography } from 'antd'; import { TabItem } from '../types'; import { FullWidthSpace } from '../../themedComponents'; diff --git a/src/components/leaderboard/leaderboardTab/index.tsx b/src/components/leaderboard/leaderboardTab/index.tsx index cdcd6a37..2db077eb 100644 --- a/src/components/leaderboard/leaderboardTab/index.tsx +++ b/src/components/leaderboard/leaderboardTab/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Col, Row } from 'antd'; +import Col from 'antd/es/col'; +import Row from 'antd/es/row'; import LeaderboardPanels from '../leaderboardSpace'; import { TabItem } from '../types'; diff --git a/src/components/leaderboard/leaderboardTabs/index.tsx b/src/components/leaderboard/leaderboardTabs/index.tsx index 5a7f32fa..30008b8d 100644 --- a/src/components/leaderboard/leaderboardTabs/index.tsx +++ b/src/components/leaderboard/leaderboardTabs/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Tabs, Pagination } from 'antd'; +import Tabs from 'antd/es/tabs'; +import Pagination from 'antd/es/pagination'; import LeaderboardTab from '../leaderboardTab'; import { TabItem } from '../types'; import { tabToDays } from '../constants'; diff --git a/src/components/linkButton/index.tsx b/src/components/linkButton/index.tsx index c4f41b6b..8b0b9180 100644 --- a/src/components/linkButton/index.tsx +++ b/src/components/linkButton/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button } from 'antd'; +import Button from 'antd/es/button'; import { Link } from 'react-router-dom'; // onClick is overwritten diff --git a/src/components/linkCard/index.tsx b/src/components/linkCard/index.tsx index 7801adcb..0ab28e14 100644 --- a/src/components/linkCard/index.tsx +++ b/src/components/linkCard/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'styled-components'; -import { Card } from 'antd'; +import Card from 'antd/es/card'; import { PALE_GREEN } from '../../utils/colors'; import bkg1 from '../../assets/images/bkg1.png'; import bkg2 from '../../assets/images/bkg2.png'; diff --git a/src/components/linkCarousel/index.tsx b/src/components/linkCarousel/index.tsx index c4af70be..8eecbcd3 100644 --- a/src/components/linkCarousel/index.tsx +++ b/src/components/linkCarousel/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Carousel } from 'antd'; +import Carousel from 'antd/es/carousel'; import styled from 'styled-components'; import { LIGHT_GREEN } from '../../utils/colors'; import LinkCard, { LinkCardProps } from '../linkCard'; diff --git a/src/components/mapComponents/logic/event.ts b/src/components/mapComponents/logic/event.ts index 10deafac..6763feb0 100644 --- a/src/components/mapComponents/logic/event.ts +++ b/src/components/mapComponents/logic/event.ts @@ -9,7 +9,7 @@ import { setSitesStyle, } from './style'; import { BasicTreeInfo } from '../../treePopup'; -import { CheckboxValueType } from 'antd/es/checkbox/Group'; +import type { CheckboxValueType } from 'antd/es/checkbox/Group'; import { parseLatLng } from '../../../utils/stringFormat'; import { MapTypes, SetStateType } from '../../../context/types'; diff --git a/src/components/mapComponents/logic/init.ts b/src/components/mapComponents/logic/init.ts index 0a83a061..991474e0 100644 --- a/src/components/mapComponents/logic/init.ts +++ b/src/components/mapComponents/logic/init.ts @@ -20,8 +20,8 @@ import { getImageSize, } from './event'; import { BasicTreeInfo } from '../../treePopup'; -import { message } from 'antd'; -import { CheckboxValueType } from 'antd/es/checkbox/Group'; +import message from 'antd/es/message'; +import type { CheckboxValueType } from 'antd/es/checkbox/Group'; import { InitMapData } from '../ducks/types'; import { ALL_SITES_VISIBLE_COMBINED } from '../constants'; import { MapTypes, SetStateType } from '../../../context/types'; diff --git a/src/components/mapComponents/logic/style.ts b/src/components/mapComponents/logic/style.ts index a2a0c686..59c4ff30 100644 --- a/src/components/mapComponents/logic/style.ts +++ b/src/components/mapComponents/logic/style.ts @@ -18,7 +18,7 @@ import satelliteStandardIcon from '../../../assets/images/siteIcons/satelliteSta import satelliteYoungIcon from '../../../assets/images/siteIcons/satelliteYoungIcon.svg'; import { shortHand } from '../../../utils/stringFormat'; import { SHORT_HAND_NAMES } from '../../../assets/content'; -import { CheckboxValueType } from 'antd/es/checkbox/Group'; +import type { CheckboxValueType } from 'antd/es/checkbox/Group'; import { getImageSize } from './event'; import { MapTypes } from '../../../context/types'; diff --git a/src/components/mapComponents/mapDisplays/blocksMapDisplay/index.tsx b/src/components/mapComponents/mapDisplays/blocksMapDisplay/index.tsx index 6dbd493e..7860e2a2 100644 --- a/src/components/mapComponents/mapDisplays/blocksMapDisplay/index.tsx +++ b/src/components/mapComponents/mapDisplays/blocksMapDisplay/index.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { Alert, Layout, Spin } from 'antd'; +import Alert from 'antd/es/alert'; +import Layout from 'antd/es/layout'; +import Spin from 'antd/es/spin'; import styled from 'styled-components'; import { asyncRequestIsComplete, diff --git a/src/components/mapComponents/mapDisplays/selectorMapDisplay/index.tsx b/src/components/mapComponents/mapDisplays/selectorMapDisplay/index.tsx index cb10f4a7..9bfd3015 100644 --- a/src/components/mapComponents/mapDisplays/selectorMapDisplay/index.tsx +++ b/src/components/mapComponents/mapDisplays/selectorMapDisplay/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Alert, Spin } from 'antd'; +import Alert from 'antd/es/alert'; +import Spin from 'antd/es/spin'; import styled from 'styled-components'; import { asyncRequestIsComplete, diff --git a/src/components/mapComponents/mapDisplays/treeMapDisplay/index.tsx b/src/components/mapComponents/mapDisplays/treeMapDisplay/index.tsx index 3371afe2..1d4f4d7c 100644 --- a/src/components/mapComponents/mapDisplays/treeMapDisplay/index.tsx +++ b/src/components/mapComponents/mapDisplays/treeMapDisplay/index.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { Alert, Layout, Spin } from 'antd'; +import Alert from 'antd/es/alert'; +import Layout from 'antd/es/layout'; +import Spin from 'antd/es/spin'; import styled from 'styled-components'; import { asyncRequestIsComplete, diff --git a/src/components/mapComponents/mapLegend/index.tsx b/src/components/mapComponents/mapLegend/index.tsx index 64412c45..cb6b374a 100644 --- a/src/components/mapComponents/mapLegend/index.tsx +++ b/src/components/mapComponents/mapLegend/index.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { Button, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Typography from 'antd/es/typography'; import { ADOPTED_TREE_ICON_DESCRIPTION, CLOSED_BLOCK_DESCRIPTION, diff --git a/src/components/mapComponents/mapPageComponents/mapPage/index.tsx b/src/components/mapComponents/mapPageComponents/mapPage/index.tsx index 110139c1..114cc083 100644 --- a/src/components/mapComponents/mapPageComponents/mapPage/index.tsx +++ b/src/components/mapComponents/mapPageComponents/mapPage/index.tsx @@ -1,7 +1,7 @@ import React, { PropsWithChildren } from 'react'; import MapSidebar from '../mapSidebar'; import PageLayout from '../../../pageLayout'; -import { Layout } from 'antd'; +import Layout from 'antd/es/layout'; import { MainContent } from '../../../themedComponents'; import { MapViews } from '../../ducks/types'; import MapLegend from '../../mapLegend'; diff --git a/src/components/mapComponents/mapPageComponents/mapSidebar/index.tsx b/src/components/mapComponents/mapPageComponents/mapSidebar/index.tsx index 57899687..05c9c4f8 100644 --- a/src/components/mapComponents/mapPageComponents/mapSidebar/index.tsx +++ b/src/components/mapComponents/mapPageComponents/mapSidebar/index.tsx @@ -1,5 +1,5 @@ import React, { PropsWithChildren } from 'react'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import styled from 'styled-components'; type MapSidebarProps = { diff --git a/src/components/mapComponents/mapPageComponents/mobileLandingBar/index.tsx b/src/components/mapComponents/mapPageComponents/mobileLandingBar/index.tsx index 7292d819..30ff5c6b 100644 --- a/src/components/mapComponents/mapPageComponents/mobileLandingBar/index.tsx +++ b/src/components/mapComponents/mapPageComponents/mobileLandingBar/index.tsx @@ -1,7 +1,7 @@ import React, { PropsWithChildren } from 'react'; import { Routes } from '../../../../App'; import styled from 'styled-components'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import { LIGHT_GREEN, LIGHT_GREY, diff --git a/src/components/mapComponents/mapPageComponents/siteLegend/index.tsx b/src/components/mapComponents/mapPageComponents/siteLegend/index.tsx index 48711092..5c42b14a 100644 --- a/src/components/mapComponents/mapPageComponents/siteLegend/index.tsx +++ b/src/components/mapComponents/mapPageComponents/siteLegend/index.tsx @@ -1,7 +1,13 @@ import React, { useState } from 'react'; import { ReactNode } from 'react'; import styled from 'styled-components'; -import { Button, Checkbox, CheckboxOptionType, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Checkbox from 'antd/es/checkbox'; +import type { + CheckboxOptionType, + CheckboxValueType, +} from 'antd/es/checkbox/Group'; +import Typography from 'antd/es/typography'; import { WHITE, LIGHT_GREY, @@ -11,7 +17,6 @@ import { } from '../../../../utils/colors'; import { MapViews, SiteOption } from '../../ducks/types'; import { FullWidthSpace, InlineImage, Flex } from '../../../themedComponents'; -import { CheckboxValueType } from 'antd/es/checkbox/Group'; import SlideDown from '../../../slideDown'; import MapLegend from '../../mapLegend'; import { LinkButton } from '../../../linkButton'; diff --git a/src/components/mapComponents/maps/mapWithPopup/index.tsx b/src/components/mapComponents/maps/mapWithPopup/index.tsx index d31d3821..06edb0a3 100644 --- a/src/components/mapComponents/maps/mapWithPopup/index.tsx +++ b/src/components/mapComponents/maps/mapWithPopup/index.tsx @@ -5,7 +5,8 @@ import React, { useCallback, PropsWithChildren, } from 'react'; -import { Input, message } from 'antd'; +import Input from 'antd/es/input'; +import message from 'antd/es/message'; import { MapViews, ReturnMapData } from '../../ducks/types'; import { MAP_BOUNDS, LOADER, STREET_ZOOM } from '../../constants'; import { addHandleSearch } from '../../logic/event'; diff --git a/src/components/mapComponents/maps/treeMap/index.tsx b/src/components/mapComponents/maps/treeMap/index.tsx index 4f9655a9..ebccf784 100644 --- a/src/components/mapComponents/maps/treeMap/index.tsx +++ b/src/components/mapComponents/maps/treeMap/index.tsx @@ -16,7 +16,7 @@ import { } from '../../constants'; import { addHandleZoomChange } from '../../logic/event'; import { initSiteView } from '../../logic/init'; -import { CheckboxValueType } from 'antd/es/checkbox/Group'; +import type { CheckboxValueType } from 'antd/es/checkbox/Group'; import { setSitesStyle } from '../../logic/style'; import SiteLegend from '../../mapPageComponents/siteLegend'; import { MapStateProps, Routes } from '../../../../App'; diff --git a/src/components/mobileComponents/mobileFooter/index.tsx b/src/components/mobileComponents/mobileFooter/index.tsx index 8798ad7b..8ad8bb68 100644 --- a/src/components/mobileComponents/mobileFooter/index.tsx +++ b/src/components/mobileComponents/mobileFooter/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'styled-components'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import { BACKGROUND_GREY, TEXT_GREY, MID_GREEN } from '../../../utils/colors'; import Logo from '../../../assets/images/nav-bar-icon.png'; diff --git a/src/components/mobileComponents/mobileInfoCard/index.tsx b/src/components/mobileComponents/mobileInfoCard/index.tsx index 02db70c7..556d2037 100644 --- a/src/components/mobileComponents/mobileInfoCard/index.tsx +++ b/src/components/mobileComponents/mobileInfoCard/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Card, Typography } from 'antd'; +import Card from 'antd/es/card'; +import Typography from 'antd/es/typography'; import styled from 'styled-components'; import { MID_GREEN, TEXT_GREY } from '../../../utils/colors'; diff --git a/src/components/navBar/mobileNavBar/index.tsx b/src/components/navBar/mobileNavBar/index.tsx index b73aa04a..18dd62c7 100644 --- a/src/components/navBar/mobileNavBar/index.tsx +++ b/src/components/navBar/mobileNavBar/index.tsx @@ -2,9 +2,10 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { Routes } from '../../../App'; import styled from 'styled-components'; -import { PageHeader, Dropdown } from 'antd'; -import { PageHeaderProps } from 'antd/es/page-header'; -import { MenuOutlined } from '@ant-design/icons'; +import PageHeader from 'antd/es/page-header'; +import Dropdown from 'antd/es/dropdown'; +import type { PageHeaderProps } from 'antd/es/page-header'; +import MenuOutlined from '@ant-design/icons/MenuOutlined'; import { MID_GREEN, BACKGROUND_GREY, LIGHT_GREEN } from '../../../utils/colors'; import Logo from '../../../assets/images/nav-bar-icon.png'; import NavMenu from '../navMenu'; diff --git a/src/components/navBar/navExtra/index.tsx b/src/components/navBar/navExtra/index.tsx index 3ec96ebc..db22724b 100644 --- a/src/components/navBar/navExtra/index.tsx +++ b/src/components/navBar/navExtra/index.tsx @@ -1,8 +1,10 @@ import React from 'react'; import { Routes } from '../../../App'; import styled from 'styled-components'; -import { Avatar, Dropdown, Typography } from 'antd'; -import { UserOutlined } from '@ant-design/icons'; +import Avatar from 'antd/es/avatar'; +import Dropdown from 'antd/es/dropdown'; +import Typography from 'antd/es/typography'; +import UserOutlined from '@ant-design/icons/UserOutlined'; import { BLACK, DARK_GREEN, LIGHT_GREEN, WHITE } from '../../../utils/colors'; import NavMenu from '../navMenu'; import { Location } from 'history'; diff --git a/src/components/navBar/navMenu/index.tsx b/src/components/navBar/navMenu/index.tsx index 00686aea..3b8712d4 100644 --- a/src/components/navBar/navMenu/index.tsx +++ b/src/components/navBar/navMenu/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Routes } from '../../../App'; import styled from 'styled-components'; -import { Menu } from 'antd'; +import Menu from 'antd/es/menu'; import { BLACK, LIGHT_GREEN, LIGHT_GREY } from '../../../utils/colors'; import { MenuLinkButton } from '../../themedComponents'; diff --git a/src/components/pageLayout/index.tsx b/src/components/pageLayout/index.tsx index a5735488..48c03750 100644 --- a/src/components/pageLayout/index.tsx +++ b/src/components/pageLayout/index.tsx @@ -1,5 +1,5 @@ import React, { PropsWithChildren } from 'react'; -import { Layout } from 'antd'; +import Layout from 'antd/es/layout'; const pageLayoutHeight = 'calc(100vh - 83px)'; diff --git a/src/components/reservationModal/index.tsx b/src/components/reservationModal/index.tsx index 5d7fa2e2..8e1b445a 100644 --- a/src/components/reservationModal/index.tsx +++ b/src/components/reservationModal/index.tsx @@ -1,7 +1,10 @@ import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; import { WHITE, BLACK } from '../../utils/colors'; -import { Spin, Alert, Select, Modal } from 'antd'; +import Spin from 'antd/es/spin'; +import Alert from 'antd/es/alert'; +import Select from 'antd/es/select'; +import Modal from 'antd/es/modal'; import protectedApiClient from '../../api/protectedApiClient'; import { AsyncRequest, diff --git a/src/components/shareButton/index.tsx b/src/components/shareButton/index.tsx index 96f1f968..322c6b6f 100644 --- a/src/components/shareButton/index.tsx +++ b/src/components/shareButton/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { Button } from 'antd'; -import { SizeType } from 'antd/es/config-provider/SizeContext'; +import Button from 'antd/es/button'; +import type { SizeType } from 'antd/es/config-provider/SizeContext'; import ShareMenu from '../shareMenu'; import ShareWhite from '../../assets/images/sharewhite-small.png'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/shareMenu/index.tsx b/src/components/shareMenu/index.tsx index 750cb2aa..7a9c0efc 100644 --- a/src/components/shareMenu/index.tsx +++ b/src/components/shareMenu/index.tsx @@ -1,6 +1,9 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { Input, Button, Typography, message } from 'antd'; +import Input from 'antd/es/input'; +import Button from 'antd/es/button'; +import Typography from 'antd/es/typography'; +import message from 'antd/es/message'; import TwitterIcon from '../../assets/images/twitter-icon.png'; import EmailIcon from '../../assets/images/email-icon.png'; import FBIcon from '../../assets/images/facebook-icon.png'; diff --git a/src/components/siteEntryTable/index.tsx b/src/components/siteEntryTable/index.tsx index 881d3122..5f381b09 100644 --- a/src/components/siteEntryTable/index.tsx +++ b/src/components/siteEntryTable/index.tsx @@ -4,8 +4,11 @@ import { SiteEntryField, SiteEntryFields, } from '../../containers/treePage/ducks/types'; -import { Form, Modal, Table, message } from 'antd'; -import { EditOutlined } from '@ant-design/icons'; +import Form from 'antd/es/form'; +import Modal from 'antd/es/modal'; +import Table from 'antd/es/table'; +import message from 'antd/es/message'; +import EditOutlined from '@ant-design/icons/EditOutlined'; import ProtectedClient from '../../api/protectedApiClient'; import { booleanToString, diff --git a/src/components/siteFeatures/index.tsx b/src/components/siteFeatures/index.tsx index d9795d5d..3bf83ff2 100644 --- a/src/components/siteFeatures/index.tsx +++ b/src/components/siteFeatures/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { Typography, FormInstance } from 'antd'; +import Typography from 'antd/es/typography'; +import type { FormInstance } from 'antd/es/form'; import styled from 'styled-components'; import { SiteProps } from '../../containers/treePage/ducks/types'; import EditSiteForm from '../../components/forms/editSiteForm'; diff --git a/src/components/slideDown/index.tsx b/src/components/slideDown/index.tsx index f1d49fa5..a44dd7d8 100644 --- a/src/components/slideDown/index.tsx +++ b/src/components/slideDown/index.tsx @@ -1,5 +1,6 @@ import React, { useState, useRef, PropsWithChildren } from 'react'; -import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; +import CaretUpOutlined from '@ant-design/icons/CaretUpOutlined'; +import CaretDownOutlined from '@ant-design/icons/CaretDownOutlined'; import styled from 'styled-components'; import { MID_GREEN, WHITE } from '../../utils/colors'; import { BREAKPOINT_TABLET } from '../windowDimensions'; diff --git a/src/components/tables/adoptionReportTable/index.tsx b/src/components/tables/adoptionReportTable/index.tsx index 522947e3..32131f32 100644 --- a/src/components/tables/adoptionReportTable/index.tsx +++ b/src/components/tables/adoptionReportTable/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { AdoptionReportEntry } from '../../../containers/reports/ducks/types'; -import { Table } from 'antd'; +import Table from 'antd/es/table'; import { site } from '../../../constants'; import SiteLink from '../siteLink'; import { dateSorter, DESCEND_ORDER } from '../utils'; diff --git a/src/components/tables/siteLink/index.tsx b/src/components/tables/siteLink/index.tsx index 42a86987..1a8220c0 100644 --- a/src/components/tables/siteLink/index.tsx +++ b/src/components/tables/siteLink/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { ParameterizedRouteBases } from '../../../App'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; interface SiteLinkProps { readonly siteId: number; diff --git a/src/components/tables/stewardshipReportTable/index.tsx b/src/components/tables/stewardshipReportTable/index.tsx index 5dd1f312..14599293 100644 --- a/src/components/tables/stewardshipReportTable/index.tsx +++ b/src/components/tables/stewardshipReportTable/index.tsx @@ -4,7 +4,7 @@ import { AdoptionReportEntry, StewardshipReportTableEntry, } from '../../../containers/reports/ducks/types'; -import { Table } from 'antd'; +import Table from 'antd/es/table'; import { site } from '../../../constants'; import SiteLink from '../siteLink'; import { dateSorter, DESCEND_ORDER } from '../utils'; diff --git a/src/components/tables/tags/index.tsx b/src/components/tables/tags/index.tsx index c76d17ca..289970ea 100644 --- a/src/components/tables/tags/index.tsx +++ b/src/components/tables/tags/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Tag } from 'antd'; +import Tag from 'antd/es/tag'; interface TagsProps { readonly tagTexts: string[]; diff --git a/src/components/teamMember/index.tsx b/src/components/teamMember/index.tsx index bc717ad3..9ae0f34b 100644 --- a/src/components/teamMember/index.tsx +++ b/src/components/teamMember/index.tsx @@ -1,7 +1,8 @@ import React from 'react'; import styled from 'styled-components'; -import { List, Typography } from 'antd'; -import { CrownOutlined } from '@ant-design/icons'; +import List from 'antd/es/list'; +import Typography from 'antd/es/typography'; +import CrownOutlined from '@ant-design/icons/CrownOutlined'; import { BLACK, LIGHT_GREEN } from '../../utils/colors'; import { TeamRole } from '../../containers/teamPage/ducks/types'; diff --git a/src/components/themedComponents/index.tsx b/src/components/themedComponents/index.tsx index 76e9a553..b1e55bd0 100644 --- a/src/components/themedComponents/index.tsx +++ b/src/components/themedComponents/index.tsx @@ -1,15 +1,13 @@ import styled from 'styled-components'; -import { - Button, - Form, - Space, - List, - Image, - InputNumber, - Typography, -} from 'antd'; -import { FormItemProps } from 'antd/es/form'; -import { CloseOutlined } from '@ant-design/icons'; +import Button from 'antd/es/button'; +import Form from 'antd/es/form'; +import type { FormItemProps } from 'antd/es/form/FormItem'; +import Space from 'antd/es/space'; +import List from 'antd/es/list'; +import Image from 'antd/es/image'; +import InputNumber from 'antd/es/input-number'; +import Typography from 'antd/es/typography'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; import { BLACK, LIGHT_GREY, diff --git a/src/components/titleStack/index.tsx b/src/components/titleStack/index.tsx index ff7fbcee..be348763 100644 --- a/src/components/titleStack/index.tsx +++ b/src/components/titleStack/index.tsx @@ -1,6 +1,6 @@ import React, { PropsWithChildren } from 'react'; import styled from 'styled-components'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import { BlockProps, Block } from '../themedComponents'; const StackTitle = styled(Typography.Text)` diff --git a/src/components/treeActivity/index.tsx b/src/components/treeActivity/index.tsx index 47caea63..a14010df 100644 --- a/src/components/treeActivity/index.tsx +++ b/src/components/treeActivity/index.tsx @@ -1,5 +1,8 @@ import React, { useState } from 'react'; -import { Typography, List, Select, Pagination } from 'antd'; +import Typography from 'antd/es/typography'; +import List from 'antd/es/list'; +import Select from 'antd/es/select'; +import Pagination from 'antd/es/pagination'; import { MonthYearOption, TreeCare, diff --git a/src/components/treeCard/index.tsx b/src/components/treeCard/index.tsx index 8959a3fe..3386ec9f 100644 --- a/src/components/treeCard/index.tsx +++ b/src/components/treeCard/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { ParameterizedRouteBases, Routes } from '../../App'; -import { Card, Typography } from 'antd'; +import Card from 'antd/es/card'; +import Typography from 'antd/es/typography'; import styled from 'styled-components'; import { CardInfo, GreenLinkButton, MarginLeftSpan } from '../themedComponents'; import { MID_GREEN, TEXT_GREY, LIGHT_GREY } from '../../utils/colors'; diff --git a/src/components/treeInfo/index.tsx b/src/components/treeInfo/index.tsx index 413a34e5..ed7fb298 100644 --- a/src/components/treeInfo/index.tsx +++ b/src/components/treeInfo/index.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { useHistory, useLocation } from 'react-router-dom'; -import { Typography, Button, FormInstance } from 'antd'; +import Typography from 'antd/es/typography'; +import Button from 'antd/es/button'; +import type { FormInstance } from 'antd/es/form'; import { RedirectStateProps, Routes } from '../../App'; import StewardshipForm from '../forms/stewardshipForm'; import styled from 'styled-components'; diff --git a/src/components/treePageHeader/index.tsx b/src/components/treePageHeader/index.tsx index e2263904..4864e3b6 100644 --- a/src/components/treePageHeader/index.tsx +++ b/src/components/treePageHeader/index.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; -import { FormInstance } from 'antd'; -import { escape, unescape } from 'lodash'; +import type { FormInstance } from 'antd/es/form'; +import escape from 'lodash/escape'; +import unescape from 'lodash/unescape'; import { NameSiteEntryRequest } from '../forms/ducks/types'; import EditTreeNameForm from '../forms/editTreeNameForm'; import { @@ -9,7 +10,7 @@ import { StyledSubtitleProps, } from '../themedComponents'; import styled from 'styled-components'; -import { EditOutlined } from '@ant-design/icons'; +import EditOutlined from '@ant-design/icons/EditOutlined'; import { isEmptyString } from '../../utils/isCheck'; import { useTranslation } from 'react-i18next'; import { site } from '../../constants'; diff --git a/src/components/treePopup/index.tsx b/src/components/treePopup/index.tsx index 674fac82..84bda0c7 100644 --- a/src/components/treePopup/index.tsx +++ b/src/components/treePopup/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Typography } from 'antd'; -import { CloseOutlined } from '@ant-design/icons'; +import Typography from 'antd/es/typography'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; import { ParameterizedRouteBases, Routes } from '../../App'; import { GreenLinkButton, MarginLeftSpan } from '../themedComponents'; import { diff --git a/src/components/treeSidebar/index.tsx b/src/components/treeSidebar/index.tsx index 1705598c..b48119a9 100644 --- a/src/components/treeSidebar/index.tsx +++ b/src/components/treeSidebar/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { List } from 'antd'; +import List from 'antd/es/list'; import { StyledListItem } from '../themedComponents'; import TreeCard from '../treeCard'; import { SiteFeaturePropertiesResponse } from '../mapComponents/ducks/types'; diff --git a/src/containers/addSites/index.tsx b/src/containers/addSites/index.tsx index 9857032d..186e3662 100644 --- a/src/containers/addSites/index.tsx +++ b/src/containers/addSites/index.tsx @@ -15,7 +15,11 @@ import { } from '../../components/forms/ducks/types'; import { getMapGeoData } from '../../components/mapComponents/ducks/thunks'; import { MapGeoDataReducerState } from '../../components/mapComponents/ducks/types'; -import { Typography, Row, Form, Divider, message } from 'antd'; +import Typography from 'antd/es/typography'; +import Row from 'antd/es/row'; +import Form from 'antd/es/form'; +import Divider from 'antd/es/divider'; +import message from 'antd/es/message'; import { MapContainer, Block, @@ -26,7 +30,7 @@ import { import useWindowDimensions, { WindowTypes, } from '../../components/windowDimensions'; -import { round } from 'lodash'; +import round from 'lodash/round'; import { LAT_LNG_PRECISION } from '../../components/forms/constants'; import { MapTypes } from '../../context/types'; import { MapTypeContext } from '../../context/mapTypeContext'; diff --git a/src/containers/adminDashboard/index.tsx b/src/containers/adminDashboard/index.tsx index fb75add0..2fc1142f 100644 --- a/src/containers/adminDashboard/index.tsx +++ b/src/containers/adminDashboard/index.tsx @@ -1,6 +1,11 @@ import React, { PropsWithChildren, useState } from 'react'; import { Helmet } from 'react-helmet'; -import { Form, message, Typography, Divider, Modal, Button } from 'antd'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Typography from 'antd/es/typography'; +import Divider from 'antd/es/divider'; +import Modal from 'antd/es/modal'; +import Button from 'antd/es/button'; import PageHeader from '../../components/pageHeader'; import PageLayout from '../../components/pageLayout'; import styled from 'styled-components'; @@ -20,14 +25,12 @@ import ProtectedApiClient from '../../api/protectedApiClient'; import { AppError } from '../../auth/axios'; import { getErrorMessage, n } from '../../utils/stringFormat'; import { SubmitButton } from '../../components/themedComponents'; -import { - BarChartOutlined, - FileAddOutlined, - MailOutlined, - PlusOutlined, - RocketFilled, - SettingFilled, -} from '@ant-design/icons'; +import BarChartOutlined from '@ant-design/icons/BarChartOutlined'; +import FileAddOutlined from '@ant-design/icons/FileAddOutlined'; +import MailOutlined from '@ant-design/icons/MailOutlined'; +import PlusOutlined from '@ant-design/icons/PlusOutlined'; +import RocketFilled from '@ant-design/icons/RocketFilled'; +import SettingFilled from '@ant-design/icons/SettingFilled'; import Image1 from '../../assets/images/bkg1.png'; import Image2 from '../../assets/images/bkg2.png'; import Image4 from '../../assets/images/bkg4.png'; diff --git a/src/containers/availableTeams/index.tsx b/src/containers/availableTeams/index.tsx index 2828e221..70145f6f 100644 --- a/src/containers/availableTeams/index.tsx +++ b/src/containers/availableTeams/index.tsx @@ -2,13 +2,14 @@ import React, { useState } from 'react'; import LeaderboardSpace from '../../components/leaderboard/leaderboardSpace'; import { TabItem } from '../../components/leaderboard/types'; import { Routes } from '../../App'; -import { Pagination, Divider } from 'antd'; +import Pagination from 'antd/es/pagination'; +import Divider from 'antd/es/divider'; import PageHeader from '../../components/pageHeader'; import PageLayout from '../../components/pageLayout'; import { ReturnButton } from '../../components/themedComponents'; import styled from 'styled-components'; import { LinkButton } from '../../components/linkButton'; -import { ArrowRightOutlined } from '@ant-design/icons'; +import ArrowRightOutlined from '@ant-design/icons/ArrowRightOutlined'; import { TEAMS_HEADER, TEAMS_TITLE } from '../../assets/content'; const ContentContainer = styled.div` diff --git a/src/containers/email/index.tsx b/src/containers/email/index.tsx index e3be4f03..8f4d3d2f 100644 --- a/src/containers/email/index.tsx +++ b/src/containers/email/index.tsx @@ -1,17 +1,15 @@ import React, { useState } from 'react'; import { Helmet } from 'react-helmet'; import styled from 'styled-components'; -import { - Select, - Typography, - Row, - Col, - Button, - Spin, - Alert, - Divider, - SelectProps, -} from 'antd'; +import Select from 'antd/es/select'; +import type { SelectProps } from 'antd/es/select'; +import Typography from 'antd/es/typography'; +import Row from 'antd/es/row'; +import Col from 'antd/es/col'; +import Button from 'antd/es/button'; +import Spin from 'antd/es/spin'; +import Alert from 'antd/es/alert'; +import Divider from 'antd/es/divider'; import { Routes } from '../../App'; import PageLayout from '../../components/pageLayout'; import { ReturnButton } from '../../components/themedComponents'; diff --git a/src/containers/faq/index.tsx b/src/containers/faq/index.tsx index 1b22d291..03325c64 100644 --- a/src/containers/faq/index.tsx +++ b/src/containers/faq/index.tsx @@ -3,7 +3,8 @@ import { Helmet } from 'react-helmet'; import PageLayout from '../../components/pageLayout'; import PageHeader from '../../components/pageHeader'; import { PaddedPageContainer } from '../../components/themedComponents'; -import { Collapse, Typography } from 'antd'; +import Collapse from 'antd/es/collapse'; +import Typography from 'antd/es/typography'; import OrderedList from '../../components/orderedList'; import { site } from '../../constants'; import styled from 'styled-components'; diff --git a/src/containers/forgotPassword/index.tsx b/src/containers/forgotPassword/index.tsx index 08058a85..9f53176c 100644 --- a/src/containers/forgotPassword/index.tsx +++ b/src/containers/forgotPassword/index.tsx @@ -4,7 +4,10 @@ import { useTranslation } from 'react-i18next'; import authClient from '../../auth/authClient'; import { ForgotPasswordRequest } from '../../auth/ducks/types'; import useWindowDimensions from '../../components/windowDimensions'; -import { Button, Form, Input, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; +import Typography from 'antd/es/typography'; import { site } from '../../constants'; import PageHeader from '../../components/pageHeader'; import { ContentContainer } from '../../components/themedComponents'; diff --git a/src/containers/forgotPasswordReset/index.tsx b/src/containers/forgotPasswordReset/index.tsx index b3e7d717..de531544 100644 --- a/src/containers/forgotPasswordReset/index.tsx +++ b/src/containers/forgotPasswordReset/index.tsx @@ -4,7 +4,10 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import authClient from '../../auth/authClient'; import useWindowDimensions from '../../components/windowDimensions'; -import { Button, Form, Input, message } from 'antd'; +import Button from 'antd/es/button'; +import Form from 'antd/es/form'; +import Input from 'antd/es/input'; +import message from 'antd/es/message'; import { site } from '../../constants'; import PageHeader from '../../components/pageHeader'; import { ContentContainer } from '../../components/themedComponents'; diff --git a/src/containers/home/index.tsx b/src/containers/home/index.tsx index 11c2d308..a4ece74e 100644 --- a/src/containers/home/index.tsx +++ b/src/containers/home/index.tsx @@ -2,7 +2,8 @@ import React from 'react'; import { Helmet } from 'react-helmet'; import styled from 'styled-components'; import { DARK_GREY, MID_GREEN } from '../../utils/colors'; -import { List, Typography } from 'antd'; +import List from 'antd/es/list'; +import Typography from 'antd/es/typography'; import PageHeader from '../../components/pageHeader'; import PageLayout from '../../components/pageLayout'; import LinkCard, { diff --git a/src/containers/landing/index.tsx b/src/containers/landing/index.tsx index e4eddb41..aed9baa0 100644 --- a/src/containers/landing/index.tsx +++ b/src/containers/landing/index.tsx @@ -18,7 +18,8 @@ import { import { Routes } from '../../App'; import { site } from '../../constants'; import TreeMapDisplay from '../../components/mapComponents/mapDisplays/treeMapDisplay'; -import { Modal, Typography } from 'antd'; +import Modal from 'antd/es/modal'; +import Typography from 'antd/es/typography'; import { DARK_GREEN } from '../../utils/colors'; import { SFTT_PARTNER_LOGOS } from '../../assets/links'; import LandingContent from '../../components/landingContent'; diff --git a/src/containers/login/index.tsx b/src/containers/login/index.tsx index 83bb8856..b9329d9f 100644 --- a/src/containers/login/index.tsx +++ b/src/containers/login/index.tsx @@ -9,7 +9,9 @@ import { LoginRequest } from '../../auth/ducks/types'; import { isLoggedIn } from '../../auth/ducks/selectors'; import { RedirectStateProps, Routes } from '../../App'; import { site } from '../../constants'; -import { Form, message, Typography } from 'antd'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Typography from 'antd/es/typography'; import styled from 'styled-components'; import { BLACK, DARK_TEXT_GREY, WHITE } from '../../utils/colors'; import { diff --git a/src/containers/myTrees/index.tsx b/src/containers/myTrees/index.tsx index b51d6f62..b55d3deb 100644 --- a/src/containers/myTrees/index.tsx +++ b/src/containers/myTrees/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import MapPage from '../../components/mapComponents/mapPageComponents/mapPage/index'; import TreeSidebar from '../../components/treeSidebar/index'; -import { Spin } from 'antd'; +import Spin from 'antd/es/spin'; import styled from 'styled-components'; import { Helmet } from 'react-helmet'; import useWindowDimensions, { diff --git a/src/containers/notFound/index.tsx b/src/containers/notFound/index.tsx index bcf2448a..cbe3e131 100644 --- a/src/containers/notFound/index.tsx +++ b/src/containers/notFound/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { Routes } from '../../App'; import { site } from '../../constants'; import { ContentContainer } from '../../components/themedComponents'; -import { Typography } from 'antd'; +import Typography from 'antd/es/typography'; import { n } from '../../utils/stringFormat'; const NotFound: React.FC = () => { diff --git a/src/containers/reports/index.tsx b/src/containers/reports/index.tsx index 3f0f352b..33d234d6 100644 --- a/src/containers/reports/index.tsx +++ b/src/containers/reports/index.tsx @@ -2,7 +2,11 @@ import React, { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import StewardshipReportTable from '../../components/tables/stewardshipReportTable'; import ProtectedApiClient from '../../api/protectedApiClient'; -import { Form, message, Skeleton, Tabs, Typography } from 'antd'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Skeleton from 'antd/es/skeleton'; +import Tabs from 'antd/es/tabs'; +import Typography from 'antd/es/typography'; import { site } from '../../constants'; import { AdoptionReport, StewardshipReport } from './ducks/types'; import { Helmet } from 'react-helmet'; diff --git a/src/containers/settings/index.tsx b/src/containers/settings/index.tsx index 78d9e9f1..1484a9ab 100644 --- a/src/containers/settings/index.tsx +++ b/src/containers/settings/index.tsx @@ -1,6 +1,10 @@ import React, { useState } from 'react'; import { useSelector } from 'react-redux'; -import { Col, Row, Button, Typography, Modal } from 'antd'; +import Col from 'antd/es/col'; +import Row from 'antd/es/row'; +import Button from 'antd/es/button'; +import Typography from 'antd/es/typography'; +import Modal from 'antd/es/modal'; import PageHeader from '../../components/pageHeader'; import PageLayout from '../../components/pageLayout'; import styled from 'styled-components'; diff --git a/src/containers/signup/index.tsx b/src/containers/signup/index.tsx index ec6aaee7..013f4598 100644 --- a/src/containers/signup/index.tsx +++ b/src/containers/signup/index.tsx @@ -1,7 +1,12 @@ import React from 'react'; import { Redirect, useLocation } from 'react-router'; import { Link } from 'react-router-dom'; -import { Button, Col, Form, message, Row, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Col from 'antd/es/col'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Row from 'antd/es/row'; +import Typography from 'antd/es/typography'; import { Helmet } from 'react-helmet'; import GreetingContainer from '../../components/greetingContainer'; import { signup } from '../../auth/ducks/thunks'; diff --git a/src/containers/sitePage/index.tsx b/src/containers/sitePage/index.tsx index 4d49e548..ed728268 100644 --- a/src/containers/sitePage/index.tsx +++ b/src/containers/sitePage/index.tsx @@ -1,7 +1,10 @@ import React, { useCallback, useEffect, useState } from 'react'; import { MapGeoDataReducerState } from '../../components/mapComponents/ducks/types'; import PageLayout from '../../components/pageLayout'; -import { Form, message, Row, Typography } from 'antd'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Row from 'antd/es/row'; +import Typography from 'antd/es/typography'; import styled from 'styled-components'; import { DARK_GREEN } from '../../utils/colors'; import PageHeader from '../../components/pageHeader'; @@ -25,7 +28,7 @@ import { import SelectorMapDisplay from '../../components/mapComponents/mapDisplays/selectorMapDisplay'; import { getMapGeoData } from '../../components/mapComponents/ducks/thunks'; import { Block, Flex, MapContainer } from '../../components/themedComponents'; -import { round } from 'lodash'; +import round from 'lodash/round'; import { LAT_LNG_PRECISION } from '../../components/forms/constants'; import { MapTypes } from '../../context/types'; import { MapTypeContext } from '../../context/mapTypeContext'; diff --git a/src/containers/teamPage/index.tsx b/src/containers/teamPage/index.tsx index 1a8bd1a5..29110270 100644 --- a/src/containers/teamPage/index.tsx +++ b/src/containers/teamPage/index.tsx @@ -1,6 +1,9 @@ import React from 'react'; import styled from 'styled-components'; -import { Button, Collapse, List, Typography } from 'antd'; +import Button from 'antd/es/button'; +import Collapse from 'antd/es/collapse'; +import List from 'antd/es/list'; +import Typography from 'antd/es/typography'; import { Routes } from '../../App'; import { GoalProps, MemberProps, TeamProps, TeamRole } from './ducks/types'; import GoalInfo from '../../components/goalInfo'; diff --git a/src/containers/treePage/index.tsx b/src/containers/treePage/index.tsx index bb141946..2f2ba55d 100644 --- a/src/containers/treePage/index.tsx +++ b/src/containers/treePage/index.tsx @@ -2,7 +2,12 @@ import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { useLocation } from 'react-router-dom'; import PageLayout from '../../components/pageLayout'; -import { Col, Form, message, Row, Typography, Alert } from 'antd'; +import Col from 'antd/es/col'; +import Form from 'antd/es/form'; +import message from 'antd/es/message'; +import Row from 'antd/es/row'; +import Typography from 'antd/es/typography'; +import Alert from 'antd/es/alert'; import { RedirectStateProps, Routes } from '../../App'; import { Helmet } from 'react-helmet'; import { UserAuthenticationReducerState } from '../../auth/ducks/types'; diff --git a/src/utils/formRules.tsx b/src/utils/formRules.tsx index 0b6560a4..9db8f39d 100644 --- a/src/utils/formRules.tsx +++ b/src/utils/formRules.tsx @@ -1,5 +1,5 @@ import i18n from '../i18n/i18n'; -import { FormInstance, Rule } from 'antd/es/form'; +import type { FormInstance, Rule } from 'antd/es/form'; export const enterEmailRules: Rule[] = [ { diff --git a/src/utils/treeFunctions.tsx b/src/utils/treeFunctions.tsx index cedf4218..0688fea1 100644 --- a/src/utils/treeFunctions.tsx +++ b/src/utils/treeFunctions.tsx @@ -1,6 +1,6 @@ import { SiteProps, TreeCare } from '../containers/treePage/ducks/types'; import moment from 'moment'; -import { startCase } from 'lodash'; +import startCase from 'lodash/startCase'; export function treeCareToMoment(activity: TreeCare): moment.Moment { return moment( From bdde731f38a80f2433df85ed32d6311e127222c0 Mon Sep 17 00:00:00 2001 From: Kenny Jung Date: Tue, 12 Sep 2023 00:07:14 +0900 Subject: [PATCH 3/3] Move import and rename BundleAnalyzerPlugin --- craco.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/craco.config.js b/craco.config.js index ad696b9a..9f3af04a 100644 --- a/craco.config.js +++ b/craco.config.js @@ -1,5 +1,8 @@ const CracoAntDesignPlugin = require('craco-antd'); +const BundleAnalyzerPlugin = + require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + process.env.BROWSER = 'none'; const site = process.env.REACT_APP_TENANT || 'SFTT'; @@ -13,9 +16,6 @@ const themeOverride = } : {}; -const BundleAanlyzerPlugin = - require('webpack-bundle-analyzer').BundleAnalyzerPlugin; - module.exports = { plugins: [ { @@ -37,6 +37,6 @@ module.exports = { ], }, webpack: { - plugins: [new BundleAanlyzerPlugin({ analyzerMode: 'server' })], + plugins: [new BundleAnalyzerPlugin({ analyzerMode: 'server' })], }, };