Web: CRM: Fixed style for mobile and tablet devices, fixed description, disabled learn more button

This commit is contained in:
Ilya Oleshko 2021-04-16 22:12:25 +03:00
parent e586d42d3b
commit c083473d5a
3 changed files with 25 additions and 19 deletions

View File

@ -2,5 +2,6 @@
"ComingSoon": "Coming soon", "ComingSoon": "Coming soon",
"ViewWeb": "View web version", "ViewWeb": "View web version",
"OpenApp": "Open your {{title}} app", "OpenApp": "Open your {{title}} app",
"LearnMore": "Learn more" "LearnMore": "Learn more",
"ModuleDescription": "Manage your contacts and sales"
} }

View File

@ -2,5 +2,6 @@
"ComingSoon": "Скоро появится", "ComingSoon": "Скоро появится",
"ViewWeb": "Просмотреть веб-версию", "ViewWeb": "Просмотреть веб-версию",
"OpenApp": "Откройте {{title}}", "OpenApp": "Откройте {{title}}",
"LearnMore": "Узнать больше" "LearnMore": "Узнать больше",
"ModuleDescription": "Управляйте своими контактами и продажами"
} }

View File

@ -13,7 +13,7 @@ import toastr from "studio/toastr";
import PageLayout from "@appserver/common/components/PageLayout"; import PageLayout from "@appserver/common/components/PageLayout";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import styled from "styled-components"; import styled from "styled-components";
import { isMobile, isIOS } from "react-device-detect"; import { isMobile, isTablet, isIOS } from "react-device-detect";
import { setDocumentTitle } from "../../helpers/utils"; import { setDocumentTitle } from "../../helpers/utils";
import { inject } from "mobx-react"; import { inject } from "mobx-react";
@ -34,14 +34,19 @@ const commonStyles = `
`; `;
const ComingSoonPage = styled.div` const ComingSoonPage = styled.div`
padding: ${isMobile ? "62px 0 0 0" : "0"}; padding: ${isTablet ? "106px 0 0 0" : isMobile ? "62px 0 0 0" : "0"};
width: 336px; width: ${isTablet ? "500px" : "336px"};
margin: 0 auto; margin: 0 auto;
.module-logo-icon { .module-logo-icon {
float: left; float: left;
margin-top: 8px; margin-top: 8px;
margin-right: 16px; margin-right: 16px;
svg {
width: ${isTablet ? "192px" : "96px"};
height: ${isTablet ? "192px" : "96px"};
}
} }
.module-title { .module-title {
@ -93,7 +98,10 @@ const StyledDesktopContainer = styled(EmptyScreenContainer)`
const ExternalLink = ({ label, href, onClick }) => ( const ExternalLink = ({ label, href, onClick }) => (
<Box className="link-box"> <Box className="link-box">
<ExternalLinkIcon color="#333333" size={isMobile ? "small" : "medium"} /> <ExternalLinkIcon
color="#333333"
size={isMobile || isTablet ? "small" : "medium"}
/>
<Link <Link
as="a" as="a"
href={href} href={href}
@ -114,15 +122,7 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId }) => {
const { error } = match.params; const { error } = match.params;
const { pathname, protocol, hostname } = window.location; const { pathname, protocol, hostname } = window.location;
const currentModule = modules.find((m) => m.link === pathname); const currentModule = modules.find((m) => m.link === pathname);
const { const { id, title, imageUrl, link, originUrl, helpUrl } = currentModule;
id,
title,
description,
imageUrl,
link,
originUrl,
helpUrl,
} = currentModule;
const url = originUrl ? originUrl : link; const url = originUrl ? originUrl : link;
const webLink = combineUrl( const webLink = combineUrl(
protocol + "//" + hostname, protocol + "//" + hostname,
@ -172,8 +172,8 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId }) => {
const moduleDescription = ( const moduleDescription = (
<Text className="module-info"> <Text className="module-info">
{description}{" "} {t("ModuleDescription")}{" "}
{helpUrl && ( {helpUrl && false && (
<Link <Link
as="a" as="a"
href={helpUrl} href={helpUrl}
@ -191,7 +191,7 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId }) => {
return !isLoaded ? ( return !isLoaded ? (
<></> <></>
) : isMobile ? ( ) : isMobile || isTablet ? (
<ComingSoonPage> <ComingSoonPage>
<ReactSVG <ReactSVG
className="module-logo-icon" className="module-logo-icon"
@ -208,7 +208,11 @@ const Body = ({ modules, match, isLoaded, setCurrentProductId }) => {
src={imageUrl} src={imageUrl}
/> />
<Box displayProp="flex" flexDirection="column" widthProp="220px"> <Box displayProp="flex" flexDirection="column" widthProp="220px">
<Text fontWeight="600" fontSize="19px" className="module-title"> <Text
fontWeight="600"
fontSize={isTablet ? "24px" : "19px"}
className="module-title"
>
{title} {title}
</Text> </Text>
{moduleDescription} {moduleDescription}