Web:Studio:Fix loaders styles.

This commit is contained in:
Vlada Gazizova 2022-04-11 12:26:58 +03:00
parent 952996f534
commit 01e745f47b
4 changed files with 107 additions and 89 deletions

View File

@ -1,9 +1,16 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled, { css } from "styled-components";
import Loaders from "@appserver/common/components/Loaders"; import Loaders from "@appserver/common/components/Loaders";
import { isDesktop as isDesktopUtils } from "@appserver/components/utils/device"; import { isDesktop as isDesktopUtils } from "@appserver/components/utils/device";
import { isTablet } from "react-device-detect"; import { isTablet } from "react-device-detect";
const tabletStyles = css`
padding-top: 12px;
.loader {
width: 184px;
}
`;
const StyledLoader = styled.div` const StyledLoader = styled.div`
padding-top: 8px; padding-top: 8px;
@ -12,18 +19,12 @@ const StyledLoader = styled.div`
} }
@media (min-width: 600px) { @media (min-width: 600px) {
padding-top: 12px; ${tabletStyles}
.loader {
width: 184px;
}
} }
${isTablet && ${isTablet &&
css` css`
padding-top: 12px; ${tabletStyles}
.loader {
width: 184px;
}
`} `}
@media (min-width: 1025px) { @media (min-width: 1025px) {

View File

@ -1,7 +1,57 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled, { css } from "styled-components";
import Loaders from "@appserver/common/components/Loaders"; import Loaders from "@appserver/common/components/Loaders";
import { isTablet } from "react-device-detect";
const tabletStyles = css`
.header {
display: block;
width: ${(props) =>
props.lngTZSettings
? "283px"
: props.welcomePage
? "201px"
: props.portalRenaming
? "150px"
: 0};
padding-bottom: 16px;
}
.description {
display: none;
}
.title {
display: block;
width: ${(props) =>
props.lngTZSettings
? "65px"
: props.welcomePage
? "31px"
: props.portalRenaming
? "113px"
: 0};
}
.combo-box {
display: block;
width: 350px;
}
.field-container {
display: block;
width: 350px;
}
.save-cancel-buttons {
display: block;
position: static;
width: 350px;
padding: 0 0 24px 0;
}
`;
const StyledLoader = styled.div` const StyledLoader = styled.div`
.header { .header {
display: none; display: none;
@ -14,26 +64,23 @@ const StyledLoader = styled.div`
.title { .title {
width: ${(props) => (props.portalRenaming ? "49px" : "63.7px")}; width: ${(props) => (props.portalRenaming ? "49px" : "63.7px")};
height: 20px;
padding-bottom: 4px; padding-bottom: 4px;
} }
.title-long { .title-long {
display: block; display: block;
width: 68px; width: 68px;
height: 20px;
padding-bottom: 4px; padding-bottom: 4px;
} }
.combo-box { .combo-box {
display: block; display: block;
height: 32px;
width: 100%; width: 100%;
padding-bottom: 24px; padding-bottom: 24px;
} }
.field-container { .field-container {
height: 20px;
width: 100%; width: 100%;
padding-bottom: 12px; padding-bottom: 12px;
} }
@ -48,87 +95,49 @@ const StyledLoader = styled.div`
} }
@media (min-width: 600px) { @media (min-width: 600px) {
.header { ${tabletStyles}
display: block;
width: ${(props) =>
props.lngTZSettings
? "283px"
: props.welcomePage
? "201px"
: props.portalRenaming
? "150px"
: 0};
height: 22px;
padding-bottom: 16px;
}
.description {
display: none;
}
.title {
display: block;
width: ${(props) =>
props.lngTZSettings
? "65px"
: props.welcomePage
? "31px"
: props.portalRenaming
? "113px"
: 0};
height: 20px;
}
.combo-box {
display: block;
width: 350px;
}
.field-container {
display: block;
height: 20px;
width: 350px;
}
.save-cancel-buttons {
display: block;
position: static;
width: 350px;
height: 32px;
padding: 0 0 24px 0;
}
} }
${isTablet &&
`
${tabletStyles}
`}
`; `;
const loaderCustomization = ({ const LoaderCustomization = ({
lngTZSettings, lngTZSettings,
portalRenaming, portalRenaming,
welcomePage, welcomePage,
}) => { }) => {
const heightSaveCancelButtons = window.innerWidth < 600 ? "40px" : "32px";
return ( return (
<StyledLoader <StyledLoader
lngTZSettings={lngTZSettings} lngTZSettings={lngTZSettings}
portalRenaming={portalRenaming} portalRenaming={portalRenaming}
welcomePage={welcomePage} welcomePage={welcomePage}
> >
<Loaders.Rectangle className="header" /> <Loaders.Rectangle height="22px" className="header" />
{portalRenaming && ( {portalRenaming && (
<Loaders.Rectangle height="80px" className="description" /> <Loaders.Rectangle height="80px" className="description" />
)} )}
<Loaders.Rectangle className="title" /> <Loaders.Rectangle height="20px" className="title" />
<Loaders.Rectangle className="combo-box" /> <Loaders.Rectangle height="32px" className="combo-box" />
{lngTZSettings && ( {lngTZSettings && (
<> <>
<Loaders.Rectangle className="field-container" /> <Loaders.Rectangle height="20px" className="field-container" />
<Loaders.Rectangle className="title-long" /> <Loaders.Rectangle height="20px" className="title-long" />
<Loaders.Rectangle className="combo-box" /> <Loaders.Rectangle height="32px" className="combo-box" />
</> </>
)} )}
<Loaders.Rectangle height="40px" className="save-cancel-buttons" /> <Loaders.Rectangle
height={heightSaveCancelButtons}
className="save-cancel-buttons"
/>
</StyledLoader> </StyledLoader>
); );
}; };
export default loaderCustomization; export default LoaderCustomization;

View File

@ -5,7 +5,6 @@ import Loaders from "@appserver/common/components/Loaders";
const StyledLoader = styled.div` const StyledLoader = styled.div`
.title-long { .title-long {
width: 283px; width: 283px;
height: 22px;
padding-bottom: 8px; padding-bottom: 8px;
} }
@ -16,32 +15,30 @@ const StyledLoader = styled.div`
.link { .link {
width: 57px; width: 57px;
height: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.title { .title {
display: block; display: block;
width: 132px; width: 132px;
height: 22px;
padding-bottom: 8px; padding-bottom: 8px;
} }
`; `;
const loaderCustomizationNavbar = () => { const LoaderCustomizationNavbar = () => {
return ( return (
<StyledLoader> <StyledLoader>
<Loaders.Rectangle className="title-long" /> <Loaders.Rectangle height="22px" className="title-long" />
<Loaders.Rectangle height="100px" className="width" /> <Loaders.Rectangle height="100px" className="width" />
<Loaders.Rectangle className="link" /> <Loaders.Rectangle height="20px" className="link" />
<Loaders.Rectangle className="title" /> <Loaders.Rectangle height="22px" className="title" />
<Loaders.Rectangle height="80px" className="width" /> <Loaders.Rectangle height="80px" className="width" />
<Loaders.Rectangle className="title" /> <Loaders.Rectangle height="22px" className="title" />
<Loaders.Rectangle height="20px" className="width" /> <Loaders.Rectangle height="20px" className="width" />
</StyledLoader> </StyledLoader>
); );
}; };
export default loaderCustomizationNavbar; export default LoaderCustomizationNavbar;

View File

@ -1,14 +1,25 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled, { css } from "styled-components";
import Loaders from "@appserver/common/components/Loaders"; import Loaders from "@appserver/common/components/Loaders";
import { isTablet } from "react-device-detect";
const tabletStyles = css`
.description {
width: 684px;
padding-bottom: 20px;
}
`;
const StyledLoader = styled.div` const StyledLoader = styled.div`
@media (min-width: 600px) { @media (min-width: 600px) {
.description { ${tabletStyles}
width: 684px;
padding-bottom: 20px;
}
} }
${isTablet &&
css`
${tabletStyles}
`}
@media (min-width: 1024px) { @media (min-width: 1024px) {
.description { .description {
width: 700px; width: 700px;
@ -16,12 +27,12 @@ const StyledLoader = styled.div`
} }
`; `;
const loaderDescriptionCustomization = () => { const LoaderDescriptionCustomization = () => {
return ( return (
<StyledLoader> <StyledLoader>
<Loaders.Rectangle className="description" /> <Loaders.Rectangle height="40px" className="description" />
</StyledLoader> </StyledLoader>
); );
}; };
export default loaderDescriptionCustomization; export default LoaderDescriptionCustomization;