From 4228dc0127f3ed5f2465a26c1c281f5c61391d65 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Wed, 11 Sep 2024 00:01:04 +0500 Subject: [PATCH 1/6] added new navigation and updated tests accordingly --- .env.example | 1 + .github/workflows/e2e-tests.yml | 3 +- README.md | 3 + cypress/e2e/userIsAbleToUseTheSidebar.cy.js | 24 +- cypress/support/commands.js | 10 +- src/atomicui/atoms/List/List.tsx | 96 ++- src/atomicui/organisms/Explore/Explore.tsx | 624 ++++++++++++++---- .../organisms/Sidebar/Sidebar.test.tsx | 5 + src/atomicui/organisms/Sidebar/styles.scss | 81 ++- src/core/constants/appConfig.ts | 30 +- .../constants/marketingMenuOptionsData.ts | 303 +++++++-- src/locales/ar/ar.json | 43 +- src/locales/de/de.json | 43 +- src/locales/en/en.json | 43 +- src/locales/es/es.json | 43 +- src/locales/fr/fr.json | 43 +- src/locales/he/he.json | 41 +- src/locales/hi/hi.json | 41 +- src/locales/it/it.json | 43 +- src/locales/ja/ja.json | 41 +- src/locales/ko/ko.json | 39 ++ src/locales/pt-BR/pt-BR.json | 43 +- src/locales/zh-CN/zh-CN.json | 41 +- src/locales/zh-TW/zh-TW.json | 43 +- src/setupTests.ts | 30 +- src/theme/styles/rootVars.scss | 2 + src/types/MenuTypes.ts | 11 + src/types/index.ts | 1 + 28 files changed, 1486 insertions(+), 285 deletions(-) create mode 100644 src/types/MenuTypes.ts diff --git a/.env.example b/.env.example index 26d1fddd..efe7258e 100644 --- a/.env.example +++ b/.env.example @@ -12,6 +12,7 @@ VITE_MIGRATE_AN_ANDROID_APP_PAGE=1 VITE_MIGRATE_AN_IOS_APP_PAGE=1 VITE_MIGRATE_A_WEB_SERVICE_PAGE=1 VITE_PRICING_PAGE=1 +VITE_SHOW_NEW_NAVIGATION=1 # optional VITE_NL_BASE_URL=https://XXXXXXXXXX.execute-api.XX-XXXX-X.amazonaws.com/api diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 2d8e2871..7c0bcf98 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -38,6 +38,7 @@ jobs: echo "VITE_MIGRATE_A_WEB_SERVICE_PAGE=${{ secrets.VITE_MIGRATE_A_WEB_SERVICE_PAGE }}" >> .env echo "VITE_PRICING_PAGE=${{ secrets.VITE_PRICING_PAGE }}" >> .env echo "VITE_CUSTOM_ASSETS_URL=${{ secrets.VITE_CUSTOM_ASSETS_URL }}" >> .env + echo "VITE_SHOW_NEW_NAVIGATION=${{ secrets.VITE_SHOW_NEW_NAVIGATION }}" >> .env - name: Install dependencies run: npm install @@ -51,8 +52,6 @@ jobs: - name: Run cypress tests env: CYPRESS_WEB_DOMAIN: ${{ secrets.WEB_DOMAIN }} - CYPRESS_WEB_DOMAIN_USERNAME: ${{ secrets.WEB_DOMAIN_USERNAME }} - CYPRESS_WEB_DOMAIN_PASSWORD: ${{ secrets.WEB_DOMAIN_PASSWORD }} CYPRESS_IDENTITY_POOL_ID: ${{ secrets.IDENTITY_POOL_ID }} CYPRESS_USER_DOMAIN: ${{ secrets.USER_DOMAIN }} CYPRESS_USER_POOL_CLIENT_ID: ${{ secrets.USER_POOL_CLIENT_ID }} diff --git a/README.md b/README.md index 1fef0677..3b49625c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ 3. Value for `VITE_AWS_CF_TEMPLATE`, `VITE_APPLE_APP_STORE_LINK`, `VITE_GOOGLE_PLAY_STORE_LINK` can be added as it is to `.env` file from `.env.examples`. 4. Value for `VITE_APP_VERSION` needs to be populated with the correct version at the time of deployment in the following format `2.1.0`. 5. Values for `VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE`, `VITE_MIGRATE_A_WEB_APP_PAGE`, `VITE_MIGRATE_AN_ANDROID_APP_PAGE`, `VITE_MIGRATE_AN_IOS_APP_PAGE`, `VITE_MIGRATE_A_WEB_SERVICE_PAGE` and `VITE_PRICING_PAG` can either be `1` or `0` to either enable or disable the respective pages. +6. Values for `VITE_SHOW_NEW_NAVIGATION` can either be `1` or `0` to either enable or disable the new navigation, turning it off would should the current navigation instead. #### Env keys required in `.env` file, see `.env.example` for reference @@ -29,6 +30,7 @@ > VITE_MIGRATE_AN_IOS_APP_PAGE
> VITE_MIGRATE_A_WEB_SERVICE_PAGE
> VITE_PRICING_PAGE
+> VITE_SHOW_NEW_NAVIGATION
#### Env keys optional in `.env` file, see `.env.example` for reference > VITE_NL_BASE_URL
@@ -108,6 +110,7 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. > VITE_MIGRATE_A_WEB_SERVICE_PAGE > VITE_PRICING_PAGE > VITE_CUSTOM_ASSETS_URL +> VITE_SHOW_NEW_NAVIGATION ``` #### `npm run cypress` diff --git a/cypress/e2e/userIsAbleToUseTheSidebar.cy.js b/cypress/e2e/userIsAbleToUseTheSidebar.cy.js index a1666308..b15a714a 100644 --- a/cypress/e2e/userIsAbleToUseTheSidebar.cy.js +++ b/cypress/e2e/userIsAbleToUseTheSidebar.cy.js @@ -7,11 +7,15 @@ describe("Sidebar", () => { cy.visitDomain(`${Cypress.env("WEB_DOMAIN")}/demo`); cy.get('[data-testid="hamburger-menu"]').click(); cy.get("div") - .should("contain", "Demo") - .and("contain", "Geofence") - .and("contain", "Tracker") - .and("contain", "Settings") - .and("contain", "Samples"); + .should("contain", "Samples") + .and("contain", "Migration") + .and("contain", "Overview") + .and("contain", "Products") + .and("contain", "Getting Started") + .and("contain", "Pricing") + .and("contain", "FAQs") + .and("contain", "Industry") + .and("contain", "Resources"); }); }); @@ -29,10 +33,16 @@ describe("Sidebar", () => { cy.get('[data-testid="iconic-info-card-title"]') .should("contain", "Samples") .and("contain", "Migration") - .and("contain", "Pricing") .and("contain", "Settings") .and("contain", "About") - .and("contain", "Provide Feedback"); + .and("contain", "Provide Feedback") + .and("contain", "Overview") + .and("contain", "Products") + .and("contain", "Getting Started") + .and("contain", "Pricing") + .and("contain", "FAQs") + .and("contain", "Industry") + .and("contain", "Resources"); } ); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 08dfe896..9c7c088d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -7,15 +7,7 @@ Cypress.Commands.add("visitDomain", domain => { }); if (typeof domain === "string") { - domain.includes("dev") - ? cy.visit(domain, { - auth: { - username: Cypress.env("WEB_DOMAIN_USERNAME"), - password: Cypress.env("WEB_DOMAIN_PASSWORD") - } - }) - : cy.visit(domain); - + cy.visit(domain); cy.wait(10000); cy.get('[data-testid="welcome-modal-continue-button"]').click(); } diff --git a/src/atomicui/atoms/List/List.tsx b/src/atomicui/atoms/List/List.tsx index 3d15d661..43e033f0 100644 --- a/src/atomicui/atoms/List/List.tsx +++ b/src/atomicui/atoms/List/List.tsx @@ -1,15 +1,20 @@ /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. */ /* SPDX-License-Identifier: MIT-0 */ -import { FC, ReactNode } from "react"; +import { FC, ReactNode, useState } from "react"; import { Flex, Link, Text, View, ViewProps } from "@aws-amplify/ui-react"; import { IconArrow } from "@demo/assets/svgs"; +import { appConfig } from "@demo/core/constants"; import { uuid } from "@demo/utils/uuid"; import { omit } from "ramda"; import { useTranslation } from "react-i18next"; import { NavLink } from "react-router-dom"; +const { + ENV: { SHOW_NEW_NAVIGATION } +} = appConfig; + interface ListArr { label: string; link?: string; @@ -46,27 +51,36 @@ const LinkWrapper: React.FC = ({ }) => { if (isExternalLink) { return ( - + {children} + {hasSubMenuItems && ( + + )} ); - } + } else { + const currentSplitHref = window.location.href.split("/"); - return ( - - `${className} navigation-link ${isActive && linkTo !== "#" ? "amplify-text isActive" : "amplify-text"}` - } - style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }} - target="_self" - > - {children} - {hasSubMenuItems && ( - - )} - - ); + return ( + + `${className} navigation-link ${isActive && linkTo !== "#" ? "amplify-text isActive" : "amplify-text"}` + } + style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }} + target="_self" + > + {children} + {hasSubMenuItems && ( + + )} + + ); + } }; const List: FC = ({ @@ -76,6 +90,7 @@ const List: FC = ({ hideIcons = false, ...props }) => { + const [pos, setPos] = useState(null); const { t } = useTranslation(); let ulClass = props.className; @@ -91,39 +106,56 @@ const List: FC = ({ return ( - {listArray.map(item => { - const isExternalLink = checkIfExternalLink(item?.link || "#"); - const hasSubMenuItems = !!item.subMenu?.length; + {listArray.map(({ link, subMenu, label, iconContainerClass, iconBeforeLink }) => { + const isExternalLink = checkIfExternalLink(link || "#"); + const hasSubMenuItems = !!subMenu?.length; return ( -
  • +
  • hasSubMenuItems && setPos(subMenu.length > 5 ? e.clientY - 100 : e.clientY - 50)} + onMouseLeave={() => hasSubMenuItems && setPos(null)} + > {hideIcons ? null : ( - - + + )} - {labelIsIcon ? : t(item.label)} + {labelIsIcon ? : t(label)} - {hasSubMenuItems && ( + {hasSubMenuItems && !SHOW_NEW_NAVIGATION && ( - {item.subMenu?.map((subMenuItem, index) => ( + {subMenu.map(({ link, isExternalLink, label }, idx) => ( - {t(subMenuItem.label)} + {t(label)} ))} )} + {hasSubMenuItems && SHOW_NEW_NAVIGATION && ( + + + {subMenu.map(({ link, isExternalLink, label }, idx) => ( + + {t(label)} + + ))} + + + )}
  • ); })} diff --git a/src/atomicui/organisms/Explore/Explore.tsx b/src/atomicui/organisms/Explore/Explore.tsx index b3a8be1f..5c0cf30a 100644 --- a/src/atomicui/organisms/Explore/Explore.tsx +++ b/src/atomicui/organisms/Explore/Explore.tsx @@ -50,7 +50,8 @@ const { MIGRATE_AN_ANDROID_APP_PAGE, MIGRATE_AN_IOS_APP_PAGE, MIGRATE_A_WEB_SERVICE_PAGE, - PRICING_PAGE + PRICING_PAGE, + SHOW_NEW_NAVIGATION }, ROUTES: { SAMPLES, @@ -60,10 +61,31 @@ const { MIGRATE_AN_IOS_APP, MIGRATE_A_WEB_SERVICE, PRICING + }, + LINKS: { + LEARN_MORE_URL, + AWS_LOCATION_MAPS_URL, + AWS_LOCATION_PLACES_URL, + AWS_LOCATION_ROUTES_URL, + AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, + AWS_GETTING_STARTED_URL, + AWS_PRICING_URL, + AWS_FAQ_URL, + // AWS_LOCATION_INDUSTRY_URL, + AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, + AWS_LOCATION_FINANCIAL_SERVICE_URL, + AWS_LOCATION_HEALTHCARE_URL, + AWS_LOCATION_RETAILS_URL, + AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, + AWS_LOCATION_REAL_ESTATE_URL, + // AWS_LOCATION_RESOURCES_URL, + AWS_LOCATION_CUSTOMERS_URL, + AWS_LOCATION_PRODUCT_RESOURCES_URL, + AWS_LOCATION_DEVELOPER_RESOURCES_URL } } = appConfig; -interface IProps { +interface ExploreProps { updateUIInfo: (ui: ResponsiveUIEnum) => void; onCloseSidebar: () => void; onOpenConnectAwsAccountModal: () => void; @@ -80,7 +102,7 @@ interface IProps { bottomSheetRef?: MutableRefObject; } -const Explore: FC = ({ +const Explore: FC = ({ updateUIInfo, onCloseSidebar, onOpenConnectAwsAccountModal, @@ -96,7 +118,12 @@ const Explore: FC = ({ onshowUnauthSimulationDisclaimerModal, bottomSheetRef }) => { - const [isMigrationMenuExapnded, setIsMigrationMenuExapnded] = useState(false); + const [isMenuExapnded, setIsMenuExapnded] = useState<{ [key: string]: boolean }>({ + "migration.text": false, + "header__product.text": false, + "industry.text": false, + "resources.text": false + }); const { t, i18n } = useTranslation(); const currentLanguage = i18n.language; const langDir = i18n.dir(); @@ -264,160 +291,485 @@ const Explore: FC = ({ ); const exploreMoreOptions = useMemo( - () => [ - { - title: t("samples.text"), - description: t("settings_modal_option__samples.text"), - onClickHandler: () => navigate(SAMPLES), - isEnabled: true - }, - { - title: t("migration.text"), - description: t("migration_desc.text"), - onClickHandler: () => setIsMigrationMenuExapnded(!isMigrationMenuExapnded), - isEnabled: - !!parseInt(MIGRATE_FROM_GOOGLE_MAPS_PAGE) || - !!parseInt(MIGRATE_A_WEB_APP_PAGE) || - !!parseInt(MIGRATE_AN_ANDROID_APP_PAGE) || - !!parseInt(MIGRATE_AN_IOS_APP_PAGE) || - !!parseInt(MIGRATE_A_WEB_SERVICE_PAGE), - subMenu: [ - { - title: t("header__overview.text"), - description: t("migrate_from_google_maps.text"), - onClickHandler: () => navigate(MIGRATE_FROM_GOOGLE_MAPS), - isEnabled: !!parseInt(MIGRATE_FROM_GOOGLE_MAPS_PAGE), - iconComponent: ( - - ) - }, - { - title: t("web_app.text"), - description: t("migrate_a_web_app.text"), - onClickHandler: () => navigate(MIGRATE_A_WEB_APP), - isEnabled: !!parseInt(MIGRATE_A_WEB_APP_PAGE), - iconComponent: ( - - ) - }, - { - title: t("android_app.text"), - description: t("migrate_an_android_app.text"), - onClickHandler: () => navigate(MIGRATE_AN_ANDROID_APP), - isEnabled: !!parseInt(MIGRATE_AN_ANDROID_APP_PAGE), - iconComponent: ( - - ) - }, - { - title: t("ios_app.text"), - description: t("migrate_an_ios_app.text"), - onClickHandler: () => navigate(MIGRATE_AN_IOS_APP), - isEnabled: !!parseInt(MIGRATE_AN_IOS_APP_PAGE), - iconComponent: ( - - ) - }, - { - title: t("web_service.text"), - description: t("migrate_a_web_service.text"), - onClickHandler: () => navigate(MIGRATE_A_WEB_SERVICE), - isEnabled: !!parseInt(MIGRATE_A_WEB_SERVICE_PAGE), - iconComponent: ( - - ) - } - ] - }, - { - title: t("pricing.text"), - description: t("pricing_desc.text"), - onClickHandler: () => navigate(PRICING), - isEnabled: !!parseInt(PRICING_PAGE) - }, - { - title: t("settings.text"), - description: t("settings_modal_option__settings.text"), - onClickHandler: onClickSettings, - isEnabled: true - }, - { - title: t("about.text"), - description: t("settings_modal_option__about.text"), - onClickHandler: onClickMore, - isEnabled: true - }, - { - title: t("fm__provide_feedback_btn.text"), - description: t("fm__mobile_view_desc.text"), - onClickHandler: onClickFeedback, - isEnabled: true - } - ], - [isMigrationMenuExapnded, navigate, onClickFeedback, onClickMore, onClickSettings, t] + () => + !SHOW_NEW_NAVIGATION + ? [ + { + title: "samples.text", + description: "settings_modal_option__samples.text", + onClickHandler: () => navigate(SAMPLES), + isEnabled: true + }, + { + title: "migration.text", + description: "migration_desc.text", + onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "migration.text": !s["migration.text"] })), + isEnabled: + MIGRATE_FROM_GOOGLE_MAPS_PAGE || + MIGRATE_A_WEB_APP_PAGE || + MIGRATE_AN_ANDROID_APP_PAGE || + MIGRATE_AN_IOS_APP_PAGE || + MIGRATE_A_WEB_SERVICE_PAGE, + subMenu: [ + { + title: "header__overview.text", + description: "migrate_from_google_maps.text", + onClickHandler: () => navigate(MIGRATE_FROM_GOOGLE_MAPS), + isEnabled: MIGRATE_FROM_GOOGLE_MAPS_PAGE, + iconComponent: ( + + ) + }, + { + title: "web_app.text", + description: "migrate_a_web_app.text", + onClickHandler: () => navigate(MIGRATE_A_WEB_APP), + isEnabled: MIGRATE_A_WEB_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "android_app.text", + description: "migrate_an_android_app.text", + onClickHandler: () => navigate(MIGRATE_AN_ANDROID_APP), + isEnabled: MIGRATE_AN_ANDROID_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "ios_app.text", + description: "migrate_an_ios_app.text", + onClickHandler: () => navigate(MIGRATE_AN_IOS_APP), + isEnabled: MIGRATE_AN_IOS_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "web_service.text", + description: "migrate_a_web_service.text", + onClickHandler: () => navigate(MIGRATE_A_WEB_SERVICE), + isEnabled: MIGRATE_A_WEB_SERVICE_PAGE, + iconComponent: ( + + ) + } + ] + }, + { + title: "pricing.text", + description: "pricing_desc.text", + onClickHandler: () => navigate(PRICING), + isEnabled: PRICING_PAGE + }, + { + title: "settings.text", + description: "settings_modal_option__settings.text", + onClickHandler: onClickSettings, + isEnabled: true + }, + { + title: "about.text", + description: "settings_modal_option__about.text", + onClickHandler: onClickMore, + isEnabled: true + }, + { + title: "fm__provide_feedback_btn.text", + description: "fm__mobile_view_desc.text", + onClickHandler: onClickFeedback, + isEnabled: true + } + ] + : [ + { + title: "samples.text", + description: "settings_modal_option__samples.text", + onClickHandler: () => navigate(SAMPLES), + isEnabled: true + }, + { + title: "migration.text", + description: "migration_desc.text", + onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "migration.text": !s["migration.text"] })), + isEnabled: + MIGRATE_FROM_GOOGLE_MAPS_PAGE || + MIGRATE_A_WEB_APP_PAGE || + MIGRATE_AN_ANDROID_APP_PAGE || + MIGRATE_AN_IOS_APP_PAGE || + MIGRATE_A_WEB_SERVICE_PAGE, + subMenu: [ + { + title: "header__overview.text", + description: "migrate_from_google_maps.text", + onClickHandler: () => navigate(MIGRATE_FROM_GOOGLE_MAPS), + isEnabled: MIGRATE_FROM_GOOGLE_MAPS_PAGE, + iconComponent: ( + + ) + }, + { + title: "web_app.text", + description: "migrate_a_web_app.text", + onClickHandler: () => navigate(MIGRATE_A_WEB_APP), + isEnabled: MIGRATE_A_WEB_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "android_app.text", + description: "migrate_an_android_app.text", + onClickHandler: () => navigate(MIGRATE_AN_ANDROID_APP), + isEnabled: MIGRATE_AN_ANDROID_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "ios_app.text", + description: "migrate_an_ios_app.text", + onClickHandler: () => navigate(MIGRATE_AN_IOS_APP), + isEnabled: MIGRATE_AN_IOS_APP_PAGE, + iconComponent: ( + + ) + }, + { + title: "web_service.text", + description: "migrate_a_web_service.text", + onClickHandler: () => navigate(MIGRATE_A_WEB_SERVICE), + isEnabled: MIGRATE_A_WEB_SERVICE_PAGE, + iconComponent: ( + + ) + } + ] + }, + { + title: "settings.text", + description: "settings_modal_option__settings.text", + onClickHandler: onClickSettings, + isEnabled: true + }, + { + title: "about.text", + description: "settings_modal_option__about.text", + onClickHandler: onClickMore, + isEnabled: true + }, + { + title: "fm__provide_feedback_btn.text", + description: "fm__mobile_view_desc.text", + onClickHandler: onClickFeedback, + isEnabled: true + }, + { + title: "header__overview.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(LEARN_MORE_URL, "_blank"), + isEnabled: true + }, + { + title: "header__product.text", + description: "header__product_desc.text", + onClickHandler: () => + setIsMenuExapnded(s => ({ ...s, "header__product.text": !s["header__product.text"] })), + isEnabled: true, + subMenu: [ + { + title: "maps.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_MAPS_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "places.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_PLACES_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "routes.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_ROUTES_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "geofences_and_trackers.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + } + ] + }, + { + title: "footer__getting_started.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_GETTING_STARTED_URL, "_blank"), + isEnabled: true + }, + { + title: "pricing.text", + description: "pricing_desc.text", + onClickHandler: () => window.open(AWS_PRICING_URL, "_blank"), + isEnabled: true + }, + { + title: "footer__faq.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_FAQ_URL, "_blank"), + isEnabled: true + }, + { + title: "industry.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "industry.text": !s["industry.text"] })), + isEnabled: true, + subMenu: [ + { + title: "transportation_and_logistics.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "financial_service.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_FINANCIAL_SERVICE_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "healthcare.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_HEALTHCARE_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "retails.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_RETAILS_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "travel_and_hospitality.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "real_estate.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_REAL_ESTATE_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + } + ] + }, + { + title: "resources.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "resources.text": !s["resources.text"] })), + isEnabled: true, + subMenu: [ + { + title: "customers.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_CUSTOMERS_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "product_resources.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_PRODUCT_RESOURCES_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + }, + { + title: "developer_resources.text", + description: "Lorem epsom dolor sit amet", + onClickHandler: () => window.open(AWS_LOCATION_DEVELOPER_RESOURCES_URL, "_blank"), + isEnabled: true, + iconComponent: ( + + ) + } + ] + } + ], + [navigate, onClickFeedback, onClickMore, onClickSettings] ); const renderExploreMoreOptions = useMemo(() => { - return exploreMoreOptions.map((option, idx) => { - if (option.isEnabled) { - if (option.subMenu?.length) { + return exploreMoreOptions.map(({ isEnabled, subMenu, title, description, onClickHandler }, idx) => { + if (isEnabled) { + if (subMenu?.length) { return ( + } - title={option.title} - titleColor={isMigrationMenuExapnded ? "var(--primary-color)" : ""} - description={option.description} + title={t(title)} + titleColor={isMenuExapnded[title] ? "var(--primary-color)" : ""} + description={t(description)} cardMargin={ idx === 0 && (!isUserAwsAccountConnected || !isAuthenticated) ? "2rem 0 0.923rem 0" : "0.923rem 0" } direction="row-reverse" cardAlignItems="center" - onClickHandler={option.onClickHandler} + onClickHandler={onClickHandler} style={{ padding: "0 1rem" }} /> - {isMigrationMenuExapnded && - option.subMenu.map((subOption, subIdx) => { - if (subOption.isEnabled) { + {isMenuExapnded[title] && + subMenu.map(({ isEnabled, iconComponent, title, description, onClickHandler }, subIdx) => { + if (isEnabled) { return ( - + @@ -433,21 +785,21 @@ const Explore: FC = ({ key={idx} gap="0" IconComponent={} - title={option.title} - description={option.description} + title={t(title)} + description={t(description)} cardMargin={ idx === 0 && (!isUserAwsAccountConnected || !isAuthenticated) ? "2rem 0 0.923rem 0" : "0.923rem 0" } direction="row-reverse" cardAlignItems="center" - onClickHandler={option.onClickHandler} + onClickHandler={onClickHandler} style={{ padding: "0 1rem" }} /> ); } } }); - }, [exploreMoreOptions, isAuthenticated, isMigrationMenuExapnded, isUserAwsAccountConnected]); + }, [exploreMoreOptions, isAuthenticated, isMenuExapnded, isUserAwsAccountConnected, t]); const exploreButtons = [ { diff --git a/src/atomicui/organisms/Sidebar/Sidebar.test.tsx b/src/atomicui/organisms/Sidebar/Sidebar.test.tsx index 1d997e73..5f3eb4d6 100644 --- a/src/atomicui/organisms/Sidebar/Sidebar.test.tsx +++ b/src/atomicui/organisms/Sidebar/Sidebar.test.tsx @@ -35,6 +35,11 @@ describe("", () => { ); }; + + beforeEach(() => { + (window.location as Location) = { href: "http://example.com/some/path" } as Location; + }); + it("renders the logo", () => { const { getByTestId } = renderComponent(); diff --git a/src/atomicui/organisms/Sidebar/styles.scss b/src/atomicui/organisms/Sidebar/styles.scss index 6f55bc43..b3824135 100644 --- a/src/atomicui/organisms/Sidebar/styles.scss +++ b/src/atomicui/organisms/Sidebar/styles.scss @@ -115,9 +115,17 @@ } } -.side-bar__external-menu li a { - padding: 8px 16px; - height: 40px; +.side-bar__external-menu { + min-height: 15rem; + max-height: 40rem; + overflow-y: auto; + + li { + a { + padding: 8px 16px; + height: 40px; + } + } } .side-bar > .button-wrapper { @@ -144,7 +152,8 @@ background-color: var(--red-color); } -.list-item { +.list-item, +.new-list-item { .sub-menu-container { display: none; position: absolute; @@ -170,9 +179,73 @@ } } + .new-sub-menu-container-outer { + gap: 0; + display: none; + position: absolute; + left: 17.18rem; + width: max-content; + background-color: transparent; + + .new-sub-menu-container-inner { + gap: 0; + display: flex; + flex-direction: column; + background-color: var(--white-color); + border: 1px solid var(--grey-color-8); + border-radius: 4px; + margin-left: 0.2rem; + + .new-sub-menu-item { + .new-sub-menu-item-label { + cursor: pointer; + + &:hover { + color: var(--active-menu); + } + } + + &:hover { + background: var(--hovered-menu-backround-color); + + .new-sub-menu-item-label { + color: var(--active-menu); + } + } + } + } + } + &:hover { .sub-menu-container { display: block; } + + .new-sub-menu-container-outer { + display: flex; + } + } +} + +.new-list-item { + .amplify-link { + &:visited { + color: unset; + } + + &:hover { + color: var(--active-menu); + } + } + + .link-with-sub-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + &:hover { + // color: red; + color: var(--active-menu); } } diff --git a/src/core/constants/appConfig.ts b/src/core/constants/appConfig.ts index c6579f9d..d9b5c7e8 100644 --- a/src/core/constants/appConfig.ts +++ b/src/core/constants/appConfig.ts @@ -66,12 +66,13 @@ const appConfig = { APP_VERSION: getEnv("VITE_APP_VERSION"), NL_BASE_URL: getEnv("VITE_NL_BASE_URL"), NL_API_KEY: getEnv("VITE_NL_API_KEY"), - MIGRATE_FROM_GOOGLE_MAPS_PAGE: getEnv("VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE"), - MIGRATE_A_WEB_APP_PAGE: getEnv("VITE_MIGRATE_A_WEB_APP_PAGE"), - MIGRATE_AN_ANDROID_APP_PAGE: getEnv("VITE_MIGRATE_AN_ANDROID_APP_PAGE"), - MIGRATE_AN_IOS_APP_PAGE: getEnv("VITE_MIGRATE_AN_IOS_APP_PAGE"), - MIGRATE_A_WEB_SERVICE_PAGE: getEnv("VITE_MIGRATE_A_WEB_SERVICE_PAGE"), - PRICING_PAGE: getEnv("VITE_PRICING_PAGE") + MIGRATE_FROM_GOOGLE_MAPS_PAGE: !!parseInt(String(getEnv("VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE"))), + MIGRATE_A_WEB_APP_PAGE: !!parseInt(String(getEnv("VITE_MIGRATE_A_WEB_APP_PAGE"))), + MIGRATE_AN_ANDROID_APP_PAGE: !!parseInt(String(getEnv("VITE_MIGRATE_AN_ANDROID_APP_PAGE"))), + MIGRATE_AN_IOS_APP_PAGE: !!parseInt(String(getEnv("VITE_MIGRATE_AN_IOS_APP_PAGE"))), + MIGRATE_A_WEB_SERVICE_PAGE: !!parseInt(String(getEnv("VITE_MIGRATE_A_WEB_SERVICE_PAGE"))), + PRICING_PAGE: !!parseInt(String(getEnv("VITE_PRICING_PAGE"))), + SHOW_NEW_NAVIGATION: !!parseInt(String(getEnv("VITE_SHOW_NEW_NAVIGATION"))) }, PERSIST_STORAGE_KEYS: { LOCAL_STORAGE_PREFIX: "amazon-location_", @@ -436,7 +437,22 @@ const appConfig = { "https://docs.aws.amazon.com/location/latest/APIReference/API_GetDevicePositionHistory.html", BATCH_DELETE_DEVICE_POSITION_HISTORY_URL: "https://docs.aws.amazon.com/location/latest/APIReference/API_BatchDeleteDevicePositionHistory.html", - AWS_LOCATION: "https://aws.amazon.com/location/" + AWS_LOCATION: "https://aws.amazon.com/location/", + AWS_LOCATION_MAPS_URL: "https://aws.amazon.com/location/maps/", + AWS_LOCATION_PLACES_URL: "https://aws.amazon.com/location/places/", + AWS_LOCATION_ROUTES_URL: "https://aws.amazon.com/location/routes/", + AWS_LOCATION_GENFENCE_AND_TRACKERS_URL: "https://aws.amazon.com/location/geofences-and-trackers/", + AWS_LOCATION_INDUSTRY_URL: "https://aws.amazon.com/location/industry/", + AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL: "https://aws.amazon.com/location/transportation-and-logistics/", + AWS_LOCATION_FINANCIAL_SERVICE_URL: "https://aws.amazon.com/location/financial-service/", + AWS_LOCATION_HEALTHCARE_URL: "https://aws.amazon.com/location/healthcare/", + AWS_LOCATION_RETAILS_URL: "https://aws.amazon.com/location/retails/", + AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL: "https://aws.amazon.com/location/travel-and-hospitality/", + AWS_LOCATION_REAL_ESTATE_URL: "https://aws.amazon.com/location/real-estate/", + AWS_LOCATION_RESOURCES_URL: "https://aws.amazon.com/location/resources/", + AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/resources/customers/", + AWS_LOCATION_PRODUCT_RESOURCES_URL: "https://aws.amazon.com/location/resources/product-resources/", + AWS_LOCATION_DEVELOPER_RESOURCES_URL: "https://aws.amazon.com/location/resources/developer-resources/" } }; diff --git a/src/core/constants/marketingMenuOptionsData.ts b/src/core/constants/marketingMenuOptionsData.ts index 2dc4e4c3..3aa09aee 100644 --- a/src/core/constants/marketingMenuOptionsData.ts +++ b/src/core/constants/marketingMenuOptionsData.ts @@ -6,6 +6,7 @@ import IconDollarSolid from "@demo/assets/svgs/icon-dollar-solid.svg"; import IconSwap from "@demo/assets/svgs/icon-swap.svg"; import appConfig from "@demo/core/constants/appConfig"; +import { MenuItem } from "@demo/types"; const { ENV: { @@ -14,7 +15,8 @@ const { MIGRATE_AN_ANDROID_APP_PAGE, MIGRATE_AN_IOS_APP_PAGE, MIGRATE_A_WEB_SERVICE_PAGE, - PRICING_PAGE + PRICING_PAGE, + SHOW_NEW_NAVIGATION }, ROUTES: { SAMPLES, @@ -24,20 +26,33 @@ const { MIGRATE_AN_IOS_APP, MIGRATE_A_WEB_SERVICE, PRICING + }, + LINKS: { + LEARN_MORE_URL, + AWS_LOCATION_MAPS_URL, + AWS_LOCATION_PLACES_URL, + AWS_LOCATION_ROUTES_URL, + AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, + AWS_GETTING_STARTED_URL, + AWS_PRICING_URL, + AWS_FAQ_URL, + AWS_LOCATION_INDUSTRY_URL, + AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, + AWS_LOCATION_FINANCIAL_SERVICE_URL, + AWS_LOCATION_HEALTHCARE_URL, + AWS_LOCATION_RETAILS_URL, + AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, + AWS_LOCATION_REAL_ESTATE_URL, + AWS_LOCATION_RESOURCES_URL, + AWS_LOCATION_CUSTOMERS_URL, + AWS_LOCATION_PRODUCT_RESOURCES_URL, + AWS_LOCATION_DEVELOPER_RESOURCES_URL } } = appConfig; -type MenuItem = { - label: string; - link: string; - iconBeforeLink?: string; - iconContainerClass?: string; - isExternalLink?: boolean; - subMenu?: MenuItem[]; -}; +let marketingMenuOptionsData: MenuItem[]; const routeToEnvMapping = { - [SAMPLES]: "1", [MIGRATE_FROM_GOOGLE_MAPS]: MIGRATE_FROM_GOOGLE_MAPS_PAGE, [MIGRATE_A_WEB_APP]: MIGRATE_A_WEB_APP_PAGE, [MIGRATE_AN_ANDROID_APP]: MIGRATE_AN_ANDROID_APP_PAGE, @@ -46,58 +61,224 @@ const routeToEnvMapping = { [PRICING]: PRICING_PAGE }; -const shouldIncludeMenuItem = (menuItem: MenuItem) => !!parseInt(routeToEnvMapping[menuItem?.link]); +const shouldIncludeMenuItem = ({ link }: MenuItem) => (link in routeToEnvMapping ? routeToEnvMapping[link] : true); -let marketingMenuOptionsData: MenuItem[] = [ - { - label: "samples.text", - link: SAMPLES, - iconBeforeLink: IconCodeMenu, - iconContainerClass: "menu-item-icon", - isExternalLink: false - }, - { - label: "migration.text", - link: MIGRATE_FROM_GOOGLE_MAPS, - iconBeforeLink: IconSwap, - iconContainerClass: "menu-item-icon", - isExternalLink: false, - subMenu: [ - { - label: "migrate_from_google_maps.text", - link: MIGRATE_FROM_GOOGLE_MAPS, - isExternalLink: false - }, - { - label: "migrate_a_web_app.text", - link: MIGRATE_A_WEB_APP, - isExternalLink: false - }, - { - label: "migrate_an_android_app.text", - link: MIGRATE_AN_ANDROID_APP, - isExternalLink: false - }, - { - label: "migrate_an_ios_app.text", - link: MIGRATE_AN_IOS_APP, - isExternalLink: false - }, - { - label: "migrate_a_web_service.text", - link: MIGRATE_A_WEB_SERVICE, - isExternalLink: false - } - ] - }, - { - label: "pricing.text", - link: PRICING, - iconBeforeLink: IconDollarSolid, - iconContainerClass: "menu-item-icon", - isExternalLink: false - } -]; +if (!SHOW_NEW_NAVIGATION) { + marketingMenuOptionsData = [ + { + label: "samples.text", + link: SAMPLES, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: false + }, + { + label: "migration.text", + link: MIGRATE_FROM_GOOGLE_MAPS, + iconBeforeLink: IconSwap, + iconContainerClass: "menu-item-icon", + isExternalLink: false, + subMenu: [ + { + label: "migrate_from_google_maps.text", + link: MIGRATE_FROM_GOOGLE_MAPS, + isExternalLink: false + }, + { + label: "migrate_a_web_app.text", + link: MIGRATE_A_WEB_APP, + isExternalLink: false + }, + { + label: "migrate_an_android_app.text", + link: MIGRATE_AN_ANDROID_APP, + isExternalLink: false + }, + { + label: "migrate_an_ios_app.text", + link: MIGRATE_AN_IOS_APP, + isExternalLink: false + }, + { + label: "migrate_a_web_service.text", + link: MIGRATE_A_WEB_SERVICE, + isExternalLink: false + } + ] + }, + { + label: "pricing.text", + link: PRICING, + iconBeforeLink: IconDollarSolid, + iconContainerClass: "menu-item-icon", + isExternalLink: false + } + ]; +} else { + marketingMenuOptionsData = [ + { + label: "samples.text", + link: SAMPLES, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: false + }, + { + label: "migration.text", + link: MIGRATE_FROM_GOOGLE_MAPS, + iconBeforeLink: IconSwap, + iconContainerClass: "menu-item-icon", + isExternalLink: false, + subMenu: [ + { + label: "migrate_from_google_maps.text", + link: MIGRATE_FROM_GOOGLE_MAPS, + isExternalLink: false + }, + { + label: "migrate_a_web_app.text", + link: MIGRATE_A_WEB_APP, + isExternalLink: false + }, + { + label: "migrate_an_android_app.text", + link: MIGRATE_AN_ANDROID_APP, + isExternalLink: false + }, + { + label: "migrate_an_ios_app.text", + link: MIGRATE_AN_IOS_APP, + isExternalLink: false + }, + { + label: "migrate_a_web_service.text", + link: MIGRATE_A_WEB_SERVICE, + isExternalLink: false + } + ] + }, + { + label: "header__overview.text", + link: LEARN_MORE_URL, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: true + }, + { + label: "header__product.text", + link: AWS_LOCATION_MAPS_URL, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: true, + subMenu: [ + { + label: "maps.text", + link: AWS_LOCATION_MAPS_URL, + isExternalLink: true + }, + { + label: "places.text", + link: AWS_LOCATION_PLACES_URL, + isExternalLink: true + }, + { + label: "routes.text", + link: AWS_LOCATION_ROUTES_URL, + isExternalLink: true + }, + { + label: "geofences_and_trackers.text", + link: AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, + isExternalLink: true + } + ] + }, + { + label: "footer__getting_started.text", + link: AWS_GETTING_STARTED_URL, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: true + }, + { + label: "pricing.text", + link: AWS_PRICING_URL, + iconBeforeLink: IconDollarSolid, + iconContainerClass: "menu-item-icon", + isExternalLink: true + }, + { + label: "footer__faq.text", + link: AWS_FAQ_URL, + iconBeforeLink: IconDollarSolid, + iconContainerClass: "menu-item-icon", + isExternalLink: true + }, + { + label: "industry.text", + link: AWS_LOCATION_INDUSTRY_URL, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: true, + subMenu: [ + { + label: "transportation_and_logistics.text", + link: AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, + isExternalLink: true + }, + { + label: "financial_service.text", + link: AWS_LOCATION_FINANCIAL_SERVICE_URL, + isExternalLink: true + }, + { + label: "healthcare.text", + link: AWS_LOCATION_HEALTHCARE_URL, + isExternalLink: true + }, + { + label: "retails.text", + link: AWS_LOCATION_RETAILS_URL, + isExternalLink: true + }, + { + label: "travel_and_hospitality.text", + link: AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, + isExternalLink: true + }, + { + label: "real_estate.text", + link: AWS_LOCATION_REAL_ESTATE_URL, + isExternalLink: true + } + ] + }, + { + label: "resources.text", + link: AWS_LOCATION_RESOURCES_URL, + iconBeforeLink: IconCodeMenu, + iconContainerClass: "menu-item-icon", + isExternalLink: true, + subMenu: [ + { + label: "customers.text", + link: AWS_LOCATION_CUSTOMERS_URL, + isExternalLink: true + }, + { + label: "product_resources.text", + link: AWS_LOCATION_PRODUCT_RESOURCES_URL, + isExternalLink: true + }, + { + label: "developer_resources.text", + link: AWS_LOCATION_DEVELOPER_RESOURCES_URL, + isExternalLink: true + } + ] + } + ]; +} marketingMenuOptionsData = marketingMenuOptionsData .map(object => { diff --git a/src/locales/ar/ar.json b/src/locales/ar/ar.json index 2b85e278..dd91979e 100644 --- a/src/locales/ar/ar.json +++ b/src/locales/ar/ar.json @@ -114,7 +114,7 @@ "text": "نظرة عامة" }, "header__product": { - "text": "المنتج" + "text": "منتجات" }, "header__try_it": { "text": "جربها" @@ -129,7 +129,7 @@ "text": "الشروع في العمل" }, "footer__faq": { - "text": "التعليمات" + "text": "الأسئلة الشائعة" }, "footer__pricing": { "text": "التسعير" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "فشل تحديث الرموز" + }, + "geofences_and_trackers": { + "text": "المواقع الجغرافية وأجهزة التتبع" + }, + "industry": { + "text": "الصناعة" + }, + "transportation_and_logistics": { + "text": "النقل والخدمات اللوجستية" + }, + "financial_service": { + "text": "خدمة مالية" + }, + "healthcare": { + "text": "الرعاية الصحية" + }, + "retails": { + "text": "تجارة التجزئة" + }, + "travel_and_hospitality": { + "text": "السفر والضيافة" + }, + "real_estate": { + "text": "العقارات" + }, + "resources": { + "text": "الموارد" + }, + "customers": { + "text": "العملاء" + }, + "product_resources": { + "text": "موارد المنتج" + }, + "developer_resources": { + "text": "موارد المطور" + }, + "header__product_desc": { + "text": "إضافة بيانات الموقع إلى التطبيقات بأمان وسهولة" } } \ No newline at end of file diff --git a/src/locales/de/de.json b/src/locales/de/de.json index f958c5fd..acecc363 100644 --- a/src/locales/de/de.json +++ b/src/locales/de/de.json @@ -114,7 +114,7 @@ "text": "Überblick" }, "header__product": { - "text": "Produkt" + "text": "Produkte" }, "header__try_it": { "text": "Probiere es aus" @@ -129,7 +129,7 @@ "text": "Erste Schritte" }, "footer__faq": { - "text": "FAQ" + "text": "Häufig gestellte Fragen" }, "footer__pricing": { "text": "Preisgestaltung" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "Tokens konnten nicht aktualisiert werden" + }, + "geofences_and_trackers": { + "text": "Geofences und Tracker" + }, + "industry": { + "text": "Industrie" + }, + "transportation_and_logistics": { + "text": "Transport und Logistik" + }, + "financial_service": { + "text": "Finanzdienstleistung" + }, + "healthcare": { + "text": "Gesundheitswesen" + }, + "retails": { + "text": "Einzelhandel" + }, + "travel_and_hospitality": { + "text": "Reisen und Gastgewerbe" + }, + "real_estate": { + "text": "Immobilien" + }, + "resources": { + "text": "Ressourcen" + }, + "customers": { + "text": "Kunden" + }, + "product_resources": { + "text": "Produktressourcen" + }, + "developer_resources": { + "text": "Ressourcen für Entwickler" + }, + "header__product_desc": { + "text": "Sicheres und einfaches Hinzufügen von Standortdaten zu Anwendungen" } } \ No newline at end of file diff --git a/src/locales/en/en.json b/src/locales/en/en.json index 27a2fae0..884a5460 100644 --- a/src/locales/en/en.json +++ b/src/locales/en/en.json @@ -114,7 +114,7 @@ "text": "Overview" }, "header__product": { - "text": "Product" + "text": "Products" }, "header__try_it": { "text": "Try it" @@ -129,7 +129,7 @@ "text": "Getting Started" }, "footer__faq": { - "text": "FAQ" + "text": "FAQs" }, "footer__pricing": { "text": "Pricing" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "Failed to refresh tokens" + }, + "geofences_and_trackers": { + "text": "Geofences and Trackers" + }, + "industry": { + "text": "Industry" + }, + "transportation_and_logistics": { + "text": "Transportation and Logistics" + }, + "financial_service": { + "text": "Financial Service" + }, + "healthcare": { + "text": "Healthcare" + }, + "retails": { + "text": "Retails" + }, + "travel_and_hospitality": { + "text": "Travel and Hospitality" + }, + "real_estate": { + "text": "Real Estate" + }, + "resources": { + "text": "Resources" + }, + "customers": { + "text": "Customers" + }, + "product_resources": { + "text": "Product Resources" + }, + "developer_resources": { + "text": "Developer Resources" + }, + "header__product_desc": { + "text": "Securely and easily add location data to applications" } } \ No newline at end of file diff --git a/src/locales/es/es.json b/src/locales/es/es.json index caf68924..7ecba8c9 100644 --- a/src/locales/es/es.json +++ b/src/locales/es/es.json @@ -114,7 +114,7 @@ "text": "Visión general" }, "header__product": { - "text": "Producto" + "text": "Productos" }, "header__try_it": { "text": "Pruébalo" @@ -129,7 +129,7 @@ "text": "Cómo empezar" }, "footer__faq": { - "text": "PREGUNTAS MÁS FRECUENTES" + "text": "Preguntas frecuentes" }, "footer__pricing": { "text": "Precios" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "No se pudieron actualizar los tokens" + }, + "geofences_and_trackers": { + "text": "Geofences y rastreadores" + }, + "industry": { + "text": "Industria" + }, + "transportation_and_logistics": { + "text": "Transporte y logística" + }, + "financial_service": { + "text": "Servicio financiero" + }, + "healthcare": { + "text": "Asistencia sanitaria" + }, + "retails": { + "text": "Ventas al por menor" + }, + "travel_and_hospitality": { + "text": "Viajes y hospitalidad" + }, + "real_estate": { + "text": "Bienes raíces" + }, + "resources": { + "text": "Recursos" + }, + "customers": { + "text": "Clientes" + }, + "product_resources": { + "text": "Recursos del producto" + }, + "developer_resources": { + "text": "Recursos para desarrolladores" + }, + "header__product_desc": { + "text": "Agregue datos de ubicación a las aplicaciones de forma fácil y segura" } } \ No newline at end of file diff --git a/src/locales/fr/fr.json b/src/locales/fr/fr.json index 21a3db8c..48bdb4e9 100644 --- a/src/locales/fr/fr.json +++ b/src/locales/fr/fr.json @@ -114,7 +114,7 @@ "text": "Vue d'ensemble" }, "header__product": { - "text": "Produit" + "text": "Produits" }, "header__try_it": { "text": "Essayez-le" @@ -129,7 +129,7 @@ "text": "Pour commencer" }, "footer__faq": { - "text": "FAQ" + "text": "FAQs" }, "footer__pricing": { "text": "Tarification" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "Impossible d'actualiser les jetons" + }, + "geofences_and_trackers": { + "text": "Géofences et traceurs" + }, + "industry": { + "text": "L'industrie" + }, + "transportation_and_logistics": { + "text": "Transport et logistique" + }, + "financial_service": { + "text": "Service financier" + }, + "healthcare": { + "text": "Soins de santé" + }, + "retails": { + "text": "Vente au détail" + }, + "travel_and_hospitality": { + "text": "Voyages et accueil" + }, + "real_estate": { + "text": "Immobilier" + }, + "resources": { + "text": "Ressources" + }, + "customers": { + "text": "Clientèle" + }, + "product_resources": { + "text": "Ressources sur les produits" + }, + "developer_resources": { + "text": "Ressources pour les développeurs" + }, + "header__product_desc": { + "text": "Ajoutez facilement et en toute sécurité des données de localisation aux applications" } } \ No newline at end of file diff --git a/src/locales/he/he.json b/src/locales/he/he.json index 9c353f02..2d51cb7b 100644 --- a/src/locales/he/he.json +++ b/src/locales/he/he.json @@ -114,7 +114,7 @@ "text": "סקירה כללית" }, "header__product": { - "text": "מוצר" + "text": "מוצרים" }, "header__try_it": { "text": "נסה את זה" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "רענון האסימונים נכשל" + }, + "geofences_and_trackers": { + "text": "גיאופנסים ועוקבים" + }, + "industry": { + "text": "תעשייה" + }, + "transportation_and_logistics": { + "text": "תחבורה ולוגיסטיקה" + }, + "financial_service": { + "text": "שירות פיננסי" + }, + "healthcare": { + "text": "שירותי בריאות" + }, + "retails": { + "text": "קמעונאות" + }, + "travel_and_hospitality": { + "text": "נסיעות ואירוח" + }, + "real_estate": { + "text": "נדל\"ן" + }, + "resources": { + "text": "משאבים" + }, + "customers": { + "text": "לקוחות" + }, + "product_resources": { + "text": "משאבי מוצר" + }, + "developer_resources": { + "text": "משאבי מפתחים" + }, + "header__product_desc": { + "text": "הוספת נתוני מיקום ליישומים בצורה מאובטחת ובקלות" } } \ No newline at end of file diff --git a/src/locales/hi/hi.json b/src/locales/hi/hi.json index 5b0ca743..862eeac9 100644 --- a/src/locales/hi/hi.json +++ b/src/locales/hi/hi.json @@ -114,7 +114,7 @@ "text": "संक्षिप्त विवरण" }, "header__product": { - "text": "प्रोडक्ट" + "text": "प्रोडक्ट्स" }, "header__try_it": { "text": "इसे आजमाएं" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "टोकन रीफ़्रेश करने में विफल" + }, + "geofences_and_trackers": { + "text": "जियोफेंस और ट्रैकर्स" + }, + "industry": { + "text": "इंडस्ट्री" + }, + "transportation_and_logistics": { + "text": "परिवहन और लॉजिस्टिक्स" + }, + "financial_service": { + "text": "फाइनेंशियल सर्विस" + }, + "healthcare": { + "text": "हेल्थकेयर" + }, + "retails": { + "text": "रिटेल्स" + }, + "travel_and_hospitality": { + "text": "यात्रा और आतिथ्य" + }, + "real_estate": { + "text": "रियल एस्टेट" + }, + "resources": { + "text": "संसाधन" + }, + "customers": { + "text": "ग्राहक" + }, + "product_resources": { + "text": "उत्पाद संसाधन" + }, + "developer_resources": { + "text": "डेवलपर संसाधन" + }, + "header__product_desc": { + "text": "सुरक्षित रूप से और आसानी से एप्लिकेशन में स्थान डेटा जोड़ें" } } \ No newline at end of file diff --git a/src/locales/it/it.json b/src/locales/it/it.json index df08a0fc..1d59a6b8 100644 --- a/src/locales/it/it.json +++ b/src/locales/it/it.json @@ -114,7 +114,7 @@ "text": "Panoramica" }, "header__product": { - "text": "Prodotto" + "text": "Prodotti" }, "header__try_it": { "text": "Provalo" @@ -129,7 +129,7 @@ "text": "Guida introduttiva" }, "footer__faq": { - "text": "FAQ" + "text": "FAQs" }, "footer__pricing": { "text": "Prezzi" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "Aggiornamento dei token non riuscito" + }, + "geofences_and_trackers": { + "text": "Geofences e tracker" + }, + "industry": { + "text": "Industria" + }, + "transportation_and_logistics": { + "text": "Trasporti e logistica" + }, + "financial_service": { + "text": "Servizio finanziario" + }, + "healthcare": { + "text": "Assistenza sanitaria" + }, + "retails": { + "text": "Vendita al dettaglio" + }, + "travel_and_hospitality": { + "text": "Viaggi e ospitalità" + }, + "real_estate": { + "text": "Immobili" + }, + "resources": { + "text": "Risorse" + }, + "customers": { + "text": "Clienti" + }, + "product_resources": { + "text": "Risorse sui prodotti" + }, + "developer_resources": { + "text": "Risorse per gli sviluppatori" + }, + "header__product_desc": { + "text": "Aggiungi dati sulla posizione alle applicazioni in modo sicuro e semplice" } } \ No newline at end of file diff --git a/src/locales/ja/ja.json b/src/locales/ja/ja.json index b86972b0..35007bd6 100644 --- a/src/locales/ja/ja.json +++ b/src/locales/ja/ja.json @@ -114,7 +114,7 @@ "text": "概要" }, "header__product": { - "text": "プロダクト" + "text": "製品" }, "header__try_it": { "text": "やってみて" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "トークンを更新できませんでした" + }, + "geofences_and_trackers": { + "text": "ジオフェンスとトラッカー" + }, + "industry": { + "text": "業界" + }, + "transportation_and_logistics": { + "text": "輸送と物流" + }, + "financial_service": { + "text": "金融サービス" + }, + "healthcare": { + "text": "ヘルスケア" + }, + "retails": { + "text": "小売業" + }, + "travel_and_hospitality": { + "text": "旅行とホスピタリティ" + }, + "real_estate": { + "text": "不動産" + }, + "resources": { + "text": "リソース" + }, + "customers": { + "text": "顧客" + }, + "product_resources": { + "text": "製品リソース" + }, + "developer_resources": { + "text": "デベロッパーリソース" + }, + "header__product_desc": { + "text": "アプリケーションに位置データを安全かつ簡単に追加" } } \ No newline at end of file diff --git a/src/locales/ko/ko.json b/src/locales/ko/ko.json index 16cf19c2..64b5b058 100644 --- a/src/locales/ko/ko.json +++ b/src/locales/ko/ko.json @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "토큰 새로고침 실패" + }, + "geofences_and_trackers": { + "text": "지오펜스 및 트래커" + }, + "industry": { + "text": "산업" + }, + "transportation_and_logistics": { + "text": "운송 및 물류" + }, + "financial_service": { + "text": "파이낸셜 서비스" + }, + "healthcare": { + "text": "헬스케어" + }, + "retails": { + "text": "소매업" + }, + "travel_and_hospitality": { + "text": "여행 및 호스피탈리티" + }, + "real_estate": { + "text": "부동산" + }, + "resources": { + "text": "리소스" + }, + "customers": { + "text": "고객들" + }, + "product_resources": { + "text": "제품 리소스" + }, + "developer_resources": { + "text": "개발자 리소스" + }, + "header__product_desc": { + "text": "위치 데이터를 애플리케이션에 안전하고 쉽게 추가" } } \ No newline at end of file diff --git a/src/locales/pt-BR/pt-BR.json b/src/locales/pt-BR/pt-BR.json index d69baca8..a55acf70 100644 --- a/src/locales/pt-BR/pt-BR.json +++ b/src/locales/pt-BR/pt-BR.json @@ -114,7 +114,7 @@ "text": "Visão geral" }, "header__product": { - "text": "Produto" + "text": "Produtos" }, "header__try_it": { "text": "Experimente" @@ -129,7 +129,7 @@ "text": "Começando" }, "footer__faq": { - "text": "PERGUNTAS FREQUENTES" + "text": "Perguntas frequentes" }, "footer__pricing": { "text": "Preços" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "Falha ao atualizar os tokens" + }, + "geofences_and_trackers": { + "text": "Geofences e rastreadores" + }, + "industry": { + "text": "Indústria" + }, + "transportation_and_logistics": { + "text": "Transporte e logística" + }, + "financial_service": { + "text": "Serviço financeiro" + }, + "healthcare": { + "text": "Assistência médica" + }, + "retails": { + "text": "Varejos" + }, + "travel_and_hospitality": { + "text": "Viagens e hospitalidade" + }, + "real_estate": { + "text": "Imóveis" + }, + "resources": { + "text": "Recursos" + }, + "customers": { + "text": "Clientes" + }, + "product_resources": { + "text": "Recursos do produto" + }, + "developer_resources": { + "text": "Recursos para desenvolvedores" + }, + "header__product_desc": { + "text": "Adicione dados de localização aos aplicativos com segurança e facilidade" } } \ No newline at end of file diff --git a/src/locales/zh-CN/zh-CN.json b/src/locales/zh-CN/zh-CN.json index 7fb00e20..2c137be4 100644 --- a/src/locales/zh-CN/zh-CN.json +++ b/src/locales/zh-CN/zh-CN.json @@ -129,7 +129,7 @@ "text": "入门指南" }, "footer__faq": { - "text": "常见问题" + "text": "常见问题解答" }, "footer__pricing": { "text": "定价" @@ -3693,5 +3693,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "刷新令牌失败" + }, + "geofences_and_trackers": { + "text": "地理围栏和追踪器" + }, + "industry": { + "text": "工业" + }, + "transportation_and_logistics": { + "text": "运输和物流" + }, + "financial_service": { + "text": "金融服务" + }, + "healthcare": { + "text": "医疗保健" + }, + "retails": { + "text": "零售业" + }, + "travel_and_hospitality": { + "text": "旅行和款待" + }, + "real_estate": { + "text": "房地产" + }, + "resources": { + "text": "资源" + }, + "customers": { + "text": "顾客" + }, + "product_resources": { + "text": "产品资源" + }, + "developer_resources": { + "text": "开发者资源" + }, + "header__product_desc": { + "text": "安全轻松地向应用程序添加位置数据" } } \ No newline at end of file diff --git a/src/locales/zh-TW/zh-TW.json b/src/locales/zh-TW/zh-TW.json index 3b236d02..acfa7f01 100644 --- a/src/locales/zh-TW/zh-TW.json +++ b/src/locales/zh-TW/zh-TW.json @@ -114,7 +114,7 @@ "text": "概述" }, "header__product": { - "text": "产品" + "text": "產品" }, "header__try_it": { "text": "嘗試一下" @@ -129,7 +129,7 @@ "text": "開始使用" }, "footer__faq": { - "text": "常問問題" + "text": "常見問題" }, "footer__pricing": { "text": "定價" @@ -3697,5 +3697,44 @@ }, "error_handler__failed_refresh_tokens": { "text": "重新整理令牌失敗" + }, + "geofences_and_trackers": { + "text": "地理信息和追踪器" + }, + "industry": { + "text": "行業" + }, + "transportation_and_logistics": { + "text": "運輸及物流" + }, + "financial_service": { + "text": "金融服務" + }, + "healthcare": { + "text": "醫療保健" + }, + "retails": { + "text": "零售" + }, + "travel_and_hospitality": { + "text": "旅遊與酒店" + }, + "real_estate": { + "text": "房地產" + }, + "resources": { + "text": "資源" + }, + "customers": { + "text": "客戶" + }, + "product_resources": { + "text": "產品資源" + }, + "developer_resources": { + "text": "開發人員資源" + }, + "header__product_desc": { + "text": "安全輕鬆地將位置資料新增至應用程式" } } \ No newline at end of file diff --git a/src/setupTests.ts b/src/setupTests.ts index 3410b8ed..008df84f 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -43,12 +43,13 @@ jest.mock("@demo/core/constants/appConfig", () => ({ APP_VERSION: "", NL_BASE_URL: "", NL_API_KEY: "", - MIGRATE_FROM_GOOGLE_MAPS_PAGE: "1", - MIGRATE_A_WEB_APP_PAGE: "1", - MIGRATE_AN_ANDROID_APP_PAGE: "1", - MIGRATE_AN_IOS_APP_PAGE: "1", - MIGRATE_A_WEB_SERVICE_PAGE: "1", - PRICING_PAGE: "1" + MIGRATE_FROM_GOOGLE_MAPS_PAGE: true, + MIGRATE_A_WEB_APP_PAGE: true, + MIGRATE_AN_ANDROID_APP_PAGE: true, + MIGRATE_AN_IOS_APP_PAGE: true, + MIGRATE_A_WEB_SERVICE_PAGE: true, + PRICING_PAGE: true, + SHOW_NEW_NAVIGATION: true }, PERSIST_STORAGE_KEYS: { LOCAL_STORAGE_PREFIX: "amazon-location_", @@ -254,7 +255,22 @@ jest.mock("@demo/core/constants/appConfig", () => ({ "https://docs.aws.amazon.com/location/latest/APIReference/API_GetDevicePositionHistory.html", BATCH_DELETE_DEVICE_POSITION_HISTORY_URL: "https://docs.aws.amazon.com/location/latest/APIReference/API_BatchDeleteDevicePositionHistory.html", - AWS_LOCATION: "https://aws.amazon.com/location/" + AWS_LOCATION: "https://aws.amazon.com/location/", + AWS_LOCATION_MAPS_URL: "https://aws.amazon.com/location/maps/", + AWS_LOCATION_PLACES_URL: "https://aws.amazon.com/location/places/", + AWS_LOCATION_ROUTES_URL: "https://aws.amazon.com/location/routes/", + AWS_LOCATION_GENFENCE_AND_TRACKERS_URL: "https://aws.amazon.com/location/geofences-and-trackers/", + AWS_LOCATION_INDUSTRY_URL: "https://aws.amazon.com/location/industry/", + AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL: "https://aws.amazon.com/location/transportation-and-logistics/", + AWS_LOCATION_FINANCIAL_SERVICE_URL: "https://aws.amazon.com/location/financial-service/", + AWS_LOCATION_HEALTHCARE_URL: "https://aws.amazon.com/location/healthcare/", + AWS_LOCATION_RETAILS_URL: "https://aws.amazon.com/location/retails/", + AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL: "https://aws.amazon.com/location/travel-and-hospitality/", + AWS_LOCATION_REAL_ESTATE_URL: "https://aws.amazon.com/location/real-estate/", + AWS_LOCATION_RESOURCES_URL: "https://aws.amazon.com/location/resources/", + AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/resources/customers/", + AWS_LOCATION_PRODUCT_RESOURCES_URL: "https://aws.amazon.com/location/resources/product-resources/", + AWS_LOCATION_DEVELOPER_RESOURCES_URL: "https://aws.amazon.com/location/resources/developer-resources/" } })); diff --git a/src/theme/styles/rootVars.scss b/src/theme/styles/rootVars.scss index f9b4c9bb..18715010 100644 --- a/src/theme/styles/rootVars.scss +++ b/src/theme/styles/rootVars.scss @@ -43,6 +43,8 @@ --success: #00af1c; --active-menu: #008398; + --grey-color-8: #cccccc; + /* Fonts */ --regular-font-family: "AmazonEmber-Regular"; --med-font-family: "AmazonEmber-Medium"; diff --git a/src/types/MenuTypes.ts b/src/types/MenuTypes.ts new file mode 100644 index 00000000..cf426b56 --- /dev/null +++ b/src/types/MenuTypes.ts @@ -0,0 +1,11 @@ +/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. */ +/* SPDX-License-Identifier: MIT-0 */ + +export type MenuItem = { + label: string; + link: string; + iconBeforeLink?: string; + iconContainerClass?: string; + isExternalLink?: boolean; + subMenu?: MenuItem[]; +}; diff --git a/src/types/index.ts b/src/types/index.ts index ea99017a..4d8f2f87 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -58,3 +58,4 @@ export type { TrackerPosType } from "./UnauthSimulationTypes"; export type { FeedbackValueType } from "./FeedbackModel"; +export type { MenuItem } from "./MenuTypes"; From 019014fb50c787ea17ecb348405607c60a47ecf4 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Fri, 13 Sep 2024 20:53:11 +0500 Subject: [PATCH 2/6] updated icons and added desc --- src/assets/svgs/icon-customers.svg | 1 + src/assets/svgs/icon-developer-resources.svg | 3 + src/assets/svgs/icon-financial-service.svg | 3 + src/assets/svgs/icon-geofences-trackers.svg | 3 + src/assets/svgs/icon-healthcare.svg | 3 + src/assets/svgs/icon-places-new.svg | 3 + src/assets/svgs/icon-product-resources.svg | 3 + src/assets/svgs/icon-real-estate.svg | 3 + src/assets/svgs/icon-retail.svg | 3 + src/assets/svgs/icon-travel-hospitality.svg | 3 + src/assets/svgs/index.ts | 10 ++ src/atomicui/atoms/List/List.tsx | 10 +- src/atomicui/organisms/Explore/Explore.tsx | 109 ++++++++++++------- src/atomicui/organisms/Sidebar/styles.scss | 4 + src/locales/ar/ar.json | 62 ++++++++++- src/locales/de/de.json | 60 ++++++++++ src/locales/en/en.json | 62 ++++++++++- src/locales/es/es.json | 62 ++++++++++- src/locales/fr/fr.json | 62 ++++++++++- src/locales/he/he.json | 60 ++++++++++ src/locales/hi/hi.json | 62 ++++++++++- src/locales/it/it.json | 60 ++++++++++ src/locales/ja/ja.json | 62 ++++++++++- src/locales/ko/ko.json | 60 ++++++++++ src/locales/pt-BR/pt-BR.json | 62 ++++++++++- src/locales/zh-CN/zh-CN.json | 62 ++++++++++- src/locales/zh-TW/zh-TW.json | 60 ++++++++++ 27 files changed, 908 insertions(+), 49 deletions(-) create mode 100644 src/assets/svgs/icon-customers.svg create mode 100644 src/assets/svgs/icon-developer-resources.svg create mode 100644 src/assets/svgs/icon-financial-service.svg create mode 100644 src/assets/svgs/icon-geofences-trackers.svg create mode 100644 src/assets/svgs/icon-healthcare.svg create mode 100644 src/assets/svgs/icon-places-new.svg create mode 100644 src/assets/svgs/icon-product-resources.svg create mode 100644 src/assets/svgs/icon-real-estate.svg create mode 100644 src/assets/svgs/icon-retail.svg create mode 100644 src/assets/svgs/icon-travel-hospitality.svg diff --git a/src/assets/svgs/icon-customers.svg b/src/assets/svgs/icon-customers.svg new file mode 100644 index 00000000..643c23ca --- /dev/null +++ b/src/assets/svgs/icon-customers.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/icon-developer-resources.svg b/src/assets/svgs/icon-developer-resources.svg new file mode 100644 index 00000000..51bad9ac --- /dev/null +++ b/src/assets/svgs/icon-developer-resources.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-financial-service.svg b/src/assets/svgs/icon-financial-service.svg new file mode 100644 index 00000000..1699f277 --- /dev/null +++ b/src/assets/svgs/icon-financial-service.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-geofences-trackers.svg b/src/assets/svgs/icon-geofences-trackers.svg new file mode 100644 index 00000000..c739630e --- /dev/null +++ b/src/assets/svgs/icon-geofences-trackers.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-healthcare.svg b/src/assets/svgs/icon-healthcare.svg new file mode 100644 index 00000000..3555f1a3 --- /dev/null +++ b/src/assets/svgs/icon-healthcare.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-places-new.svg b/src/assets/svgs/icon-places-new.svg new file mode 100644 index 00000000..6efc63c8 --- /dev/null +++ b/src/assets/svgs/icon-places-new.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-product-resources.svg b/src/assets/svgs/icon-product-resources.svg new file mode 100644 index 00000000..c5b68686 --- /dev/null +++ b/src/assets/svgs/icon-product-resources.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-real-estate.svg b/src/assets/svgs/icon-real-estate.svg new file mode 100644 index 00000000..9e8df54f --- /dev/null +++ b/src/assets/svgs/icon-real-estate.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-retail.svg b/src/assets/svgs/icon-retail.svg new file mode 100644 index 00000000..5d70d924 --- /dev/null +++ b/src/assets/svgs/icon-retail.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/icon-travel-hospitality.svg b/src/assets/svgs/icon-travel-hospitality.svg new file mode 100644 index 00000000..46d91148 --- /dev/null +++ b/src/assets/svgs/icon-travel-hospitality.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svgs/index.ts b/src/assets/svgs/index.ts index 51611cc2..5f4d6e94 100644 --- a/src/assets/svgs/index.ts +++ b/src/assets/svgs/index.ts @@ -111,3 +111,13 @@ export { ReactComponent as IconBrandAndroid } from "./icon-brand-android.svg"; export { ReactComponent as IconDollarSolid } from "./icon-dollar-solid.svg"; export { ReactComponent as IconSwap } from "./icon-swap.svg"; export { ReactComponent as Simulation } from "./simulation.svg"; +export { ReactComponent as IconPlacesNew } from "./icon-places-new.svg"; +export { ReactComponent as IconGeofencesTrackers } from "./icon-geofences-trackers.svg"; +export { ReactComponent as IconFinancialService } from "./icon-financial-service.svg"; +export { ReactComponent as IconHealthcare } from "./icon-healthcare.svg"; +export { ReactComponent as IconRetail } from "./icon-retail.svg"; +export { ReactComponent as IconTravelHospitality } from "./icon-travel-hospitality.svg"; +export { ReactComponent as IconRealEstate } from "./icon-real-estate.svg"; +export { ReactComponent as IconProductResources } from "./icon-product-resources.svg"; +export { ReactComponent as IconDeveloperResources } from "./icon-developer-resources.svg"; +export { ReactComponent as IconCustomers } from "./icon-customers.svg"; diff --git a/src/atomicui/atoms/List/List.tsx b/src/atomicui/atoms/List/List.tsx index 43e033f0..5397cb1d 100644 --- a/src/atomicui/atoms/List/List.tsx +++ b/src/atomicui/atoms/List/List.tsx @@ -58,7 +58,10 @@ const LinkWrapper: React.FC = ({ > {children} {hasSubMenuItems && ( - + )} ); @@ -76,7 +79,10 @@ const LinkWrapper: React.FC = ({ > {children} {hasSubMenuItems && ( - + )} ); diff --git a/src/atomicui/organisms/Explore/Explore.tsx b/src/atomicui/organisms/Explore/Explore.tsx index 5c0cf30a..2ec5d6ba 100644 --- a/src/atomicui/organisms/Explore/Explore.tsx +++ b/src/atomicui/organisms/Explore/Explore.tsx @@ -10,11 +10,23 @@ import { IconBrandAndroid, IconBrandApple, IconBrowser, + IconCustomers, + IconDeveloperResources, IconDirections, + IconFinancialService, IconGeofencePlusSolid, + IconGeofencesTrackers, IconGlobe, + IconHealthcare, IconMapSolid, - IconRadar + IconPlacesNew, + IconProductResources, + IconRadar, + IconRealEstate, + IconRetail, + IconRoute, + IconTravelHospitality, + IconTruckSolid } from "@demo/assets/svgs"; import { appConfig } from "@demo/core/constants"; import BottomSheetHeights from "@demo/core/constants/bottomSheetHeights"; @@ -510,25 +522,29 @@ const Explore: FC = ({ }, { title: "header__overview.text", - description: "Lorem epsom dolor sit amet", + description: "new_overview_desc.text", onClickHandler: () => window.open(LEARN_MORE_URL, "_blank"), isEnabled: true }, { title: "header__product.text", - description: "header__product_desc.text", + description: "new_products_desc.text", onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "header__product.text": !s["header__product.text"] })), isEnabled: true, subMenu: [ { title: "maps.text", - description: "Lorem epsom dolor sit amet", + description: "new_maps_desc.text", onClickHandler: () => window.open(AWS_LOCATION_MAPS_URL, "_blank"), isEnabled: true, iconComponent: ( - @@ -536,12 +552,15 @@ const Explore: FC = ({ }, { title: "places.text", - description: "Lorem epsom dolor sit amet", + description: "new_places_desc.text", onClickHandler: () => window.open(AWS_LOCATION_PLACES_URL, "_blank"), isEnabled: true, iconComponent: ( - @@ -549,12 +568,16 @@ const Explore: FC = ({ }, { title: "routes.text", - description: "Lorem epsom dolor sit amet", + description: "new_routes_desc.text", onClickHandler: () => window.open(AWS_LOCATION_ROUTES_URL, "_blank"), isEnabled: true, iconComponent: ( - @@ -562,11 +585,11 @@ const Explore: FC = ({ }, { title: "geofences_and_trackers.text", - description: "Lorem epsom dolor sit amet", + description: "new_geofences_trackers_desc.text", onClickHandler: () => window.open(AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "footer__getting_started.text", - description: "Lorem epsom dolor sit amet", + description: "new_getting_started_desc.text", onClickHandler: () => window.open(AWS_GETTING_STARTED_URL, "_blank"), isEnabled: true }, { title: "pricing.text", - description: "pricing_desc.text", + description: "new_pricing_desc.text", onClickHandler: () => window.open(AWS_PRICING_URL, "_blank"), isEnabled: true }, { title: "footer__faq.text", - description: "Lorem epsom dolor sit amet", + description: "new_faqs_desc.text", onClickHandler: () => window.open(AWS_FAQ_URL, "_blank"), isEnabled: true }, { title: "industry.text", - description: "Lorem epsom dolor sit amet", + description: "new_industry_desc.text", onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "industry.text": !s["industry.text"] })), isEnabled: true, subMenu: [ { title: "transportation_and_logistics.text", - description: "Lorem epsom dolor sit amet", + description: "new_transportation_logistics_desc.text", onClickHandler: () => window.open(AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, "_blank"), isEnabled: true, iconComponent: ( - @@ -614,11 +641,11 @@ const Explore: FC = ({ }, { title: "financial_service.text", - description: "Lorem epsom dolor sit amet", + description: "new_financial_service_desc.text", onClickHandler: () => window.open(AWS_LOCATION_FINANCIAL_SERVICE_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "healthcare.text", - description: "Lorem epsom dolor sit amet", + description: "new_healthcare_desc.text", onClickHandler: () => window.open(AWS_LOCATION_HEALTHCARE_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "retails.text", - description: "Lorem epsom dolor sit amet", + description: "new_retail_desc.text", onClickHandler: () => window.open(AWS_LOCATION_RETAILS_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "travel_and_hospitality.text", - description: "Lorem epsom dolor sit amet", + description: "new_travel_hospitality_desc.text", onClickHandler: () => window.open(AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "real_estate.text", - description: "Lorem epsom dolor sit amet", + description: "new_real_estate_desc.text", onClickHandler: () => window.open(AWS_LOCATION_REAL_ESTATE_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "resources.text", - description: "Lorem epsom dolor sit amet", + description: "new_resources_desc.text", onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "resources.text": !s["resources.text"] })), isEnabled: true, subMenu: [ { title: "customers.text", - description: "Lorem epsom dolor sit amet", + description: "new_customers_desc.text", onClickHandler: () => window.open(AWS_LOCATION_CUSTOMERS_URL, "_blank"), isEnabled: true, iconComponent: ( - @@ -700,11 +731,11 @@ const Explore: FC = ({ }, { title: "product_resources.text", - description: "Lorem epsom dolor sit amet", + description: "new_product_resources_desc.text", onClickHandler: () => window.open(AWS_LOCATION_PRODUCT_RESOURCES_URL, "_blank"), isEnabled: true, iconComponent: ( - = ({ }, { title: "developer_resources.text", - description: "Lorem epsom dolor sit amet", + description: "new_developer_resources_desc.text", onClickHandler: () => window.open(AWS_LOCATION_DEVELOPER_RESOURCES_URL, "_blank"), isEnabled: true, iconComponent: ( - Date: Wed, 18 Sep 2024 17:28:39 +0500 Subject: [PATCH 3/6] updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b49625c..8d36bd4d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - `WebSocketUrl` value will be added to `.env` file against `VITE_AWS_WEB_SOCKET_URLS` **(comma separated for multiple values)**. 3. Value for `VITE_AWS_CF_TEMPLATE`, `VITE_APPLE_APP_STORE_LINK`, `VITE_GOOGLE_PLAY_STORE_LINK` can be added as it is to `.env` file from `.env.examples`. 4. Value for `VITE_APP_VERSION` needs to be populated with the correct version at the time of deployment in the following format `2.1.0`. -5. Values for `VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE`, `VITE_MIGRATE_A_WEB_APP_PAGE`, `VITE_MIGRATE_AN_ANDROID_APP_PAGE`, `VITE_MIGRATE_AN_IOS_APP_PAGE`, `VITE_MIGRATE_A_WEB_SERVICE_PAGE` and `VITE_PRICING_PAG` can either be `1` or `0` to either enable or disable the respective pages. +5. Values for `VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE`, `VITE_MIGRATE_A_WEB_APP_PAGE`, `VITE_MIGRATE_AN_ANDROID_APP_PAGE`, `VITE_MIGRATE_AN_IOS_APP_PAGE`, `VITE_MIGRATE_A_WEB_SERVICE_PAGE` and `VITE_PRICING_PAGE` can either be `1` or `0` to either enable or disable the respective pages. 6. Values for `VITE_SHOW_NEW_NAVIGATION` can either be `1` or `0` to either enable or disable the new navigation, turning it off would should the current navigation instead. #### Env keys required in `.env` file, see `.env.example` for reference From 35bdb97234303cccc20fb484f49076b8a7d78e19 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:42:59 +0500 Subject: [PATCH 4/6] updated link opening and test --- src/atomicui/atoms/List/List.test.tsx | 7 ++- src/atomicui/atoms/List/List.tsx | 59 +++++++------------ src/atomicui/organisms/Explore/Explore.tsx | 34 +++++------ src/atomicui/pages/DemoPage/DemoPage.tsx | 2 +- .../constants/marketingMenuOptionsData.ts | 40 ++++++------- 5 files changed, 64 insertions(+), 78 deletions(-) diff --git a/src/atomicui/atoms/List/List.test.tsx b/src/atomicui/atoms/List/List.test.tsx index 7bf36af1..9214c9b3 100644 --- a/src/atomicui/atoms/List/List.test.tsx +++ b/src/atomicui/atoms/List/List.test.tsx @@ -12,15 +12,18 @@ describe("", () => { const listArray = [ ...[...Array(2)].map(() => ({ label: faker.random.word(), - link: faker.internet.url() + link: faker.internet.url(), + isExternalLink: true })), { label: faker.random.word(), link: "/somewhere", + isExternalLink: false, subMenu: [ { label: faker.random.word(), - link: "/somewhere" + link: "/somewhere", + isExternalLink: false } ] } diff --git a/src/atomicui/atoms/List/List.tsx b/src/atomicui/atoms/List/List.tsx index 5397cb1d..d1e5134b 100644 --- a/src/atomicui/atoms/List/List.tsx +++ b/src/atomicui/atoms/List/List.tsx @@ -6,6 +6,7 @@ import { FC, ReactNode, useState } from "react"; import { Flex, Link, Text, View, ViewProps } from "@aws-amplify/ui-react"; import { IconArrow } from "@demo/assets/svgs"; import { appConfig } from "@demo/core/constants"; +import { MenuItem } from "@demo/types"; import { uuid } from "@demo/utils/uuid"; import { omit } from "ramda"; import { useTranslation } from "react-i18next"; @@ -15,28 +16,9 @@ const { ENV: { SHOW_NEW_NAVIGATION } } = appConfig; -interface ListArr { - label: string; - link?: string; - iconBeforeLink?: string; - iconContainerClass?: string; - subMenu?: { - label: string; - link?: string; - isExternalLink?: boolean; - }[]; -} - -interface ListProps extends ViewProps { - listArray: ListArr[]; - useDefaultStyles?: boolean; - labelIsIcon?: boolean; - hideIcons?: boolean; -} - interface LinkWrapperProps { isExternalLink: boolean | undefined; - linkTo: string; + link: string; children: ReactNode; className?: string; hasSubMenuItems?: boolean; @@ -44,16 +26,19 @@ interface LinkWrapperProps { const LinkWrapper: React.FC = ({ isExternalLink = false, - linkTo = "#", + link = "#", children, className, hasSubMenuItems = false }) => { - if (isExternalLink) { + const checkIfExternalLink = (link: string): boolean => + !!(link?.startsWith("https://") || link?.startsWith("http://") || link?.startsWith("#")); + + if (checkIfExternalLink(link)) { return ( {children} @@ -70,9 +55,9 @@ const LinkWrapper: React.FC = ({ return ( - `${className} navigation-link ${isActive && linkTo !== "#" ? "amplify-text isActive" : "amplify-text"}` + `${className} navigation-link ${isActive && link !== "#" ? "amplify-text isActive" : "amplify-text"}` } style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }} target="_self" @@ -89,6 +74,13 @@ const LinkWrapper: React.FC = ({ } }; +interface ListProps extends ViewProps { + listArray: MenuItem[]; + useDefaultStyles?: boolean; + labelIsIcon?: boolean; + hideIcons?: boolean; +} + const List: FC = ({ listArray, useDefaultStyles = false, @@ -107,13 +99,9 @@ const List: FC = ({ import("./styles.scss"); } - const checkIfExternalLink = (link: string): boolean => - !!(link?.startsWith("https://") || link?.startsWith("http://") || link?.startsWith("#")); - return ( - {listArray.map(({ link, subMenu, label, iconContainerClass, iconBeforeLink }) => { - const isExternalLink = checkIfExternalLink(link || "#"); + {listArray.map(({ link, subMenu, label, iconContainerClass, iconBeforeLink, isExternalLink }) => { const hasSubMenuItems = !!subMenu?.length; return ( @@ -132,7 +120,7 @@ const List: FC = ({ {labelIsIcon ? : t(label)} @@ -140,12 +128,7 @@ const List: FC = ({ {hasSubMenuItems && !SHOW_NEW_NAVIGATION && ( {subMenu.map(({ link, isExternalLink, label }, idx) => ( - + {t(label)} ))} diff --git a/src/atomicui/organisms/Explore/Explore.tsx b/src/atomicui/organisms/Explore/Explore.tsx index 2ec5d6ba..99ab83a6 100644 --- a/src/atomicui/organisms/Explore/Explore.tsx +++ b/src/atomicui/organisms/Explore/Explore.tsx @@ -523,7 +523,7 @@ const Explore: FC = ({ { title: "header__overview.text", description: "new_overview_desc.text", - onClickHandler: () => window.open(LEARN_MORE_URL, "_blank"), + onClickHandler: () => window.open(LEARN_MORE_URL, "_self"), isEnabled: true }, { @@ -536,7 +536,7 @@ const Explore: FC = ({ { title: "maps.text", description: "new_maps_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_MAPS_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_MAPS_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "places.text", description: "new_places_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_PLACES_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_PLACES_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "routes.text", description: "new_routes_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_ROUTES_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_ROUTES_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "geofences_and_trackers.text", description: "new_geofences_trackers_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "footer__getting_started.text", description: "new_getting_started_desc.text", - onClickHandler: () => window.open(AWS_GETTING_STARTED_URL, "_blank"), + onClickHandler: () => window.open(AWS_GETTING_STARTED_URL, "_self"), isEnabled: true }, { title: "pricing.text", description: "new_pricing_desc.text", - onClickHandler: () => window.open(AWS_PRICING_URL, "_blank"), + onClickHandler: () => window.open(AWS_PRICING_URL, "_self"), isEnabled: true }, { title: "footer__faq.text", description: "new_faqs_desc.text", - onClickHandler: () => window.open(AWS_FAQ_URL, "_blank"), + onClickHandler: () => window.open(AWS_FAQ_URL, "_self"), isEnabled: true }, { @@ -625,7 +625,7 @@ const Explore: FC = ({ { title: "transportation_and_logistics.text", description: "new_transportation_logistics_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "financial_service.text", description: "new_financial_service_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_FINANCIAL_SERVICE_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_FINANCIAL_SERVICE_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "healthcare.text", description: "new_healthcare_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_HEALTHCARE_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_HEALTHCARE_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "retails.text", description: "new_retail_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_RETAILS_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_RETAILS_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "travel_and_hospitality.text", description: "new_travel_hospitality_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "real_estate.text", description: "new_real_estate_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_REAL_ESTATE_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_REAL_ESTATE_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "customers.text", description: "new_customers_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_CUSTOMERS_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_CUSTOMERS_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "product_resources.text", description: "new_product_resources_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_PRODUCT_RESOURCES_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_PRODUCT_RESOURCES_URL, "_self"), isEnabled: true, iconComponent: ( = ({ { title: "developer_resources.text", description: "new_developer_resources_desc.text", - onClickHandler: () => window.open(AWS_LOCATION_DEVELOPER_RESOURCES_URL, "_blank"), + onClickHandler: () => window.open(AWS_LOCATION_DEVELOPER_RESOURCES_URL, "_self"), isEnabled: true, iconComponent: ( { isUserAwsAccountConnected && region ? `https://${region}.console.aws.amazon.com/location/home?region=${region}#/` : AWS_LOCATION, - "_blank" + isUserAwsAccountConnected && region ? "_blank" : "_self" ); return !!authOptions?.transformRequest ? ( diff --git a/src/core/constants/marketingMenuOptionsData.ts b/src/core/constants/marketingMenuOptionsData.ts index 3aa09aee..6649d0ca 100644 --- a/src/core/constants/marketingMenuOptionsData.ts +++ b/src/core/constants/marketingMenuOptionsData.ts @@ -162,34 +162,34 @@ if (!SHOW_NEW_NAVIGATION) { link: LEARN_MORE_URL, iconBeforeLink: IconCodeMenu, iconContainerClass: "menu-item-icon", - isExternalLink: true + isExternalLink: false }, { label: "header__product.text", link: AWS_LOCATION_MAPS_URL, iconBeforeLink: IconCodeMenu, iconContainerClass: "menu-item-icon", - isExternalLink: true, + isExternalLink: false, subMenu: [ { label: "maps.text", link: AWS_LOCATION_MAPS_URL, - isExternalLink: true + isExternalLink: false }, { label: "places.text", link: AWS_LOCATION_PLACES_URL, - isExternalLink: true + isExternalLink: false }, { label: "routes.text", link: AWS_LOCATION_ROUTES_URL, - isExternalLink: true + isExternalLink: false }, { label: "geofences_and_trackers.text", link: AWS_LOCATION_GENFENCE_AND_TRACKERS_URL, - isExternalLink: true + isExternalLink: false } ] }, @@ -198,58 +198,58 @@ if (!SHOW_NEW_NAVIGATION) { link: AWS_GETTING_STARTED_URL, iconBeforeLink: IconCodeMenu, iconContainerClass: "menu-item-icon", - isExternalLink: true + isExternalLink: false }, { label: "pricing.text", link: AWS_PRICING_URL, iconBeforeLink: IconDollarSolid, iconContainerClass: "menu-item-icon", - isExternalLink: true + isExternalLink: false }, { label: "footer__faq.text", link: AWS_FAQ_URL, iconBeforeLink: IconDollarSolid, iconContainerClass: "menu-item-icon", - isExternalLink: true + isExternalLink: false }, { label: "industry.text", link: AWS_LOCATION_INDUSTRY_URL, iconBeforeLink: IconCodeMenu, iconContainerClass: "menu-item-icon", - isExternalLink: true, + isExternalLink: false, subMenu: [ { label: "transportation_and_logistics.text", link: AWS_LOCATION_TRANSPORTATION_AND_LOGISTICS_URL, - isExternalLink: true + isExternalLink: false }, { label: "financial_service.text", link: AWS_LOCATION_FINANCIAL_SERVICE_URL, - isExternalLink: true + isExternalLink: false }, { label: "healthcare.text", link: AWS_LOCATION_HEALTHCARE_URL, - isExternalLink: true + isExternalLink: false }, { label: "retails.text", link: AWS_LOCATION_RETAILS_URL, - isExternalLink: true + isExternalLink: false }, { label: "travel_and_hospitality.text", link: AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL, - isExternalLink: true + isExternalLink: false }, { label: "real_estate.text", link: AWS_LOCATION_REAL_ESTATE_URL, - isExternalLink: true + isExternalLink: false } ] }, @@ -258,22 +258,22 @@ if (!SHOW_NEW_NAVIGATION) { link: AWS_LOCATION_RESOURCES_URL, iconBeforeLink: IconCodeMenu, iconContainerClass: "menu-item-icon", - isExternalLink: true, + isExternalLink: false, subMenu: [ { label: "customers.text", link: AWS_LOCATION_CUSTOMERS_URL, - isExternalLink: true + isExternalLink: false }, { label: "product_resources.text", link: AWS_LOCATION_PRODUCT_RESOURCES_URL, - isExternalLink: true + isExternalLink: false }, { label: "developer_resources.text", link: AWS_LOCATION_DEVELOPER_RESOURCES_URL, - isExternalLink: true + isExternalLink: false } ] } From 47eb43a47edcc20bf760f11e1d986124b1daeee6 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Fri, 20 Sep 2024 20:13:55 +0500 Subject: [PATCH 5/6] updates --- src/atomicui/organisms/Explore/Explore.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/atomicui/organisms/Explore/Explore.tsx b/src/atomicui/organisms/Explore/Explore.tsx index 99ab83a6..7ab1e85f 100644 --- a/src/atomicui/organisms/Explore/Explore.tsx +++ b/src/atomicui/organisms/Explore/Explore.tsx @@ -130,7 +130,7 @@ const Explore: FC = ({ onshowUnauthSimulationDisclaimerModal, bottomSheetRef }) => { - const [isMenuExapnded, setIsMenuExapnded] = useState<{ [key: string]: boolean }>({ + const [isMenuExpanded, setIsMenuExpanded] = useState<{ [key: string]: boolean }>({ "migration.text": false, "header__product.text": false, "industry.text": false, @@ -315,7 +315,7 @@ const Explore: FC = ({ { title: "migration.text", description: "migration_desc.text", - onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "migration.text": !s["migration.text"] })), + onClickHandler: () => setIsMenuExpanded(s => ({ ...s, "migration.text": !s["migration.text"] })), isEnabled: MIGRATE_FROM_GOOGLE_MAPS_PAGE || MIGRATE_A_WEB_APP_PAGE || @@ -426,7 +426,7 @@ const Explore: FC = ({ { title: "migration.text", description: "migration_desc.text", - onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "migration.text": !s["migration.text"] })), + onClickHandler: () => setIsMenuExpanded(s => ({ ...s, "migration.text": !s["migration.text"] })), isEnabled: MIGRATE_FROM_GOOGLE_MAPS_PAGE || MIGRATE_A_WEB_APP_PAGE || @@ -530,7 +530,7 @@ const Explore: FC = ({ title: "header__product.text", description: "new_products_desc.text", onClickHandler: () => - setIsMenuExapnded(s => ({ ...s, "header__product.text": !s["header__product.text"] })), + setIsMenuExpanded(s => ({ ...s, "header__product.text": !s["header__product.text"] })), isEnabled: true, subMenu: [ { @@ -619,7 +619,7 @@ const Explore: FC = ({ { title: "industry.text", description: "new_industry_desc.text", - onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "industry.text": !s["industry.text"] })), + onClickHandler: () => setIsMenuExpanded(s => ({ ...s, "industry.text": !s["industry.text"] })), isEnabled: true, subMenu: [ { @@ -709,7 +709,7 @@ const Explore: FC = ({ { title: "resources.text", description: "new_resources_desc.text", - onClickHandler: () => setIsMenuExapnded(s => ({ ...s, "resources.text": !s["resources.text"] })), + onClickHandler: () => setIsMenuExpanded(s => ({ ...s, "resources.text": !s["resources.text"] })), isEnabled: true, subMenu: [ { @@ -770,10 +770,10 @@ const Explore: FC = ({ + } title={t(title)} - titleColor={isMenuExapnded[title] ? "var(--primary-color)" : ""} + titleColor={isMenuExpanded[title] ? "var(--primary-color)" : ""} description={t(description)} cardMargin={ idx === 0 && (!isUserAwsAccountConnected || !isAuthenticated) ? "2rem 0 0.923rem 0" : "0.923rem 0" @@ -783,7 +783,7 @@ const Explore: FC = ({ onClickHandler={onClickHandler} style={{ padding: "0 1rem" }} /> - {isMenuExapnded[title] && + {isMenuExpanded[title] && subMenu.map(({ isEnabled, iconComponent, title, description, onClickHandler }, subIdx) => { if (isEnabled) { return ( @@ -830,7 +830,7 @@ const Explore: FC = ({ } } }); - }, [exploreMoreOptions, isAuthenticated, isMenuExapnded, isUserAwsAccountConnected, t]); + }, [exploreMoreOptions, isAuthenticated, isMenuExpanded, isUserAwsAccountConnected, t]); const exploreButtons = [ { From 79033dec741ac7a373ef86d004f7bc432cd5ea19 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:57:21 +0500 Subject: [PATCH 6/6] resolved comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d36bd4d..9d26f3e2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ 3. Value for `VITE_AWS_CF_TEMPLATE`, `VITE_APPLE_APP_STORE_LINK`, `VITE_GOOGLE_PLAY_STORE_LINK` can be added as it is to `.env` file from `.env.examples`. 4. Value for `VITE_APP_VERSION` needs to be populated with the correct version at the time of deployment in the following format `2.1.0`. 5. Values for `VITE_MIGRATE_FROM_GOOGLE_MAPS_PAGE`, `VITE_MIGRATE_A_WEB_APP_PAGE`, `VITE_MIGRATE_AN_ANDROID_APP_PAGE`, `VITE_MIGRATE_AN_IOS_APP_PAGE`, `VITE_MIGRATE_A_WEB_SERVICE_PAGE` and `VITE_PRICING_PAGE` can either be `1` or `0` to either enable or disable the respective pages. -6. Values for `VITE_SHOW_NEW_NAVIGATION` can either be `1` or `0` to either enable or disable the new navigation, turning it off would should the current navigation instead. +6. Values for `VITE_SHOW_NEW_NAVIGATION` can either be `1` or `0` to either enable or disable the new navigation, turning it off would show the current navigation instead. #### Env keys required in `.env` file, see `.env.example` for reference