From 7442aba93353f3e8f1e394f3a75b9a0791f46ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Comerci?= <45410089+ncomerci@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:02:25 -0300 Subject: [PATCH] refactor: Replace i18n from dcl-gatsby to react-intl (#1032) * refactor started * removed dcl-gatsby intl * small fixes * requested changes * WalletSelector & WrongNetwork Modals * removed dcl-gatsby intl * fix: gh action error * comments removed * replaced links --- .prettierignore | 3 +- README.md | 89 +- gatsby-browser.js | 6 +- gatsby-config.js | 15 - gatsby-node.js | 12 +- package-lock.json | 758 +++++++++++--- package.json | 7 +- src/components/ActionCard/ActionCard.tsx | 3 +- .../Banner/Delegation/DelegationBanner.tsx | 3 +- .../Subscription/SubscriptionBanner.tsx | 3 +- src/components/Category/CategoryBanner.tsx | 6 +- src/components/Category/CategoryList.tsx | 2 +- src/components/Category/CategoryOption.tsx | 4 +- src/components/Category/CategoryPill.tsx | 2 +- src/components/Charts/LineChart.tsx | 2 +- .../DistributionBar/DistributionBarPopup.tsx | 3 +- src/components/Common/Empty.css | 2 +- src/components/Common/Empty.tsx | 2 +- src/components/Common/Link.css | 19 + src/components/Common/Link.tsx | 41 + src/components/Common/LinkWithTitle.tsx | 3 +- .../Common/SnapshotRedirectButton.tsx | 2 +- src/components/Debug/HttpStatus.tsx | 2 +- .../DelegatedToAddressEmptyCard.tsx | 3 +- .../Delegation/DelegatedToUserEmptyCard.tsx | 3 +- src/components/Delegation/DelegatesTable.tsx | 2 +- .../Delegation/DelegatesTableRow.tsx | 2 +- src/components/Delegation/DelegationCards.tsx | 2 +- .../Delegation/DelegatorCardProfile.tsx | 6 +- .../Delegation/VotingPowerListModal.tsx | 3 +- src/components/Error/ErrorMessage.css | 4 +- src/components/Error/ErrorMessage.tsx | 4 +- src/components/Form/MarkdownNotice.tsx | 3 +- .../GrantRequest/AddBudgetBreakdownModal.tsx | 2 +- src/components/GrantRequest/AddModal.tsx | 3 +- .../GrantRequest/AddTeamMemberModal.tsx | 2 +- .../GrantRequest/BudgetBreakdownView.tsx | 3 +- src/components/GrantRequest/BudgetInput.tsx | 2 +- .../GrantRequest/CalculationHelper.tsx | 3 +- .../CategorySection/AcceleratorSection.tsx | 2 +- .../CategorySection/CoreUnitSection.tsx | 2 +- .../CategorySection/DocumentationSection.tsx | 2 +- .../CategorySection/InWorldContentSection.tsx | 2 +- .../CategorySection/PlatformSection.tsx | 2 +- .../SocialMediaContentSection.tsx | 2 +- .../CategorySection/SponsorshipSection.tsx | 2 +- src/components/GrantRequest/CheckboxField.css | 2 +- .../GrantRequestCategorySection.tsx | 3 +- .../GrantRequestDueDiligenceSection.tsx | 2 +- .../GrantRequestFinalConsentSection.tsx | 3 +- .../GrantRequestFundingSection.tsx | 2 +- .../GrantRequestGeneralInfoSection.tsx | 2 +- .../GrantRequest/GrantRequestSectionCard.tsx | 8 +- .../GrantRequest/GrantRequestTeamSection.tsx | 2 +- .../GrantRequest/MultipleChoiceField.tsx | 2 +- src/components/GrantRequest/PersonnelView.tsx | 2 +- src/components/Grants/CategoryItem.tsx | 2 +- src/components/Grants/CategorySelector.tsx | 2 +- .../Grants/Current/BudgetBanner.tsx | 3 +- .../Grants/Current/CurrentGrantsBanner.tsx | 2 +- .../Current/CurrentGrantsCategoryFilters.tsx | 2 +- .../Grants/Current/CurrentGrantsList.tsx | 4 +- .../Current/CurrentGrantsSortingMenu.tsx | 3 +- .../Grants/GrantBeneficiaryItem.tsx | 5 +- .../Grants/GrantCard/CliffNotice.tsx | 3 +- .../Grants/GrantCard/CliffProgress.tsx | 3 +- src/components/Grants/GrantCard/GrantCard.tsx | 2 +- .../Grants/GrantCard/GrantCardHeader.tsx | 4 +- .../Grants/GrantCard/ProgressBarTooltip.tsx | 3 +- .../Grants/GrantCard/VestingProgress.tsx | 2 +- src/components/Grants/GrantsPastItem.tsx | 5 +- src/components/Grants/RequestBanner.tsx | 5 +- src/components/Home/ActiveCommunityGrants.tsx | 2 +- .../Home/BottomBanner/BottomBanner.tsx | 3 +- src/components/Home/Charts.tsx | 2 +- src/components/Home/CommunityEngagement.tsx | 3 +- src/components/Home/DaoDelegates.tsx | 2 +- src/components/Home/MainBanner.tsx | 4 +- src/components/Home/MetricsCard.tsx | 3 +- src/components/Home/MetricsCards.tsx | 2 +- src/components/Home/OpenProposal.tsx | 4 +- src/components/Home/OpenProposals.tsx | 2 +- src/components/Home/TopVoters.tsx | 2 +- .../Layout/BurgerMenu/MobileNavigation.tsx | 7 +- src/components/Layout/ContentLayout.tsx | 3 +- src/components/Layout/Layout.tsx | 22 +- src/components/Layout/Navigation.tsx | 4 +- .../AddRemoveProposalModal.tsx | 2 +- .../DeleteProposalModal.tsx | 2 +- .../DeleteUpdateModal/DeleteUpdateModal.tsx | 2 +- .../Modal/EditUpdateModal/EditUpdateModal.tsx | 2 +- .../ExternalLinkWarningModal.tsx | 2 +- .../AccountsConnectModal.tsx | 2 +- .../IdentityConnectModal.tsx | 2 +- .../IdentityConnectModal/PostConnection.tsx | 2 +- .../NewsletterSubscriptionModal.tsx | 2 +- src/components/Modal/ProposalSuccessModal.tsx | 3 +- src/components/Modal/SuccessModal.tsx | 2 +- .../UpdateProposalStatusModal.tsx | 2 +- src/components/Modal/UpdateSuccessModal.tsx | 3 +- src/components/Modal/Votes/VoteListItem.tsx | 5 +- .../Modal/Votes/VoteRegisteredModal.tsx | 2 +- src/components/Modal/Votes/VotesList.tsx | 2 +- .../Votes/VotingModal/SnapshotRedirect.tsx | 2 +- .../Votes/VotingModal/VotingModalSurvey.tsx | 4 +- .../CandidateMatch.tsx | 2 +- .../VotedInitiative.tsx | 4 +- .../VotedInitiativeList.tsx | 3 +- .../VotingPowerDelegationDetail.tsx | 2 +- .../VotingPowerDelegationHandler.tsx | 2 +- .../VotingPowerDistribution.tsx | 2 +- .../VotingPowerDistributionLabels.tsx | 3 +- .../VotingPowerDistributionPopup.tsx | 2 +- .../VotingPowerDelegationCandidatesList.tsx | 2 +- src/components/Modal/WalletSelectorModal.tsx | 3 +- src/components/Modal/WrongNetworkModal.tsx | 3 +- src/components/Profile/ActivityBox.tsx | 2 +- src/components/Profile/CoAuthorPill.tsx | 3 +- src/components/Profile/CoAuthoringTab.tsx | 2 +- .../Profile/GrantBeneficiaryBox.tsx | 2 +- src/components/Profile/ProfileSettings.tsx | 2 +- .../Profile/ProposalCreatedItem.tsx | 4 +- .../Profile/ProposalsCreatedTab.tsx | 2 +- src/components/Profile/VotedProposalsBox.tsx | 2 +- src/components/Profile/VpDelegationBox.tsx | 2 +- src/components/Profile/VpDelegatorsBox.tsx | 2 +- src/components/Profile/WatchlistTab.tsx | 2 +- .../Proposal/CategoryAssessment.tsx | 3 +- .../Proposal/Comments/ProposalComment.tsx | 2 +- .../Proposal/Comments/ProposalComments.tsx | 2 +- src/components/Proposal/NewBadge/NewBadge.tsx | 2 +- .../Proposal/ProfileProposalItem.tsx | 4 +- src/components/Proposal/ProposalActions.tsx | 2 +- src/components/Proposal/ProposalFooterPoi.tsx | 4 +- src/components/Proposal/ProposalHeaderPoi.css | 8 +- src/components/Proposal/ProposalHeaderPoi.tsx | 2 +- src/components/Proposal/ProposalItem.tsx | 4 +- src/components/Proposal/ResultStance.tsx | 3 +- .../SentimentSurvey/ReactionCounter.tsx | 3 +- .../SentimentSurvey/SentimentSurvey.tsx | 2 +- .../SentimentSurvey/SentimentSurveyRow.tsx | 3 +- .../SentimentSurvey/SurveyResults.tsx | 3 +- .../SentimentSurvey/SurveyTopicResult.tsx | 3 +- .../Submit/CoAuthor/CoAuthorSelect.tsx | 2 +- .../Proposal/Submit/CoAuthor/CoAuthors.tsx | 3 +- .../Submit/CommitteeMembersDropdown.tsx | 2 +- .../Submit/ProposalSubmitHiringPage.tsx | 5 +- .../Proposal/Submit/ProposalSubmitPoiPage.tsx | 5 +- .../Update/CollapsedProposalUpdate.tsx | 6 +- .../Proposal/Update/EmptyProposalUpdate.tsx | 2 +- .../Update/ExpandedProposalUpdate.tsx | 4 +- .../Proposal/Update/ProposalUpdate.tsx | 3 +- .../Proposal/Update/ProposalUpdates.tsx | 3 +- src/components/Proposal/Update/UpdateMenu.tsx | 2 +- .../View/BiddingAndTenderingProcess.tsx | 3 +- .../View/Budget/CategoryTotalCard.tsx | 2 +- .../Proposal/View/Budget/CompetingGrants.tsx | 2 +- .../View/Budget/CompetingProposalsSidebar.tsx | 2 +- .../View/Budget/ContestedBudgetCard.tsx | 3 +- .../View/Budget/ContestedBudgetLabel.tsx | 3 +- .../View/Budget/ContestedBudgetSubLabel.tsx | 3 +- .../View/Budget/RequestedBudgetCard.tsx | 2 +- .../View/Categories/GrantProposalView.tsx | 4 +- .../Proposal/View/CompetingTenders.tsx | 2 +- src/components/Proposal/View/ForumButton.tsx | 3 +- .../Proposal/View/GovernanceProcess.tsx | 3 +- src/components/Proposal/View/ProposalCard.tsx | 4 +- .../Proposal/View/ProposalCoAuthorStatus.tsx | 2 +- .../Proposal/View/ProposalDetailCoauthors.tsx | 2 +- .../Proposal/View/ProposalDetailSection.tsx | 5 +- .../View/ProposalGovernanceSection.tsx | 2 +- .../Proposal/View/ProposalImagesPreview.tsx | 3 +- .../View/ProposalPromotionSection.tsx | 5 +- .../View/ProposalThresholdsSummary.tsx | 2 +- .../Proposal/View/ProposalUpdatesActions.tsx | 5 +- .../View/ProposalVoting/ChangeVoteButton.tsx | 4 +- .../View/ProposalVoting/ChoiceButtons.tsx | 2 +- .../View/ProposalVoting/DelegationsLabel.tsx | 2 +- .../ProposalVoting/GetInvolvedQuestion.tsx | 3 +- .../ProposalVoting/ProposalVotingSection.tsx | 2 +- .../SidebarSnapshotRedirect.tsx | 2 +- .../ProposalVoting/VoteVotingPowerInfo.tsx | 2 +- .../View/ProposalVoting/VotedChoiceButton.tsx | 2 +- .../ProposalVoting/VotingSectionFooter.tsx | 4 +- .../Proposal/View/SubscribeButton.tsx | 2 +- .../Proposal/View/TenderProposals.tsx | 3 +- .../Proposal/View/VestingContract.tsx | 2 +- src/components/Search/CategoryFilter.tsx | 2 +- src/components/Search/FilterLabel.tsx | 2 +- src/components/Search/SearchInput.tsx | 5 +- src/components/Search/SearchInputMobile.tsx | 2 +- src/components/Search/SearchTitle.tsx | 5 +- src/components/Search/SortingMenu.tsx | 4 +- src/components/Search/StatusFilter.tsx | 2 +- src/components/Search/TimeFrameFilter.tsx | 2 +- src/components/Status/ChoiceProgress.tsx | 2 +- .../Status/CoauthorRequestLabel.tsx | 2 +- src/components/Status/FinishLabel.tsx | 2 +- src/components/Status/LeadingOption.tsx | 2 +- src/components/Status/StatusMenu.tsx | 2 +- src/components/Status/StatusPill.tsx | 2 +- src/components/Token/TokenBalanceCard.tsx | 2 +- src/components/Token/TokensPerWalletPopup.tsx | 2 +- src/components/Token/VotingPower.tsx | 3 +- src/components/Transparency/GrantList.tsx | 4 +- src/components/Transparency/MonthlyTotal.tsx | 2 +- .../Updates/ProjectHealthStatus.tsx | 2 +- src/components/Updates/UpdateMarkdownView.tsx | 2 +- src/components/User/Badges/BadgeCard.tsx | 3 +- src/components/User/Badges/BadgeDetail.tsx | 2 +- src/components/User/Badges/BadgeStack.tsx | 2 +- src/components/User/Badges/BadgesSidebar.tsx | 2 +- src/components/User/LogIn.tsx | 5 +- src/components/User/UserStats.tsx | 2 +- src/components/User/UserVotingStats.tsx | 2 +- src/components/User/UserVpStats.tsx | 3 +- src/components/User/Username.tsx | 2 +- .../Proposal/templates/__data__/expected.ts | 2 +- .../Proposal/templates/__data__/markdown.ts | 2 +- src/entities/Proposal/templates/banName.ts | 5 +- src/entities/Proposal/templates/catalyst.ts | 9 +- src/entities/Proposal/templates/governance.ts | 7 +- src/entities/Proposal/templates/poi.ts | 16 +- src/entities/Subscription/model.ts | 3 +- src/entities/Transparency/utils.ts | 43 +- src/entities/Votes/constants.ts | 2 +- src/entities/Votes/utils.testData.ts | 961 +++++++++--------- src/hooks/useAbbreviatedFormatter.ts | 2 +- src/hooks/useFormatMessage.ts | 19 + src/hooks/useNewsletterSubscription.ts | 4 +- src/hooks/usePreventNavigation.ts | 8 +- src/hooks/useProposalDateText.ts | 4 +- src/pages/404.tsx | 2 +- src/pages/debug.tsx | 2 +- src/pages/grants.tsx | 2 +- src/pages/index.tsx | 2 +- src/pages/profile.tsx | 4 +- src/pages/proposal.tsx | 5 +- src/pages/proposals.tsx | 7 +- src/pages/submit/ban-name.tsx | 5 +- src/pages/submit/catalyst.tsx | 5 +- src/pages/submit/draft.tsx | 5 +- src/pages/submit/governance.tsx | 5 +- src/pages/submit/grant.tsx | 5 +- src/pages/submit/index.tsx | 2 +- src/pages/submit/linked-wearables.tsx | 5 +- src/pages/submit/pitch.tsx | 5 +- src/pages/submit/poll.tsx | 5 +- src/pages/submit/tender.tsx | 5 +- src/pages/submit/update.tsx | 5 +- src/pages/transparency.tsx | 2 +- src/pages/update.tsx | 4 +- src/utils/intl.ts | 19 + src/utils/locations.ts | 9 + tsconfig.json | 7 +- 255 files changed, 1648 insertions(+), 1100 deletions(-) create mode 100644 src/components/Common/Link.css create mode 100644 src/components/Common/Link.tsx create mode 100644 src/hooks/useFormatMessage.ts diff --git a/.prettierignore b/.prettierignore index bdba948c7..3515f7158 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,4 +4,5 @@ package-lock.json public node_modules lib -gatsby-browser.js \ No newline at end of file +gatsby-browser.js +src/migrations \ No newline at end of file diff --git a/README.md b/README.md index e23c02207..ee3c66028 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ Create a copy of `.env.example` and name it as `.env.development` If you are running this project locally you only need to check the following environment variables: -* `CONNECTION_STRING`: make sure it points to a valid database (see how to create one in the 'Database Setup' section) -* `COMMITTEE_ADDRESSES`: list of eth addresses separated by `,` that will be able to enact finished proposals -* `DISCOURSE_API_KEY`: the api key use to publish the proposals on the forum -* `RPC_PROVIDER_URL`: the rpc provider to get the latest block -* Snapshot env vars: see snapshot setup +- `CONNECTION_STRING`: make sure it points to a valid database (see how to create one in the 'Database Setup' section) +- `COMMITTEE_ADDRESSES`: list of eth addresses separated by `,` that will be able to enact finished proposals +- `DISCOURSE_API_KEY`: the api key use to publish the proposals on the forum +- `RPC_PROVIDER_URL`: the rpc provider to get the latest block +- Snapshot env vars: see snapshot setup These environment variables are used by the application backend. The environment variables for the frontend are located in `src/config/env`. @@ -69,7 +69,7 @@ The minimum amount of voting power require to pass a proposal of each type it's Make sure you have Postgres installed and running: ```shell -brew install postgresql@14 +brew install postgresql@14 brew services start postgresql@14 createdb ``` @@ -83,26 +83,28 @@ bash scripts/import-db.sh USERNAME [DATABASE_NAME] [DUMP_FILE] ``` If no DATABASE_NAME and DUMP_FILE arguments are given, the script will use the default values and create a `governance` db using the `development.dump` dump. -The CONNECTION_STRING should look like this: +The CONNECTION_STRING should look like this: ```bash postgres://USERNAME:PASSWORD@localhost:5432/governance -```` +``` (the default password should be `postgres`) ### Creating DB from scratch To create a DB, run in the terminal + ```bash createdb -U YOUR_USER DATABASE_NAME -```` +``` + The default postgres user is `postgres` or your username, and the default password is `postgres`. Use your user and password for the connection string variable, it should look like this: ```bash postgres://YOUR_USER:YOUR_PASSWORD@localhost:5432/DATABASE_NAME -```` +``` Once you have a `CONNECTION_STRING` you can set up your database tables using the following command: @@ -112,9 +114,9 @@ npm run migrate up ## Snapshot Setup -* `GATSBY_SNAPSHOT_SPACE`: the snapshot space where the proposals will be published -* `SNAPSHOT_PRIVATE_KEY`, `GATSBY_SNAPSHOT_ADDRESS`: a pair address/key with permissions to publish at that snapshot space -* The configured SNAPSHOT_PROPOSAL_TYPE for the project is 'single-choice', which means each voter may select only one choice. See [available voting systems](https://docs.snapshot.org/proposals/voting-types#single-choice-voting) +- `GATSBY_SNAPSHOT_SPACE`: the snapshot space where the proposals will be published +- `SNAPSHOT_PRIVATE_KEY`, `GATSBY_SNAPSHOT_ADDRESS`: a pair address/key with permissions to publish at that snapshot space +- The configured SNAPSHOT_PROPOSAL_TYPE for the project is 'single-choice', which means each voter may select only one choice. See [available voting systems](https://docs.snapshot.org/proposals/voting-types#single-choice-voting) ### Creating a Snapshot space @@ -128,9 +130,11 @@ Then follow instructions on [Snapshot](https://docs.snapshot.org/spaces/create) #### Strategy - DCL Governance uses several strategies: + - [erc20-balance-of](https://snapshot.org/#/playground/erc20-balance-of) - + - [delegation](https://demo.snapshot.org/#/strategy/delegation) + ```json { "symbol": "VP (delegated)", @@ -139,7 +143,7 @@ Then follow instructions on [Snapshot](https://docs.snapshot.org/spaces/create) "name": "erc20-balance-of", "params": { "symbol": "MANA", - "address": "0x The address of the token contract on the network you are using", + "address": "0x The address of the token contract on the network you are using", "decimals": 18 } } @@ -149,6 +153,7 @@ Then follow instructions on [Snapshot](https://docs.snapshot.org/spaces/create) ``` - [erc721-with-multiplier](https://snapshot.org/#/playground/erc721-with-multiplier) + ```json { "symbol": "LAND", @@ -156,26 +161,29 @@ Then follow instructions on [Snapshot](https://docs.snapshot.org/spaces/create) "multiplier": 2000 } ``` - + - [erc721-with-multiplier](https://snapshot.org/#/playground/erc721-with-multiplier) + ```json { - "symbol": "NAMES", - "address": "0x2a187453064356c898cae034eaed119e1663acb8", - "multiplier": 100 + "symbol": "NAMES", + "address": "0x2a187453064356c898cae034eaed119e1663acb8", + "multiplier": 100 } ``` - + - [decentraland-estate-size](https://snapshot.org/#/playground/decentraland-estate-size) + ```json { - "symbol": "ESTATE", - "address": "0x959e104e1a4db6317fa58f8295f586e1a978c297", - "multiplier": 2000 + "symbol": "ESTATE", + "address": "0x959e104e1a4db6317fa58f8295f586e1a978c297", + "multiplier": 2000 } ``` - + -[multichain](https://snapshot.org/#/playground/multichain) + ```json { "name": "multichain", @@ -219,26 +227,28 @@ Take into account that the voting power distribution response from snapshot retu The order in which each value is returned depends on the order in which strategies are added to the space on the [space settings](https://snapshot.org/#/snapshot.dcl.eth/settings) #### Current Strategies Order -* WMANA -* LAND -* ESTATE -* MANA -* NAMES -* DELEGATED -* WEARABLE + +- WMANA +- LAND +- ESTATE +- MANA +- NAMES +- DELEGATED +- WEARABLE # Test To run the tests you can do + ```bash npm test -``` +``` -or create a run configuration in your IDE with `jest --no-cache --no-watchman --runInBand` +or create a run configuration in your IDE with `jest --no-cache --no-watchman --runInBand` Also, you can try adding the `--verbose` option. -The `--runInBand` parameter runs the tests in a single thread, which is usually faster, but you can try without it +The `--runInBand` parameter runs the tests in a single thread, which is usually faster, but you can try without it and see what works best for you. # Run @@ -255,13 +265,16 @@ Once you setup this project you can start it using the following command the app should be running at https://localhost:8000/ -# Clear +# Clear + To clear cache and update localization and internationalization renders, run ```bash npm run clean ``` + or + ```bash rm -r .cache ``` @@ -276,7 +289,7 @@ You can find a full documentation about the project's structure in the [`decentr this project runs gatsby as front-end and a nodejs server as back-end both connected through a proxy -* locally this proxy is defined in [`gatsby-config.js` (`proxy` prop)](https://www.gatsbyjs.com/docs/api-proxy/#gatsby-skip-here) +- locally this proxy is defined in [`gatsby-config.js` (`proxy` prop)](https://www.gatsbyjs.com/docs/api-proxy/#gatsby-skip-here) ### Routes @@ -291,14 +304,16 @@ Types and Utils contain functions and types that will be accessible to both the Be careful with what goes in here, because when webpack tries to compile everything for the frontend it won't have all the backend dependencies, which could result in an error (e.g. `ERROR #98123 WEBPACK`) ### Proposals statuses + - Proposals are created in pending, and automatically passed to active - After a voting period of 1 week, they are automatically marked as finished, passed, or rejected, depending on the kind of proposal and of the voting results. - If proposal is in finished status, a committee user can pass/reject it, with a comment. - Once passed, a proposal can be enacted by a committee user, with a comment. ### Voting results + - Voting results are calculated in two different ways, for different purposes: - - `Votes/utils.ts` calculates the results in a user-friendly way, so they can be displayed in the frontend. These results are rounded up for clarity. + - `Votes/utils.ts` calculates the results in a user-friendly way, so they can be displayed in the frontend. These results are rounded up for clarity. - `Proposal/jobs.ts` has a more exact calculation, and is used to evaluate the real result of the voting ## Copyright & License diff --git a/gatsby-browser.js b/gatsby-browser.js index 078a9c6b4..59e8888e0 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -17,7 +17,7 @@ import { QueryClientProvider, } from '@tanstack/react-query' -import { IntlProvider } from 'decentraland-gatsby/dist/plugins/intl' +import { IntlProvider } from "react-intl" import AuthProvider from 'decentraland-gatsby/dist/context/Auth/AuthProvider' import FeatureFlagProvider from 'decentraland-gatsby/dist/context/FeatureFlag/FeatureFlagProvider' import segment from 'decentraland-gatsby/dist/utils/segment/segment' @@ -29,6 +29,8 @@ import ExternalLinkWarningModal from './src/components/Modal/ExternalLinkWarning import IdentityConnectModal from './src/components/Modal/IdentityConnectModal/IdentityConnectModal' import Segment from "decentraland-gatsby/dist/components/Development/Segment" import { SEGMENT_KEY } from "./src/constants" +import { flattenMessages } from "./src/utils/intl" +import en from "./src/intl/en.json" const queryClient = new QueryClient() @@ -44,7 +46,7 @@ export const wrapRootElement = ({ element }) => { export const wrapPageElement = ({ element, props }) => { return ( - + }> diff --git a/gatsby-config.js b/gatsby-config.js index fd361df3c..c5b0f18d9 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -58,20 +58,5 @@ module.exports = { allExtensions: true, }, }, - // this (optional) plugin enables Progressive Web App + Offline functionality - // To learn more, visit: https://gatsby.dev/offline - // `gatsby-plugin-offline`, - // `gatsby-plugin-i18n`, - { - resolve: `decentraland-gatsby/dist/plugins/intl`, - options: { - // language JSON resource path - paths: [`${__dirname}/src/intl`], - // supported language - languages: [`en` /*, `es`, `zh` */], - // language file path - defaultLanguage: `en`, - }, - }, ], } diff --git a/gatsby-node.js b/gatsby-node.js index 4fb33497c..f9892f901 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -8,7 +8,7 @@ const sharp = require('sharp') sharp.cache(false) sharp.simd(false) -exports.onCreateWebpackConfig = ({ actions, plugins }) => { +exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { actions.setWebpackConfig({ resolve: { fallback: { @@ -22,4 +22,14 @@ exports.onCreateWebpackConfig = ({ actions, plugins }) => { }, }, }) + // Silence 'conflicting order' warning for CSS modules. + // This is only an issue with regular CSS being imported. + if (stage === 'build-javascript' || stage === 'develop') { + const config = getConfig() + const miniCssExtractPlugin = config.plugins.find((plugin) => plugin.constructor.name === 'MiniCssExtractPlugin') + if (miniCssExtractPlugin) { + miniCssExtractPlugin.options.ignoreOrder = true + } + actions.replaceWebpackConfig(config) + } } diff --git a/package-lock.json b/package-lock.json index 58cfed521..9d883a303 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "ethers": "^5.7.1", "flickity": "^2.3.0", "gatsby": "4.23.0", + "gatsby-link": "^4.23.0", "gatsby-plugin-image": "^2.10.0", "gatsby-plugin-manifest": "^4.10.1", "gatsby-plugin-offline": "^5.10.1", @@ -50,6 +51,7 @@ "react-dom": "^17.0.2", "react-flickity-component": "^3.6.2", "react-hook-form": "^7.43.5", + "react-intl": "^6.4.4", "react-loading-skeleton": "^3.1.0", "react-select": "^5.3.2", "remark-parse": "^9.0.0", @@ -3574,12 +3576,12 @@ } }, "node_modules/@formatjs/ecma402-abstract": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", - "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.0.tgz", + "integrity": "sha512-6ueQTeJZtwKjmh23bdkq/DMqH4l4bmfvtQH98blOSbiXv/OUiyijSW6jU22IT8BNM1ujCaEvJfTtyCYVH38EMQ==", "dependencies": { - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" } }, "node_modules/@formatjs/ecma402-abstract/node_modules/tslib": { @@ -3588,11 +3590,11 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/fast-memoize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", - "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.0.tgz", + "integrity": "sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==", "dependencies": { - "tslib": "^2.1.0" + "tslib": "^2.4.0" } }, "node_modules/@formatjs/fast-memoize/node_modules/tslib": { @@ -3601,13 +3603,13 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", - "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.6.0.tgz", + "integrity": "sha512-yT6at0qc0DANw9qM/TU8RZaCtfDXtj4pZM/IC2WnVU80yAcliS3KVDiuUt4jSQAeFL9JS5bc2hARnFmjPdA6qw==", "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/icu-skeleton-parser": "1.3.6", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/icu-skeleton-parser": "1.6.0", + "tslib": "^2.4.0" } }, "node_modules/@formatjs/icu-messageformat-parser/node_modules/tslib": { @@ -3616,12 +3618,12 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", - "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.6.0.tgz", + "integrity": "sha512-eMmxNpoX/J1IPUjPGSZwo0Wh+7CEvdEMddP2Jxg1gQJXfGfht/FdW2D5XDFj3VMbOTUQlDIdZJY7uC6O6gjPoA==", "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "tslib": "^2.4.0" } }, "node_modules/@formatjs/icu-skeleton-parser/node_modules/tslib": { @@ -3630,20 +3632,20 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/intl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", - "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", - "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.9.0.tgz", + "integrity": "sha512-Ym0trUoC/VO6wQu4YHa0H1VR2tEixFRmwZgADkDLm7nD+vv1Ob+/88mUAoT0pwvirFqYKgUKEwp1tFepqyqvVA==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/fast-memoize": "2.2.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "@formatjs/intl-displaynames": "6.5.0", + "@formatjs/intl-listformat": "7.4.0", + "intl-messageformat": "10.5.0", + "tslib": "^2.4.0" }, "peerDependencies": { - "typescript": "^4.5" + "typescript": "^4.7 || 5" }, "peerDependenciesMeta": { "typescript": { @@ -3652,13 +3654,13 @@ } }, "node_modules/@formatjs/intl-displaynames": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", - "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.5.0.tgz", + "integrity": "sha512-sg/nR8ILEdUl+2sWu6jc1nQ5s04yucGlH1RVfatW8TSJ5uG3Yy3vgigi8NNC/BuhcncUNPWqSpTCSI1hA+rhiw==", "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" } }, "node_modules/@formatjs/intl-displaynames/node_modules/tslib": { @@ -3667,13 +3669,13 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/intl-listformat": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", - "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.4.0.tgz", + "integrity": "sha512-ifupb+balZUAF/Oh3QyGRqPRWGSKwWoMPR0cYZEG7r61SimD+m38oFQqVx/3Fp7LfQFF11m7IS+MlxOo2sKINA==", "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" } }, "node_modules/@formatjs/intl-listformat/node_modules/tslib": { @@ -3682,11 +3684,11 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/@formatjs/intl-localematcher": { - "version": "0.2.25", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", - "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.4.0.tgz", + "integrity": "sha512-bRTd+rKomvfdS4QDlVJ6TA/Jx1F2h/TBVO5LjvhQ7QPPHp19oPNMIum7W2CMEReq/zPxpmCeB31F9+5gl/qtvw==", "dependencies": { - "tslib": "^2.1.0" + "tslib": "^2.4.0" } }, "node_modules/@formatjs/intl-localematcher/node_modules/tslib": { @@ -15694,6 +15696,92 @@ "ajv-keywords": "^5.1.0" } }, + "node_modules/decentraland-dapps/node_modules/@formatjs/ecma402-abstract": { + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", + "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "dependencies": { + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/fast-memoize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", + "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", + "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-skeleton-parser": "1.3.6", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", + "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "typescript": "^4.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/intl-displaynames": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", + "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/intl-listformat": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", + "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/@formatjs/intl-localematcher": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", + "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/decentraland-dapps/node_modules/ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -15736,6 +15824,48 @@ "node": ">=0.8.x" } }, + "node_modules/decentraland-dapps/node_modules/intl-messageformat": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", + "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-dapps/node_modules/react-intl": { + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", + "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl": "2.2.1", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/react": "16 || 17 || 18", + "hoist-non-react-statics": "^3.3.2", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "react": "^16.3.0 || 17 || 18", + "typescript": "^4.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/decentraland-dapps/node_modules/tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + }, "node_modules/decentraland-gatsby": { "version": "5.67.2", "resolved": "https://registry.npmjs.org/decentraland-gatsby/-/decentraland-gatsby-5.67.2.tgz", @@ -15833,6 +15963,92 @@ "resolved": "https://registry.npmjs.org/@dcl/ui-env/-/ui-env-1.3.0.tgz", "integrity": "sha512-VDiLqFCAaefVG2lj1k1/CMCdwh5FTSeqsPWnUC5x0yC+Su5kTJpe4S2ZYKH/E5C4mFdMw3HKrBFE4clUMeqtiw==" }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/ecma402-abstract": { + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", + "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "dependencies": { + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/fast-memoize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", + "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", + "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-skeleton-parser": "1.3.6", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", + "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "typescript": "^4.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/intl-displaynames": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", + "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/intl-listformat": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", + "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "node_modules/decentraland-gatsby/node_modules/@formatjs/intl-localematcher": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", + "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/decentraland-gatsby/node_modules/@types/mime": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", @@ -15853,6 +16069,17 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/decentraland-gatsby/node_modules/intl-messageformat": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", + "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "tslib": "^2.1.0" + } + }, "node_modules/decentraland-gatsby/node_modules/mime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", @@ -15869,6 +16096,37 @@ "resolved": "https://registry.npmjs.org/radash/-/radash-7.1.0.tgz", "integrity": "sha512-NOWTaF5YMY3mCgrNq9Fw9fK8yvJv92uqRb2StcVq5W8kcJ6949EbV2vk6nLJKAocYs29rzJafZZP1lFkEkoVGw==" }, + "node_modules/decentraland-gatsby/node_modules/react-intl": { + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", + "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl": "2.2.1", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/react": "16 || 17 || 18", + "hoist-non-react-statics": "^3.3.2", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "react": "^16.3.0 || 17 || 18", + "typescript": "^4.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/decentraland-gatsby/node_modules/tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + }, "node_modules/decentraland-gatsby/node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -23638,14 +23896,14 @@ } }, "node_modules/intl-messageformat": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", - "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.5.0.tgz", + "integrity": "sha512-AvojYuOaRb6r2veOKfTVpxH9TrmjSdc5iR9R5RgBwrDZYSmAAFVT+QLbW3C4V7Qsg0OguMp67Q/EoUkxZzXRGw==", "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/fast-memoize": "2.2.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "tslib": "^2.4.0" } }, "node_modules/intl-messageformat/node_modules/tslib": { @@ -34052,24 +34310,24 @@ } }, "node_modules/react-intl": { - "version": "5.25.1", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", - "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", - "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl": "2.2.1", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.4.4.tgz", + "integrity": "sha512-/C9Sl/5//ohfkNG6AWlJuf4BhTXsbzyk93K62A4zRhSPANyOGpKZ+fWhN+TLfFd5YjDUHy+exU/09y0w1bO4Xw==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "@formatjs/intl": "2.9.0", + "@formatjs/intl-displaynames": "6.5.0", + "@formatjs/intl-listformat": "7.4.0", "@types/hoist-non-react-statics": "^3.3.1", "@types/react": "16 || 17 || 18", "hoist-non-react-statics": "^3.3.2", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" + "intl-messageformat": "10.5.0", + "tslib": "^2.4.0" }, "peerDependencies": { - "react": "^16.3.0 || 17 || 18", - "typescript": "^4.5" + "react": "^16.6.0 || 17 || 18", + "typescript": "^4.7 || 5" }, "peerDependenciesMeta": { "typescript": { @@ -38901,9 +39159,9 @@ } }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -43887,12 +44145,12 @@ } }, "@formatjs/ecma402-abstract": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", - "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.0.tgz", + "integrity": "sha512-6ueQTeJZtwKjmh23bdkq/DMqH4l4bmfvtQH98blOSbiXv/OUiyijSW6jU22IT8BNM1ujCaEvJfTtyCYVH38EMQ==", "requires": { - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43903,11 +44161,11 @@ } }, "@formatjs/fast-memoize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", - "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.0.tgz", + "integrity": "sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==", "requires": { - "tslib": "^2.1.0" + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43918,13 +44176,13 @@ } }, "@formatjs/icu-messageformat-parser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", - "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.6.0.tgz", + "integrity": "sha512-yT6at0qc0DANw9qM/TU8RZaCtfDXtj4pZM/IC2WnVU80yAcliS3KVDiuUt4jSQAeFL9JS5bc2hARnFmjPdA6qw==", "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/icu-skeleton-parser": "1.3.6", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/icu-skeleton-parser": "1.6.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43935,12 +44193,12 @@ } }, "@formatjs/icu-skeleton-parser": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", - "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.6.0.tgz", + "integrity": "sha512-eMmxNpoX/J1IPUjPGSZwo0Wh+7CEvdEMddP2Jxg1gQJXfGfht/FdW2D5XDFj3VMbOTUQlDIdZJY7uC6O6gjPoA==", "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43951,17 +44209,17 @@ } }, "@formatjs/intl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", - "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", - "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.9.0.tgz", + "integrity": "sha512-Ym0trUoC/VO6wQu4YHa0H1VR2tEixFRmwZgADkDLm7nD+vv1Ob+/88mUAoT0pwvirFqYKgUKEwp1tFepqyqvVA==", + "requires": { + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/fast-memoize": "2.2.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "@formatjs/intl-displaynames": "6.5.0", + "@formatjs/intl-listformat": "7.4.0", + "intl-messageformat": "10.5.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43972,13 +44230,13 @@ } }, "@formatjs/intl-displaynames": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", - "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.5.0.tgz", + "integrity": "sha512-sg/nR8ILEdUl+2sWu6jc1nQ5s04yucGlH1RVfatW8TSJ5uG3Yy3vgigi8NNC/BuhcncUNPWqSpTCSI1hA+rhiw==", "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -43989,13 +44247,13 @@ } }, "@formatjs/intl-listformat": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", - "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.4.0.tgz", + "integrity": "sha512-ifupb+balZUAF/Oh3QyGRqPRWGSKwWoMPR0cYZEG7r61SimD+m38oFQqVx/3Fp7LfQFF11m7IS+MlxOo2sKINA==", "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/intl-localematcher": "0.2.25", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/intl-localematcher": "0.4.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -44006,11 +44264,11 @@ } }, "@formatjs/intl-localematcher": { - "version": "0.2.25", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", - "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.4.0.tgz", + "integrity": "sha512-bRTd+rKomvfdS4QDlVJ6TA/Jx1F2h/TBVO5LjvhQ7QPPHp19oPNMIum7W2CMEReq/zPxpmCeB31F9+5gl/qtvw==", "requires": { - "tslib": "^2.1.0" + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -53338,6 +53596,84 @@ "ajv-keywords": "^5.1.0" } }, + "@formatjs/ecma402-abstract": { + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", + "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "requires": { + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/fast-memoize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", + "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@formatjs/icu-messageformat-parser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", + "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-skeleton-parser": "1.3.6", + "tslib": "^2.1.0" + } + }, + "@formatjs/icu-skeleton-parser": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", + "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-displaynames": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", + "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-listformat": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", + "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-localematcher": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", + "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "requires": { + "tslib": "^2.1.0" + } + }, "ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -53367,6 +53703,39 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, + "intl-messageformat": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", + "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "tslib": "^2.1.0" + } + }, + "react-intl": { + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", + "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl": "2.2.1", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/react": "16 || 17 || 18", + "hoist-non-react-statics": "^3.3.2", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + } + }, + "tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" } } }, @@ -53460,6 +53829,84 @@ "resolved": "https://registry.npmjs.org/@dcl/ui-env/-/ui-env-1.3.0.tgz", "integrity": "sha512-VDiLqFCAaefVG2lj1k1/CMCdwh5FTSeqsPWnUC5x0yC+Su5kTJpe4S2ZYKH/E5C4mFdMw3HKrBFE4clUMeqtiw==" }, + "@formatjs/ecma402-abstract": { + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz", + "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==", + "requires": { + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/fast-memoize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz", + "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@formatjs/icu-messageformat-parser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz", + "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-skeleton-parser": "1.3.6", + "tslib": "^2.1.0" + } + }, + "@formatjs/icu-skeleton-parser": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz", + "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-displaynames": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", + "integrity": "sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-listformat": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-6.5.3.tgz", + "integrity": "sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/intl-localematcher": "0.2.25", + "tslib": "^2.1.0" + } + }, + "@formatjs/intl-localematcher": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz", + "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==", + "requires": { + "tslib": "^2.1.0" + } + }, "@types/mime": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", @@ -53476,6 +53923,17 @@ "uri-js": "^4.2.2" } }, + "intl-messageformat": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", + "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "tslib": "^2.1.0" + } + }, "mime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", @@ -53486,6 +53944,28 @@ "resolved": "https://registry.npmjs.org/radash/-/radash-7.1.0.tgz", "integrity": "sha512-NOWTaF5YMY3mCgrNq9Fw9fK8yvJv92uqRb2StcVq5W8kcJ6949EbV2vk6nLJKAocYs29rzJafZZP1lFkEkoVGw==" }, + "react-intl": { + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", + "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl": "2.2.1", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/react": "16 || 17 || 18", + "hoist-non-react-statics": "^3.3.2", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + } + }, + "tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -59483,14 +59963,14 @@ "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==" }, "intl-messageformat": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz", - "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.5.0.tgz", + "integrity": "sha512-AvojYuOaRb6r2veOKfTVpxH9TrmjSdc5iR9R5RgBwrDZYSmAAFVT+QLbW3C4V7Qsg0OguMp67Q/EoUkxZzXRGw==", "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "tslib": "^2.1.0" + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/fast-memoize": "2.2.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -67326,20 +67806,20 @@ "requires": {} }, "react-intl": { - "version": "5.25.1", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-5.25.1.tgz", - "integrity": "sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==", - "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl": "2.2.1", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.4.4.tgz", + "integrity": "sha512-/C9Sl/5//ohfkNG6AWlJuf4BhTXsbzyk93K62A4zRhSPANyOGpKZ+fWhN+TLfFd5YjDUHy+exU/09y0w1bO4Xw==", + "requires": { + "@formatjs/ecma402-abstract": "1.17.0", + "@formatjs/icu-messageformat-parser": "2.6.0", + "@formatjs/intl": "2.9.0", + "@formatjs/intl-displaynames": "6.5.0", + "@formatjs/intl-listformat": "7.4.0", "@types/hoist-non-react-statics": "^3.3.1", "@types/react": "16 || 17 || 18", "hoist-non-react-statics": "^3.3.2", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" + "intl-messageformat": "10.5.0", + "tslib": "^2.4.0" }, "dependencies": { "tslib": { @@ -71073,9 +71553,9 @@ "integrity": "sha512-qjrFDl6S2yejKEz0M2c3c5D5z8sGJTjma94O9kRHStiqauXP9dKUM0Nbdmn90HCZBZl3jzFNT21bOtxRfCkc0w==" }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" }, "typescript-compare": { "version": "0.0.2", diff --git a/package.json b/package.json index 828400308..698b1ff6a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build:server": "tsc -p .", "build:front": "GATSBY_VERSION_NUMBER=$VERSION_NUMBER GATSBY_HEROKU_APP_NAME=$HEROKU_APP_NAME gatsby build", "develop": "gatsby develop --https -H 0.0.0.0", - "format": "prettier --write \"**/*.{js,jsx,json,md}\"", + "format": "prettier --write \"**/*.{js,jsx,json,md,ts,tsx}\"", "start": "concurrently -c blue,green -n SERVER,FRONT 'npm run serve' 'npm run develop'", "serve": "DOTENV_CONFIG_PATH=.env.development nodemon --watch src/entities --watch src/clients --watch src/services --watch src/server.ts --watch static/api.yaml -e ts,json --exec 'ts-node -r dotenv/config' src/server", "clean": "gatsby clean", @@ -32,7 +32,8 @@ "/src/" ], "moduleNameMapper": { - "\\.(css|less|sass|scss|gif|ttf|eot|svg)$": "/src/__mocks__/files.ts" + "\\.(css|less|sass|scss|gif|ttf|eot|svg)$": "/src/__mocks__/files.ts", + "^gatsby-page-utils/(.*)$": "gatsby-page-utils/dist/$1" } }, "repository": { @@ -62,6 +63,7 @@ "dotenv": "^16.0.0", "ethers": "^5.7.1", "flickity": "^2.3.0", + "gatsby-link": "^4.23.0", "gatsby": "4.23.0", "gatsby-plugin-image": "^2.10.0", "gatsby-plugin-manifest": "^4.10.1", @@ -86,6 +88,7 @@ "react-dom": "^17.0.2", "react-flickity-component": "^3.6.2", "react-hook-form": "^7.43.5", + "react-intl": "^6.4.4", "react-loading-skeleton": "^3.1.0", "react-select": "^5.3.2", "remark-parse": "^9.0.0", diff --git a/src/components/ActionCard/ActionCard.tsx b/src/components/ActionCard/ActionCard.tsx index ede68a9aa..9c18a2cad 100644 --- a/src/components/ActionCard/ActionCard.tsx +++ b/src/components/ActionCard/ActionCard.tsx @@ -1,10 +1,11 @@ import React from 'react' import classNames from 'classnames' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Card } from 'decentraland-ui/dist/components/Card/Card' import Grid from 'semantic-ui-react/dist/commonjs/collections/Grid/Grid' +import useFormatMessage from '../../hooks/useFormatMessage' + import './ActionCard.css' export interface ActionCardProps { diff --git a/src/components/Banner/Delegation/DelegationBanner.tsx b/src/components/Banner/Delegation/DelegationBanner.tsx index edc55adc2..e7ee4ff9b 100644 --- a/src/components/Banner/Delegation/DelegationBanner.tsx +++ b/src/components/Banner/Delegation/DelegationBanner.tsx @@ -1,8 +1,7 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { OPEN_CALL_FOR_DELEGATES_LINK } from '../../../constants' +import useFormatMessage from '../../../hooks/useFormatMessage' import Delegate from '../../Icon/Delegate' import Banner from '../Banner' diff --git a/src/components/Banner/Subscription/SubscriptionBanner.tsx b/src/components/Banner/Subscription/SubscriptionBanner.tsx index 017f5f486..031b2cee4 100644 --- a/src/components/Banner/Subscription/SubscriptionBanner.tsx +++ b/src/components/Banner/Subscription/SubscriptionBanner.tsx @@ -1,7 +1,6 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - +import useFormatMessage from '../../../hooks/useFormatMessage' import Email from '../../Icon/Email' import Banner from '../Banner' diff --git a/src/components/Category/CategoryBanner.tsx b/src/components/Category/CategoryBanner.tsx index 7bfde6f67..479350ba3 100644 --- a/src/components/Category/CategoryBanner.tsx +++ b/src/components/Category/CategoryBanner.tsx @@ -1,12 +1,12 @@ import React from 'react' import classNames from 'classnames' -import Link from 'decentraland-gatsby/dist/components/Text/Link' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl' import { HiringType, PoiType, ProposalType, isHiringType } from '../../entities/Proposal/types' +import useFormatMessage from '../../hooks/useFormatMessage' +import { navigate } from '../../utils/locations' +import Link from '../Common/Link' import Text from '../Common/Text/Text' import AddPoi from '../Icon/ProposalCategories/AddPoi' import BanName from '../Icon/ProposalCategories/BanName' diff --git a/src/components/Category/CategoryList.tsx b/src/components/Category/CategoryList.tsx index c61d20fc3..c75128194 100644 --- a/src/components/Category/CategoryList.tsx +++ b/src/components/Category/CategoryList.tsx @@ -1,12 +1,12 @@ import React, { useMemo } from 'react' import { useLocation } from '@reach/router' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Header } from 'decentraland-ui/dist/components/Header/Header' import { ProposalType, toProposalType } from '../../entities/Proposal/types' import { getUrlFilters } from '../../helpers' import { useBurgerMenu } from '../../hooks/useBurgerMenu' +import useFormatMessage from '../../hooks/useFormatMessage' import ActionableLayout from '../Layout/ActionableLayout' import CategoryOption from './CategoryOption' diff --git a/src/components/Category/CategoryOption.tsx b/src/components/Category/CategoryOption.tsx index 1182e7640..0027aaf75 100644 --- a/src/components/Category/CategoryOption.tsx +++ b/src/components/Category/CategoryOption.tsx @@ -2,8 +2,6 @@ import React, { Fragment, useEffect, useMemo, useState } from 'react' import { useLocation } from '@reach/router' import classNames from 'classnames' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl' import isNumber from 'lodash/isNumber' import toSnakeCase from 'lodash/snakeCase' @@ -11,6 +9,8 @@ import { NewGrantCategory, SubtypeAlternativeOptions, SubtypeOptions, toGrantSub import { getNewGrantsCategoryIcon } from '../../entities/Grant/utils' import { ProposalType, toProposalType } from '../../entities/Proposal/types' import { CategoryIconVariant } from '../../helpers/styles' +import useFormatMessage from '../../hooks/useFormatMessage' +import { navigate } from '../../utils/locations' import Text from '../Common/Text/Text' import Arrow from '../Icon/Arrow' import All from '../Icon/ProposalCategories/All' diff --git a/src/components/Category/CategoryPill.tsx b/src/components/Category/CategoryPill.tsx index c9234e56f..f53bd8113 100644 --- a/src/components/Category/CategoryPill.tsx +++ b/src/components/Category/CategoryPill.tsx @@ -1,11 +1,11 @@ import React from 'react' import classNames from 'classnames' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media' import { ProposalType } from '../../entities/Proposal/types' import locations from '../../utils/locations' +import Link from '../Common/Link' import Pill, { PillColor } from '../Common/Pill' const ColorsConfig: Record = { diff --git a/src/components/Charts/LineChart.tsx b/src/components/Charts/LineChart.tsx index b93529fba..b14d41acf 100644 --- a/src/components/Charts/LineChart.tsx +++ b/src/components/Charts/LineChart.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useMemo, useRef, useState } from 'react' import { Chart } from 'react-chartjs-2' +import { useIntl } from 'react-intl' import { ChartArea, ChartData, Chart as ChartJS } from 'chart.js' import 'chart.js/auto' -import { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' import useAbbreviatedFormatter from '../../hooks/useAbbreviatedFormatter' diff --git a/src/components/Common/DistributionBar/DistributionBarPopup.tsx b/src/components/Common/DistributionBar/DistributionBarPopup.tsx index 41df9f397..187d17345 100644 --- a/src/components/Common/DistributionBar/DistributionBarPopup.tsx +++ b/src/components/Common/DistributionBar/DistributionBarPopup.tsx @@ -1,8 +1,9 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Popup } from 'decentraland-ui/dist/components/Popup/Popup' +import useFormatMessage from '../../../hooks/useFormatMessage' + import './DistributionBarPopup.css' type PopupPropsPosition = diff --git a/src/components/Common/Empty.css b/src/components/Common/Empty.css index 3e0ec75d2..38812bc11 100644 --- a/src/components/Common/Empty.css +++ b/src/components/Common/Empty.css @@ -27,6 +27,6 @@ margin-top: 15px !important; } -.Empty .dg.Link { +.Empty .Link { text-transform: uppercase; } diff --git a/src/components/Common/Empty.tsx b/src/components/Common/Empty.tsx index cf95fca06..fafb6a826 100644 --- a/src/components/Common/Empty.tsx +++ b/src/components/Common/Empty.tsx @@ -1,7 +1,6 @@ import React from 'react' import classNames from 'classnames' -import Link from 'decentraland-gatsby/dist/components/Text/Link' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { Header } from 'decentraland-ui/dist/components/Header/Header' @@ -9,6 +8,7 @@ import { Header } from 'decentraland-ui/dist/components/Header/Header' import Watermelon from '../Icon/Watermelon' import './Empty.css' +import Link from './Link' export enum ActionType { BUTTON, diff --git a/src/components/Common/Link.css b/src/components/Common/Link.css new file mode 100644 index 000000000..353dd84e7 --- /dev/null +++ b/src/components/Common/Link.css @@ -0,0 +1,19 @@ +.Link { + font-size: inherit; + line-height: inherit; + color: var(--dcl-primary); +} + +.Link.Link--pointer { + cursor: pointer; +} + +.Link .icon { + font-size: 19px; + vertical-align: middle; +} + +.Link i.icon { + font-size: 1em; + vertical-align: text-top; +} diff --git a/src/components/Common/Link.tsx b/src/components/Common/Link.tsx new file mode 100644 index 000000000..3a03d4cda --- /dev/null +++ b/src/components/Common/Link.tsx @@ -0,0 +1,41 @@ +import React from 'react' + +import classNames from 'classnames' + +import { navigate } from '../../utils/locations' + +import './Link.css' + +type Props = React.AnchorHTMLAttributes + +function isLocalLink(href?: string | null) { + return ( + typeof href === 'string' && !href.startsWith('https://') && !href.startsWith('http://') && !href.startsWith('//') + ) +} + +export default function Link({ target, rel, href, onClick, className, ...props }: Props) { + const isLocal = isLocalLink(href) + const linkTarget = !target && !isLocal ? '_blank' : target || undefined + const linkRel = !isLocal ? classNames(rel, 'noopener', 'noreferrer') : rel + const handleClick = (e: React.MouseEvent) => { + if (onClick) { + onClick(e) + } + if (isLocal && href) { + e.preventDefault() + navigate(href) + } + } + + return ( + + ) +} diff --git a/src/components/Common/LinkWithTitle.tsx b/src/components/Common/LinkWithTitle.tsx index 3ba7da214..0d5e52d89 100644 --- a/src/components/Common/LinkWithTitle.tsx +++ b/src/components/Common/LinkWithTitle.tsx @@ -1,10 +1,10 @@ import React from 'react' import { useQuery } from '@tanstack/react-query' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Governance } from '../../clients/Governance' import { DEFAULT_QUERY_STALE_TIME } from '../../hooks/constants' +import useFormatMessage from '../../hooks/useFormatMessage' import Open from '../Icon/Open' import './LinkWithTitle.css' @@ -19,6 +19,7 @@ const fetchTitle = async (url: string) => { return response.title || '' } catch (error) { console.error(error) + return '' } } diff --git a/src/components/Common/SnapshotRedirectButton.tsx b/src/components/Common/SnapshotRedirectButton.tsx index 7666c5ae2..f1f5cd14a 100644 --- a/src/components/Common/SnapshotRedirectButton.tsx +++ b/src/components/Common/SnapshotRedirectButton.tsx @@ -1,10 +1,10 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { ProposalAttributes } from '../../entities/Proposal/types' import { snapshotProposalUrl } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import OpenExternalLink from '../Icon/OpenExternalLink' import './SnapshotRedirectButton.css' diff --git a/src/components/Debug/HttpStatus.tsx b/src/components/Debug/HttpStatus.tsx index 4446c65dd..ea59d14c6 100644 --- a/src/components/Debug/HttpStatus.tsx +++ b/src/components/Debug/HttpStatus.tsx @@ -1,11 +1,11 @@ import React, { useEffect, useState } from 'react' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { HttpStat } from '../../clients/HttpStat' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import ErrorMessage from '../Error/ErrorMessage' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/Delegation/DelegatedToAddressEmptyCard.tsx b/src/components/Delegation/DelegatedToAddressEmptyCard.tsx index 85a836914..dbc2c626f 100644 --- a/src/components/Delegation/DelegatedToAddressEmptyCard.tsx +++ b/src/components/Delegation/DelegatedToAddressEmptyCard.tsx @@ -1,7 +1,6 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - +import useFormatMessage from '../../hooks/useFormatMessage' import Empty from '../Common/Empty' import Scale from '../Icon/Scale' import VotingPowerDelegationHandler from '../Modal/VotingPowerDelegationDetail/VotingPowerDelegationHandler' diff --git a/src/components/Delegation/DelegatedToUserEmptyCard.tsx b/src/components/Delegation/DelegatedToUserEmptyCard.tsx index d4c2f1de5..188dcdd7a 100644 --- a/src/components/Delegation/DelegatedToUserEmptyCard.tsx +++ b/src/components/Delegation/DelegatedToUserEmptyCard.tsx @@ -1,7 +1,6 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - +import useFormatMessage from '../../hooks/useFormatMessage' import Empty from '../Common/Empty' import Scale from '../Icon/Scale' diff --git a/src/components/Delegation/DelegatesTable.tsx b/src/components/Delegation/DelegatesTable.tsx index 1fc0f102d..cee533d0d 100644 --- a/src/components/Delegation/DelegatesTable.tsx +++ b/src/components/Delegation/DelegatesTable.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Table } from 'decentraland-ui/dist/components/Table/Table' import { Delegate } from '../../hooks/useDelegatesInfo' +import useFormatMessage from '../../hooks/useFormatMessage' import { useSortingByKey } from '../../hooks/useSortingByKey' import Candidates from '../../utils/delegates/candidates.json' import Sort from '../Icon/Sort' diff --git a/src/components/Delegation/DelegatesTableRow.tsx b/src/components/Delegation/DelegatesTableRow.tsx index ce3b5a873..7c9576f34 100644 --- a/src/components/Delegation/DelegatesTableRow.tsx +++ b/src/components/Delegation/DelegatesTableRow.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react' +import { useIntl } from 'react-intl' import classNames from 'classnames' -import { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media/Media' import { Table } from 'decentraland-ui/dist/components/Table/Table' diff --git a/src/components/Delegation/DelegationCards.tsx b/src/components/Delegation/DelegationCards.tsx index 096a1ba83..495f73fbf 100644 --- a/src/components/Delegation/DelegationCards.tsx +++ b/src/components/Delegation/DelegationCards.tsx @@ -1,9 +1,9 @@ import React, { useMemo, useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import Grid from 'semantic-ui-react/dist/commonjs/collections/Grid/Grid' import { DelegationResult, DetailedScores, VpDistribution } from '../../clients/SnapshotGraphqlTypes' +import useFormatMessage from '../../hooks/useFormatMessage' import { useSortingByKey } from '../../hooks/useSortingByKey' import FullWidthButton from '../Common/FullWidthButton' import SkeletonBars from '../Common/SkeletonBars' diff --git a/src/components/Delegation/DelegatorCardProfile.tsx b/src/components/Delegation/DelegatorCardProfile.tsx index 3577bacfe..7d3b46d3b 100644 --- a/src/components/Delegation/DelegatorCardProfile.tsx +++ b/src/components/Delegation/DelegatorCardProfile.tsx @@ -1,9 +1,9 @@ import React from 'react' +import { useIntl } from 'react-intl' -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' - +import useFormatMessage from '../../hooks/useFormatMessage' import locations from '../../utils/locations' +import Link from '../Common/Link' import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline' import Username from '../User/Username' diff --git a/src/components/Delegation/VotingPowerListModal.tsx b/src/components/Delegation/VotingPowerListModal.tsx index 11f6ed252..c1e488bab 100644 --- a/src/components/Delegation/VotingPowerListModal.tsx +++ b/src/components/Delegation/VotingPowerListModal.tsx @@ -1,10 +1,11 @@ import React from 'react' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Close } from 'decentraland-ui/dist/components/Close/Close' import { Modal, ModalProps } from 'decentraland-ui/dist/components/Modal/Modal' +import useFormatMessage from '../../hooks/useFormatMessage' + import VotingPowerListItem from './VotingPowerListItem' import './VotingPowerListModal.css' diff --git a/src/components/Error/ErrorMessage.css b/src/components/Error/ErrorMessage.css index 96506c54a..8892a8c89 100644 --- a/src/components/Error/ErrorMessage.css +++ b/src/components/Error/ErrorMessage.css @@ -21,7 +21,7 @@ padding-right: 8px; } -a.dg.Link.Link--pointer.ui.basic.button.ErrorMessage__Show { +a.Link.Link--pointer.ui.basic.button.ErrorMessage__Show { height: 20px; text-transform: uppercase; font-weight: 600; @@ -77,7 +77,7 @@ button.ui.small.primary.button.Button.ErrorMessage__Copy { margin-right: 10px; } -.ErrorMessage__CallForAction a.dg.Link.Link--pointer { +.ErrorMessage__CallForAction a.Link.Link--pointer { font-weight: 700; } diff --git a/src/components/Error/ErrorMessage.tsx b/src/components/Error/ErrorMessage.tsx index 7706198e6..8524a0b76 100644 --- a/src/components/Error/ErrorMessage.tsx +++ b/src/components/Error/ErrorMessage.tsx @@ -1,13 +1,13 @@ import React, { useCallback, useState } from 'react' import classNames from 'classnames' -import Link from 'decentraland-gatsby/dist/components/Text/Link' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' import useClipboardCopy from 'decentraland-gatsby/dist/hooks/useClipboardCopy' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Button } from 'decentraland-ui/dist/components/Button/Button' +import useFormatMessage from '../../hooks/useFormatMessage' import Time from '../../utils/date/Time' +import Link from '../Common/Link' import ErrorNotice from '../Icon/ErrorNotice' import './ErrorMessage.css' diff --git a/src/components/Form/MarkdownNotice.tsx b/src/components/Form/MarkdownNotice.tsx index 8f6c013ab..7572768b0 100644 --- a/src/components/Form/MarkdownNotice.tsx +++ b/src/components/Form/MarkdownNotice.tsx @@ -1,8 +1,9 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Popup } from 'decentraland-ui/dist/components/Popup/Popup' +import useFormatMessage from '../../hooks/useFormatMessage' + export default function MarkdownNotice() { const t = useFormatMessage() diff --git a/src/components/GrantRequest/AddBudgetBreakdownModal.tsx b/src/components/GrantRequest/AddBudgetBreakdownModal.tsx index 2e2529895..8fbc6dfe2 100644 --- a/src/components/GrantRequest/AddBudgetBreakdownModal.tsx +++ b/src/components/GrantRequest/AddBudgetBreakdownModal.tsx @@ -2,12 +2,12 @@ import React, { useEffect, useMemo } from 'react' import Textarea from 'decentraland-gatsby/dist/components/Form/Textarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { BudgetBreakdownConcept, BudgetBreakdownConceptSchema } from '../../entities/Grant/types' import { asNumber } from '../../entities/Proposal/utils' import { isHttpsURL } from '../../helpers' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/GrantRequest/AddModal.tsx b/src/components/GrantRequest/AddModal.tsx index b43de70fe..e17148b5c 100644 --- a/src/components/GrantRequest/AddModal.tsx +++ b/src/components/GrantRequest/AddModal.tsx @@ -1,10 +1,11 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { Close } from 'decentraland-ui/dist/components/Close/Close' import { Modal } from 'decentraland-ui/dist/components/Modal/Modal' +import useFormatMessage from '../../hooks/useFormatMessage' + import './AddModal.css' interface Props { diff --git a/src/components/GrantRequest/AddTeamMemberModal.tsx b/src/components/GrantRequest/AddTeamMemberModal.tsx index bb8a48983..6d7e665cf 100644 --- a/src/components/GrantRequest/AddTeamMemberModal.tsx +++ b/src/components/GrantRequest/AddTeamMemberModal.tsx @@ -2,11 +2,11 @@ import React, { useEffect } from 'react' import Textarea from 'decentraland-gatsby/dist/components/Form/Textarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { TeamMember, TeamMemberItemSchema } from '../../entities/Grant/types' import { isHttpsURL } from '../../helpers' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/GrantRequest/BudgetBreakdownView.tsx b/src/components/GrantRequest/BudgetBreakdownView.tsx index edc2916f2..1264d6bb9 100644 --- a/src/components/GrantRequest/BudgetBreakdownView.tsx +++ b/src/components/GrantRequest/BudgetBreakdownView.tsx @@ -1,11 +1,12 @@ import React, { useMemo } from 'react' +import { useIntl } from 'react-intl' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' import toNumber from 'lodash/toNumber' import { BudgetBreakdownConcept } from '../../entities/Grant/types' import { CURRENCY_FORMAT_OPTIONS } from '../../helpers' +import useFormatMessage from '../../hooks/useFormatMessage' import BreakdownAccordion, { BreakdownItem } from './BreakdownAccordion' diff --git a/src/components/GrantRequest/BudgetInput.tsx b/src/components/GrantRequest/BudgetInput.tsx index 7f1f94caf..131c17068 100644 --- a/src/components/GrantRequest/BudgetInput.tsx +++ b/src/components/GrantRequest/BudgetInput.tsx @@ -2,9 +2,9 @@ import React from 'react' import classNames from 'classnames' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { disableOnWheelInput } from '../../helpers' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import Helper from '../Helper/Helper' import ExclamationCircle from '../Icon/ExclamationCircle' diff --git a/src/components/GrantRequest/CalculationHelper.tsx b/src/components/GrantRequest/CalculationHelper.tsx index 322e10efa..726c07814 100644 --- a/src/components/GrantRequest/CalculationHelper.tsx +++ b/src/components/GrantRequest/CalculationHelper.tsx @@ -1,7 +1,6 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - +import useFormatMessage from '../../hooks/useFormatMessage' import Helper from '../Helper/Helper' import Lock from '../Icon/Lock' diff --git a/src/components/GrantRequest/CategorySection/AcceleratorSection.tsx b/src/components/GrantRequest/CategorySection/AcceleratorSection.tsx index e81203db8..a1b824701 100644 --- a/src/components/GrantRequest/CategorySection/AcceleratorSection.tsx +++ b/src/components/GrantRequest/CategorySection/AcceleratorSection.tsx @@ -2,7 +2,6 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { @@ -12,6 +11,7 @@ import { } from '../../../entities/Grant/types' import { asNumber } from '../../../entities/Proposal/utils' import { disableOnWheelInput } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/CoreUnitSection.tsx b/src/components/GrantRequest/CategorySection/CoreUnitSection.tsx index a22ffbd28..1783eae34 100644 --- a/src/components/GrantRequest/CategorySection/CoreUnitSection.tsx +++ b/src/components/GrantRequest/CategorySection/CoreUnitSection.tsx @@ -2,13 +2,13 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { CoreUnitQuestions, CoreUnitQuestionsSchema, GrantRequestCategoryAssessment, } from '../../../entities/Grant/types' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/DocumentationSection.tsx b/src/components/GrantRequest/CategorySection/DocumentationSection.tsx index c6a32fee3..4c7e609f7 100644 --- a/src/components/GrantRequest/CategorySection/DocumentationSection.tsx +++ b/src/components/GrantRequest/CategorySection/DocumentationSection.tsx @@ -1,7 +1,6 @@ import React, { forwardRef, useEffect } from 'react' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { @@ -11,6 +10,7 @@ import { } from '../../../entities/Grant/types' import { asNumber } from '../../../entities/Proposal/utils' import { disableOnWheelInput } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/InWorldContentSection.tsx b/src/components/GrantRequest/CategorySection/InWorldContentSection.tsx index ce529a1ad..95e512dd6 100644 --- a/src/components/GrantRequest/CategorySection/InWorldContentSection.tsx +++ b/src/components/GrantRequest/CategorySection/InWorldContentSection.tsx @@ -2,7 +2,6 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { @@ -12,6 +11,7 @@ import { } from '../../../entities/Grant/types' import { asNumber } from '../../../entities/Proposal/utils' import { disableOnWheelInput } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/PlatformSection.tsx b/src/components/GrantRequest/CategorySection/PlatformSection.tsx index 5acb33c26..cb5395272 100644 --- a/src/components/GrantRequest/CategorySection/PlatformSection.tsx +++ b/src/components/GrantRequest/CategorySection/PlatformSection.tsx @@ -2,13 +2,13 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { GrantRequestCategoryAssessment, PlatformQuestions, PlatformQuestionsSchema, } from '../../../entities/Grant/types' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/SocialMediaContentSection.tsx b/src/components/GrantRequest/CategorySection/SocialMediaContentSection.tsx index e6c8347e7..fd742c568 100644 --- a/src/components/GrantRequest/CategorySection/SocialMediaContentSection.tsx +++ b/src/components/GrantRequest/CategorySection/SocialMediaContentSection.tsx @@ -2,7 +2,6 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { @@ -12,6 +11,7 @@ import { } from '../../../entities/Grant/types' import { asNumber } from '../../../entities/Proposal/utils' import { disableOnWheelInput } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CategorySection/SponsorshipSection.tsx b/src/components/GrantRequest/CategorySection/SponsorshipSection.tsx index ebd7cef3f..2359437f3 100644 --- a/src/components/GrantRequest/CategorySection/SponsorshipSection.tsx +++ b/src/components/GrantRequest/CategorySection/SponsorshipSection.tsx @@ -2,7 +2,6 @@ import React, { forwardRef, useEffect } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import { SelectField } from 'decentraland-ui/dist/components/SelectField/SelectField' @@ -13,6 +12,7 @@ import { } from '../../../entities/Grant/types' import { asNumber } from '../../../entities/Proposal/utils' import { disableOnWheelInput } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import { useGrantCategoryEditor } from '../../../hooks/useGrantCategoryEditor' import Label from '../../Common/Label' import { ContentSection } from '../../Layout/ContentLayout' diff --git a/src/components/GrantRequest/CheckboxField.css b/src/components/GrantRequest/CheckboxField.css index 4b2161133..c45a8b3a0 100644 --- a/src/components/GrantRequest/CheckboxField.css +++ b/src/components/GrantRequest/CheckboxField.css @@ -37,6 +37,6 @@ text-align: left; } -.CheckboxField > a.dg.Link.Link--pointer { +.CheckboxField > a.Link.Link--pointer { font-weight: 500; } diff --git a/src/components/GrantRequest/GrantRequestCategorySection.tsx b/src/components/GrantRequest/GrantRequestCategorySection.tsx index e9e2b8444..917fd1cf3 100644 --- a/src/components/GrantRequest/GrantRequestCategorySection.tsx +++ b/src/components/GrantRequest/GrantRequestCategorySection.tsx @@ -1,8 +1,7 @@ import React, { useRef } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { GrantRequestCategoryAssessment, NewGrantCategory } from '../../entities/Grant/types' +import useFormatMessage from '../../hooks/useFormatMessage' import AcceleratorSection from './CategorySection/AcceleratorSection' import CoreUnitSection from './CategorySection/CoreUnitSection' diff --git a/src/components/GrantRequest/GrantRequestDueDiligenceSection.tsx b/src/components/GrantRequest/GrantRequestDueDiligenceSection.tsx index 23a8bafea..216143683 100644 --- a/src/components/GrantRequest/GrantRequestDueDiligenceSection.tsx +++ b/src/components/GrantRequest/GrantRequestDueDiligenceSection.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import sumBy from 'lodash/sumBy' import { @@ -9,6 +8,7 @@ import { GrantRequestDueDiligence, } from '../../entities/Grant/types' import { userModifiedForm } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import SubLabel from '../Common/SubLabel' diff --git a/src/components/GrantRequest/GrantRequestFinalConsentSection.tsx b/src/components/GrantRequest/GrantRequestFinalConsentSection.tsx index 249b70880..aa357217d 100644 --- a/src/components/GrantRequest/GrantRequestFinalConsentSection.tsx +++ b/src/components/GrantRequest/GrantRequestFinalConsentSection.tsx @@ -1,9 +1,8 @@ import React, { useEffect, useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { NewGrantCategory } from '../../entities/Grant/types' import { userModifiedForm } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import CheckboxField from './CheckboxField' diff --git a/src/components/GrantRequest/GrantRequestFundingSection.tsx b/src/components/GrantRequest/GrantRequestFundingSection.tsx index 36bc158fa..009bc9f88 100644 --- a/src/components/GrantRequest/GrantRequestFundingSection.tsx +++ b/src/components/GrantRequest/GrantRequestFundingSection.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useMemo } from 'react' import { Controller, useForm, useWatch } from 'react-hook-form' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { Radio } from 'decentraland-ui/dist/components/Radio/Radio' import snakeCase from 'lodash/snakeCase' @@ -21,6 +20,7 @@ import { import { isValidGrantBudget } from '../../entities/Grant/utils' import { getFormattedPercentage } from '../../helpers' import useCategoryBudget from '../../hooks/useCategoryBudget' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import Helper from '../Helper/Helper' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/GrantRequest/GrantRequestGeneralInfoSection.tsx b/src/components/GrantRequest/GrantRequestGeneralInfoSection.tsx index 1822b94bf..6b3274d48 100644 --- a/src/components/GrantRequest/GrantRequestGeneralInfoSection.tsx +++ b/src/components/GrantRequest/GrantRequestGeneralInfoSection.tsx @@ -2,13 +2,13 @@ import React, { useCallback, useEffect, useState } from 'react' import MarkdownTextarea from 'decentraland-gatsby/dist/components/Form/MarkdownTextarea' import useEditor, { assert, createValidator } from 'decentraland-gatsby/dist/hooks/useEditor' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Field } from 'decentraland-ui/dist/components/Field/Field' import isEmail from 'validator/lib/isEmail' import isEthereumAddress from 'validator/lib/isEthereumAddress' import { GrantRequestGeneralInfo, GrantRequestGeneralInfoSchema } from '../../entities/Grant/types' import { userModifiedForm } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import SubLabel from '../Common/SubLabel' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/GrantRequest/GrantRequestSectionCard.tsx b/src/components/GrantRequest/GrantRequestSectionCard.tsx index 1b94f73b3..12b0db759 100644 --- a/src/components/GrantRequest/GrantRequestSectionCard.tsx +++ b/src/components/GrantRequest/GrantRequestSectionCard.tsx @@ -2,8 +2,8 @@ import React from 'react' import Skeleton from 'react-loading-skeleton' import classNames from 'classnames' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' +import Link from '../Common/Link' import ExclamationCircle from '../Icon/ExclamationCircle' import './GrantRequestSectionCard.css' @@ -28,10 +28,8 @@ export const GrantRequestSectionCard = ({ error, href, }: Props) => { - const Component = href ? Link : 'div' - return ( - {subtitle} - + ) } diff --git a/src/components/GrantRequest/GrantRequestTeamSection.tsx b/src/components/GrantRequest/GrantRequestTeamSection.tsx index 65a816bd5..6409c3b7b 100644 --- a/src/components/GrantRequest/GrantRequestTeamSection.tsx +++ b/src/components/GrantRequest/GrantRequestTeamSection.tsx @@ -1,10 +1,10 @@ import React, { useCallback, useEffect, useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import isEmpty from 'lodash/isEmpty' import { GrantRequest, GrantRequestTeam, TeamMember } from '../../entities/Grant/types' import { userModifiedForm } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import SubLabel from '../Common/SubLabel' diff --git a/src/components/GrantRequest/MultipleChoiceField.tsx b/src/components/GrantRequest/MultipleChoiceField.tsx index fed20fda7..76196ad1e 100644 --- a/src/components/GrantRequest/MultipleChoiceField.tsx +++ b/src/components/GrantRequest/MultipleChoiceField.tsx @@ -1,8 +1,8 @@ import React, { useCallback } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { isEmpty } from 'lodash' +import useFormatMessage from '../../hooks/useFormatMessage' import Label from '../Common/Label' import { ContentSection } from '../Layout/ContentLayout' diff --git a/src/components/GrantRequest/PersonnelView.tsx b/src/components/GrantRequest/PersonnelView.tsx index 603effac0..4ab0153cf 100644 --- a/src/components/GrantRequest/PersonnelView.tsx +++ b/src/components/GrantRequest/PersonnelView.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { TeamMember } from '../../entities/Grant/types' +import useFormatMessage from '../../hooks/useFormatMessage' import BreakdownAccordion, { BreakdownItem } from './BreakdownAccordion' diff --git a/src/components/Grants/CategoryItem.tsx b/src/components/Grants/CategoryItem.tsx index 1bdf67e01..0d784af9e 100644 --- a/src/components/Grants/CategoryItem.tsx +++ b/src/components/Grants/CategoryItem.tsx @@ -1,12 +1,12 @@ import React, { useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Card } from 'decentraland-ui/dist/components/Card/Card' import snakeCase from 'lodash/snakeCase' import { NewGrantCategory } from '../../entities/Grant/types' import { getNewGrantsCategoryIcon } from '../../entities/Grant/utils' import { CategoryIconVariant } from '../../helpers/styles' +import useFormatMessage from '../../hooks/useFormatMessage' interface Props { category: NewGrantCategory diff --git a/src/components/Grants/CategorySelector.tsx b/src/components/Grants/CategorySelector.tsx index 09bcab248..a5dcd3e41 100644 --- a/src/components/Grants/CategorySelector.tsx +++ b/src/components/Grants/CategorySelector.tsx @@ -1,9 +1,9 @@ import React from 'react' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { NewGrantCategory, VALID_CATEGORIES } from '../../entities/Grant/types' +import useFormatMessage from '../../hooks/useFormatMessage' import CategoryItem from './CategoryItem' import './CategorySelector.css' diff --git a/src/components/Grants/Current/BudgetBanner.tsx b/src/components/Grants/Current/BudgetBanner.tsx index 170c615f1..5ad9ba7f6 100644 --- a/src/components/Grants/Current/BudgetBanner.tsx +++ b/src/components/Grants/Current/BudgetBanner.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from 'react' +import { useIntl } from 'react-intl' import classNames from 'classnames' -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' import snakeCase from 'lodash/snakeCase' import { GrantStatus, ProposalGrantCategory } from '../../../entities/Grant/types' @@ -9,6 +9,7 @@ import { PROPOSAL_GRANT_CATEGORY_ALL } from '../../../entities/Proposal/types' import { CURRENCY_FORMAT_OPTIONS } from '../../../helpers' import { CategoryIconVariant } from '../../../helpers/styles' import useBudgetByCategory from '../../../hooks/useBudgetByCategory' +import useFormatMessage from '../../../hooks/useFormatMessage' import { getCategoryIcon } from '../../Category/CategoryOption' import ProgressBar from '../../Common/ProgressBar' import { Counter } from '../../Search/CategoryFilter' diff --git a/src/components/Grants/Current/CurrentGrantsBanner.tsx b/src/components/Grants/Current/CurrentGrantsBanner.tsx index 50d2b11f2..ad8c48904 100644 --- a/src/components/Grants/Current/CurrentGrantsBanner.tsx +++ b/src/components/Grants/Current/CurrentGrantsBanner.tsx @@ -1,8 +1,8 @@ import React, { useMemo } from 'react' import classNames from 'classnames' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' +import useFormatMessage from '../../../hooks/useFormatMessage' import BannerItem from '../BannerItem' import './CurrentGrantsBanner.css' diff --git a/src/components/Grants/Current/CurrentGrantsCategoryFilters.tsx b/src/components/Grants/Current/CurrentGrantsCategoryFilters.tsx index 7d4045afe..54a789378 100644 --- a/src/components/Grants/Current/CurrentGrantsCategoryFilters.tsx +++ b/src/components/Grants/Current/CurrentGrantsCategoryFilters.tsx @@ -1,11 +1,11 @@ import React, { useRef, useState } from 'react' import Flickity from 'react-flickity-component' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media/Media' import { OldGrantCategory, ProposalGrantCategory } from '../../../entities/Grant/types' import { GrantWithUpdate, PROPOSAL_GRANT_CATEGORY_ALL } from '../../../entities/Proposal/types' +import useFormatMessage from '../../../hooks/useFormatMessage' import FilterButton from '../FilterButton' import './CurrentGrantsCategoryFilters.css' diff --git a/src/components/Grants/Current/CurrentGrantsList.tsx b/src/components/Grants/Current/CurrentGrantsList.tsx index a4668a063..1f6f4fb50 100644 --- a/src/components/Grants/Current/CurrentGrantsList.tsx +++ b/src/components/Grants/Current/CurrentGrantsList.tsx @@ -1,7 +1,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react' -import { navigate } from '@gatsbyjs/reach-router' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' +import { navigate } from '@reach/router' import { Container } from 'decentraland-ui/dist/components/Container/Container' import filter from 'lodash/filter' import isEmpty from 'lodash/isEmpty' @@ -10,6 +9,7 @@ import orderBy from 'lodash/orderBy' import { GrantStatus, NewGrantCategory, OldGrantCategory, ProposalGrantCategory } from '../../../entities/Grant/types' import { GrantWithUpdate, PROPOSAL_GRANT_CATEGORY_ALL } from '../../../entities/Proposal/types' import { useCurrentGrantsFilteredByCategory } from '../../../hooks/useCurrentsGrantsFilteredByCategory' +import useFormatMessage from '../../../hooks/useFormatMessage' import locations from '../../../utils/locations' import Empty, { ActionType } from '../../Common/Empty' import FullWidthButton from '../../Common/FullWidthButton' diff --git a/src/components/Grants/Current/CurrentGrantsSortingMenu.tsx b/src/components/Grants/Current/CurrentGrantsSortingMenu.tsx index a4753b904..45c08c220 100644 --- a/src/components/Grants/Current/CurrentGrantsSortingMenu.tsx +++ b/src/components/Grants/Current/CurrentGrantsSortingMenu.tsx @@ -1,8 +1,9 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Dropdown } from 'decentraland-ui/dist/components/Dropdown/Dropdown' +import useFormatMessage from '../../../hooks/useFormatMessage' + export enum SortingKey { CreatedAt = 'created_at', UpdateTimestamp = 'update_timestamp', diff --git a/src/components/Grants/GrantBeneficiaryItem.tsx b/src/components/Grants/GrantBeneficiaryItem.tsx index 31f5cd4e0..c27621029 100644 --- a/src/components/Grants/GrantBeneficiaryItem.tsx +++ b/src/components/Grants/GrantBeneficiaryItem.tsx @@ -1,16 +1,17 @@ import React from 'react' +import { useIntl } from 'react-intl' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { Card } from 'decentraland-ui/dist/components/Card/Card' import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media' import { TransparencyGrantsTiers } from '../../clients/DclData' import { Grant } from '../../entities/Proposal/types' import { isProposalInCliffPeriod } from '../../entities/Proposal/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import { abbreviateTimeDifference, formatDate } from '../../utils/date/Time' import locations from '../../utils/locations' +import Link from '../Common/Link' import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline' import Username from '../User/Username' diff --git a/src/components/Grants/GrantCard/CliffNotice.tsx b/src/components/Grants/GrantCard/CliffNotice.tsx index 9785920b6..01379ae81 100644 --- a/src/components/Grants/GrantCard/CliffNotice.tsx +++ b/src/components/Grants/GrantCard/CliffNotice.tsx @@ -1,8 +1,7 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { CLIFF_PERIOD_IN_DAYS } from '../../../entities/Proposal/utils' +import useFormatMessage from '../../../hooks/useFormatMessage' import Time from '../../../utils/date/Time' import DateTooltip from '../../Common/DateTooltip' import InfoCircle from '../../Icon/InfoCircle' diff --git a/src/components/Grants/GrantCard/CliffProgress.tsx b/src/components/Grants/GrantCard/CliffProgress.tsx index 324240bbb..27006188f 100644 --- a/src/components/Grants/GrantCard/CliffProgress.tsx +++ b/src/components/Grants/GrantCard/CliffProgress.tsx @@ -1,9 +1,8 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { CLIFF_PERIOD_IN_DAYS } from '../../../entities/Proposal/utils' import { getRoundedPercentage } from '../../../helpers' +import useFormatMessage from '../../../hooks/useFormatMessage' import Time from '../../../utils/date/Time' import '../../Modal/VotingPowerDelegationDetail/VotingPowerDistribution.css' diff --git a/src/components/Grants/GrantCard/GrantCard.tsx b/src/components/Grants/GrantCard/GrantCard.tsx index b167a60bc..b3f0e84c5 100644 --- a/src/components/Grants/GrantCard/GrantCard.tsx +++ b/src/components/Grants/GrantCard/GrantCard.tsx @@ -1,11 +1,11 @@ import React, { useState } from 'react' import classNames from 'classnames' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { GrantWithUpdate } from '../../../entities/Proposal/types' import { isProposalInCliffPeriod } from '../../../entities/Proposal/utils' import locations from '../../../utils/locations' +import Link from '../../Common/Link' import ProposalUpdate from '../../Proposal/Update/ProposalUpdate' import CliffProgress from './CliffProgress' diff --git a/src/components/Grants/GrantCard/GrantCardHeader.tsx b/src/components/Grants/GrantCard/GrantCardHeader.tsx index f9713d7b4..3198597de 100644 --- a/src/components/Grants/GrantCard/GrantCardHeader.tsx +++ b/src/components/Grants/GrantCard/GrantCardHeader.tsx @@ -1,8 +1,8 @@ import React from 'react' - -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' +import { useIntl } from 'react-intl' import { GrantWithUpdate } from '../../../entities/Proposal/types' +import useFormatMessage from '../../../hooks/useFormatMessage' import Username from '../../User/Username' import GrantPill from '../GrantPill' diff --git a/src/components/Grants/GrantCard/ProgressBarTooltip.tsx b/src/components/Grants/GrantCard/ProgressBarTooltip.tsx index 5e6613b4b..a59ebf94f 100644 --- a/src/components/Grants/GrantCard/ProgressBarTooltip.tsx +++ b/src/components/Grants/GrantCard/ProgressBarTooltip.tsx @@ -1,10 +1,11 @@ import React from 'react' +import { useIntl } from 'react-intl' -import useFormatMessage, { useIntl } from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Popup } from 'decentraland-ui/dist/components/Popup/Popup' import { Grant } from '../../../entities/Proposal/types' import { CLIFF_PERIOD_IN_DAYS } from '../../../entities/Proposal/utils' +import useFormatMessage from '../../../hooks/useFormatMessage' import Time, { formatDate } from '../../../utils/date/Time' interface Props { diff --git a/src/components/Grants/GrantCard/VestingProgress.tsx b/src/components/Grants/GrantCard/VestingProgress.tsx index 06cffc81b..39f521b94 100644 --- a/src/components/Grants/GrantCard/VestingProgress.tsx +++ b/src/components/Grants/GrantCard/VestingProgress.tsx @@ -1,9 +1,9 @@ import React from 'react' import classNames from 'classnames' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Grant } from '../../../entities/Proposal/types' +import useFormatMessage from '../../../hooks/useFormatMessage' import Time from '../../../utils/date/Time' import '../../Modal/VotingPowerDelegationDetail/VotingPowerDistribution.css' diff --git a/src/components/Grants/GrantsPastItem.tsx b/src/components/Grants/GrantsPastItem.tsx index 19095fb84..44cc45f4a 100644 --- a/src/components/Grants/GrantsPastItem.tsx +++ b/src/components/Grants/GrantsPastItem.tsx @@ -1,13 +1,12 @@ import React, { useCallback } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl' import { Table } from 'decentraland-ui/dist/components/Table/Table' import { ProposalGrantCategory } from '../../entities/Grant/types' import { Grant } from '../../entities/Proposal/types' +import useFormatMessage from '../../hooks/useFormatMessage' import Time from '../../utils/date/Time' -import locations from '../../utils/locations' +import locations, { navigate } from '../../utils/locations' import ChevronRight from '../Icon/ChevronRight' import GrantPill from './GrantPill' diff --git a/src/components/Grants/RequestBanner.tsx b/src/components/Grants/RequestBanner.tsx index fe64eea9d..b5ffa3e31 100644 --- a/src/components/Grants/RequestBanner.tsx +++ b/src/components/Grants/RequestBanner.tsx @@ -1,11 +1,10 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl/utils' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { ProposalType } from '../../entities/Proposal/types' -import locations from '../../utils/locations' +import useFormatMessage from '../../hooks/useFormatMessage' +import locations, { navigate } from '../../utils/locations' import './RequestBanner.css' diff --git a/src/components/Home/ActiveCommunityGrants.tsx b/src/components/Home/ActiveCommunityGrants.tsx index 30d737de4..a7719193a 100644 --- a/src/components/Home/ActiveCommunityGrants.tsx +++ b/src/components/Home/ActiveCommunityGrants.tsx @@ -1,8 +1,8 @@ import React from 'react' import classNames from 'classnames' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' +import useFormatMessage from '../../hooks/useFormatMessage' import useGrants from '../../hooks/useGrants' import locations from '../../utils/locations' import FullWidthButton from '../Common/FullWidthButton' diff --git a/src/components/Home/BottomBanner/BottomBanner.tsx b/src/components/Home/BottomBanner/BottomBanner.tsx index 8a63f1ddb..80b10ba73 100644 --- a/src/components/Home/BottomBanner/BottomBanner.tsx +++ b/src/components/Home/BottomBanner/BottomBanner.tsx @@ -1,10 +1,9 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' - import { DAO_DISCORD_URL, FORUM_URL, NEWSLETTER_URL } from '../../../constants' import { ProposalStatus, ProposalType } from '../../../entities/Proposal/types' import useAbbreviatedFormatter from '../../../hooks/useAbbreviatedFormatter' +import useFormatMessage from '../../../hooks/useFormatMessage' import useProposals from '../../../hooks/useProposals' import useTransparency from '../../../hooks/useTransparency' import Discord from '../../Icon/Discord' diff --git a/src/components/Home/Charts.tsx b/src/components/Home/Charts.tsx index 7d93bfc35..23813156e 100644 --- a/src/components/Home/Charts.tsx +++ b/src/components/Home/Charts.tsx @@ -1,10 +1,10 @@ import React, { useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Card } from 'decentraland-ui/dist/components/Card/Card' import { Header } from 'decentraland-ui/dist/components/Header/Header' import { Tabs } from 'decentraland-ui/dist/components/Tabs/Tabs' +import useFormatMessage from '../../hooks/useFormatMessage' import useParticipatingVP from '../../hooks/useParticipatingVP' import useVotesPerProposal from '../../hooks/useVotesPerProposal' import LineChart from '../Charts/LineChart' diff --git a/src/components/Home/CommunityEngagement.tsx b/src/components/Home/CommunityEngagement.tsx index befc05952..fba7bb0d6 100644 --- a/src/components/Home/CommunityEngagement.tsx +++ b/src/components/Home/CommunityEngagement.tsx @@ -1,8 +1,9 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Header } from 'decentraland-ui/dist/components/Header/Header' +import useFormatMessage from '../../hooks/useFormatMessage' + import Charts from './Charts' import './CommunityEngagement.css' import TopVoters from './TopVoters' diff --git a/src/components/Home/DaoDelegates.tsx b/src/components/Home/DaoDelegates.tsx index e15768c88..304831afe 100644 --- a/src/components/Home/DaoDelegates.tsx +++ b/src/components/Home/DaoDelegates.tsx @@ -1,10 +1,10 @@ import React, { useState } from 'react' import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { CANDIDATE_ADDRESSES } from '../../constants' import useDelegatesInfo from '../../hooks/useDelegatesInfo' +import useFormatMessage from '../../hooks/useFormatMessage' import useVotingPowerDistribution from '../../hooks/useVotingPowerDistribution' import FullWidthButton from '../Common/FullWidthButton' import DelegatesTable from '../Delegation/DelegatesTable' diff --git a/src/components/Home/MainBanner.tsx b/src/components/Home/MainBanner.tsx index b67fa5169..b05a72436 100644 --- a/src/components/Home/MainBanner.tsx +++ b/src/components/Home/MainBanner.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { DAO_DISCORD_URL, DOCS_URL } from '../../constants' +import useFormatMessage from '../../hooks/useFormatMessage' +import Link from '../Common/Link' import CloseCircle from '../Icon/CloseCircle' import './MainBanner.css' diff --git a/src/components/Home/MetricsCard.tsx b/src/components/Home/MetricsCard.tsx index a2e9793b5..96a1429f0 100644 --- a/src/components/Home/MetricsCard.tsx +++ b/src/components/Home/MetricsCard.tsx @@ -1,8 +1,9 @@ import React from 'react' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { Card } from 'decentraland-ui/dist/components/Card/Card' +import Link from '../Common/Link' + import HomeLoader from './HomeLoader' import './MetricsCard.css' diff --git a/src/components/Home/MetricsCards.tsx b/src/components/Home/MetricsCards.tsx index 4a4e8fb4a..3e83b6d39 100644 --- a/src/components/Home/MetricsCards.tsx +++ b/src/components/Home/MetricsCards.tsx @@ -1,10 +1,10 @@ import React, { useMemo } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Container } from 'decentraland-ui/dist/components/Container/Container' import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media' import { ProposalStatus } from '../../entities/Proposal/types' +import useFormatMessage from '../../hooks/useFormatMessage' import useProposals from '../../hooks/useProposals' import useTransparency from '../../hooks/useTransparency' import useVotesCountByDate from '../../hooks/useVotesCountByDate' diff --git a/src/components/Home/OpenProposal.tsx b/src/components/Home/OpenProposal.tsx index c885f4784..8bd9dd69c 100644 --- a/src/components/Home/OpenProposal.tsx +++ b/src/components/Home/OpenProposal.tsx @@ -1,18 +1,18 @@ import React, { useMemo } from 'react' import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { Link } from 'decentraland-gatsby/dist/plugins/intl' import { Mobile } from 'decentraland-ui/dist/components/Media/Media' import isEmpty from 'lodash/isEmpty' import { ProposalAttributes } from '../../entities/Proposal/types' import { calculateResult } from '../../entities/Votes/utils' +import useFormatMessage from '../../hooks/useFormatMessage' import useProposalComments from '../../hooks/useProposalComments' import useProposalVotes from '../../hooks/useProposalVotes' import Time from '../../utils/date/Time' import locations from '../../utils/locations' import CategoryPill from '../Category/CategoryPill' +import Link from '../Common/Link' import ChevronRight from '../Icon/ChevronRight' import Username from '../User/Username' diff --git a/src/components/Home/OpenProposals.tsx b/src/components/Home/OpenProposals.tsx index 982ff7ba4..c858b65c1 100644 --- a/src/components/Home/OpenProposals.tsx +++ b/src/components/Home/OpenProposals.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import isEmpty from 'lodash/isEmpty' import { ProposalAttributes } from '../../entities/Proposal/types' +import useFormatMessage from '../../hooks/useFormatMessage' import useProposalsByParticipatingVP from '../../hooks/useProposalsByParticipatingVP' import Time from '../../utils/date/Time' import locations from '../../utils/locations' diff --git a/src/components/Home/TopVoters.tsx b/src/components/Home/TopVoters.tsx index adfefaca4..be3ca73e3 100644 --- a/src/components/Home/TopVoters.tsx +++ b/src/components/Home/TopVoters.tsx @@ -1,11 +1,11 @@ import React from 'react' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' import { Card } from 'decentraland-ui/dist/components/Card/Card' import { Header } from 'decentraland-ui/dist/components/Header/Header' import { Table } from 'decentraland-ui/dist/components/Table/Table' import { VOTES_VP_THRESHOLD } from '../../constants' +import useFormatMessage from '../../hooks/useFormatMessage' import useTopVoters from '../../hooks/useTopVoters' import Helper from '../Helper/Helper' diff --git a/src/components/Layout/BurgerMenu/MobileNavigation.tsx b/src/components/Layout/BurgerMenu/MobileNavigation.tsx index 239a0ec04..ee193bf15 100644 --- a/src/components/Layout/BurgerMenu/MobileNavigation.tsx +++ b/src/components/Layout/BurgerMenu/MobileNavigation.tsx @@ -1,13 +1,12 @@ import React from 'react' -import Link from 'decentraland-gatsby/dist/components/Text/Link' -import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl' import prevent from 'decentraland-gatsby/dist/utils/react/prevent' import { Button } from 'decentraland-ui/dist/components/Button/Button' import { Header } from 'decentraland-ui/dist/components/Header/Header' -import locations from '../../../utils/locations' +import useFormatMessage from '../../../hooks/useFormatMessage' +import locations, { navigate } from '../../../utils/locations' +import Link from '../../Common/Link' import { NavigationProps, NavigationTab } from '../Navigation' import './MobileNavigation.css' diff --git a/src/components/Layout/ContentLayout.tsx b/src/components/Layout/ContentLayout.tsx index 4fa8c7c17..2000df389 100644 --- a/src/components/Layout/ContentLayout.tsx +++ b/src/components/Layout/ContentLayout.tsx @@ -1,12 +1,11 @@ import React from 'react' import classNames from 'classnames' -import { navigate } from 'decentraland-gatsby/dist/plugins/intl' import { Back } from 'decentraland-ui/dist/components/Back/Back' import { Container } from 'decentraland-ui/dist/components/Container/Container' import usePreventNavigation from '../../hooks/usePreventNavigation' -import locations from '../../utils/locations' +import locations, { navigate } from '../../utils/locations' import './ContentLayout.css' diff --git a/src/components/Layout/Layout.tsx b/src/components/Layout/Layout.tsx index 3b73fe6c9..b09814dc3 100644 --- a/src/components/Layout/Layout.tsx +++ b/src/components/Layout/Layout.tsx @@ -2,14 +2,10 @@ import React from 'react' import { ChainId } from '@dcl/schemas/dist/dapps/chain-id' import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext' -import { changeLocale } from 'decentraland-gatsby/dist/plugins/intl' -import { DecentralandIntlContext } from 'decentraland-gatsby/dist/plugins/intl/types' import env from 'decentraland-gatsby/dist/utils/env' import { Footer } from 'decentraland-ui/dist/components/Footer/Footer' -import { Locale } from 'decentraland-ui/dist/components/LanguageIcon/LanguageIcon' import { Navbar, NavbarProps } from 'decentraland-ui/dist/components/Navbar/Navbar' import type { PageProps } from 'gatsby' -import type { DropdownProps } from 'semantic-ui-react/dist/commonjs/modules/Dropdown' import WalletSelectorModal from '../Modal/WalletSelectorModal' import WrongNetworkModal from '../Modal/WrongNetworkModal' @@ -27,21 +23,12 @@ export function getSupportedChainIds(): ChainId[] { export type LayoutProps = Omit & { rightMenu: NavbarProps['rightMenu'] - pageContext?: { - intl?: DecentralandIntlContext - } children?: React.ReactNode } -export default function Layout({ children, pageContext, ...props }: LayoutProps) { - const locale = pageContext?.intl?.locale || 'en' - const locales = pageContext?.intl?.locales || ['en'] +export default function Layout({ children, ...props }: LayoutProps) { const [, state] = useAuthContext() - const handleChangeLocal = function (_: React.SyntheticEvent, data: DropdownProps) { - changeLocale(data.value as string) - } - const handleClickMenuOption = function (event: React.MouseEvent, section: string) { if (!event.defaultPrevented) { return { @@ -72,12 +59,7 @@ export default function Layout({ children, pageContext, ...props }: LayoutProps) onConnect={(providerType, chainId) => state.connect(providerType, chainId)} onClose={() => state.select(false)} /> -