Shared/Client: AddUsersPanel/InvitePanel: Fixed styles because of an aside header component.

This commit is contained in:
Tatiana Lopaeva 2024-08-22 17:08:11 +03:00
parent 9934ff843c
commit 52af6b45a4
7 changed files with 28 additions and 28 deletions

View File

@ -529,6 +529,7 @@ const AddUsersPanel = ({
visible={visible} visible={visible}
onClose={onClosePanels} onClose={onClosePanels}
withoutBodyScroll withoutBodyScroll
withoutHeader
> >
<Selector <Selector
withHeader withHeader
@ -539,6 +540,7 @@ const AddUsersPanel = ({
withoutBackButton: false, withoutBackButton: false,
withoutBorder: true, withoutBorder: true,
onBackClick, onBackClick,
onCloseClick: onClosePanels,
}} }}
onSelect={onSelect} onSelect={onSelect}
renderCustomItem={renderCustomItem} renderCustomItem={renderCustomItem}

View File

@ -140,6 +140,9 @@ const StyledBlock = styled.div`
StyledBlock.defaultProps = { theme: Base }; StyledBlock.defaultProps = { theme: Base };
const StyledExternalLink = styled.div`
border-bottom: ${(props) => props.theme.filesPanels.sharing.borderBottom};
`;
const StyledInviteUserBody = styled.div` const StyledInviteUserBody = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -616,4 +619,5 @@ export {
StyledInviteLanguage, StyledInviteLanguage,
StyledControlContainer, StyledControlContainer,
StyledInviteUserBody, StyledInviteUserBody,
StyledExternalLink,
}; };

View File

@ -431,9 +431,11 @@ const InvitePanel = ({
const invitePanelNode = ( const invitePanelNode = (
<> <>
<StyledBlock> {isMobileView && (
<StyledHeading truncate>{t("Common:InviteUsers")}</StyledHeading> <StyledBlock>
</StyledBlock> <StyledHeading truncate>{t("Common:InviteUsers")}</StyledHeading>
</StyledBlock>
)}
{invitePanelIsLoding ? ( {invitePanelIsLoding ? (
<InvitePanelLoader /> <InvitePanelLoader />
) : ( ) : (
@ -505,6 +507,7 @@ const InvitePanel = ({
onClose={onClose} onClose={onClose}
withoutBodyScroll withoutBodyScroll
zIndex={310} zIndex={310}
header={t("Common:InviteUsers")}
> >
{invitePanelNode} {invitePanelNode}
</Aside> </Aside>

View File

@ -45,12 +45,12 @@ import { Text } from "@docspace/shared/components/text";
import AccessSelector from "../../../AccessSelector"; import AccessSelector from "../../../AccessSelector";
import PaidQuotaLimitError from "../../../PaidQuotaLimitError"; import PaidQuotaLimitError from "../../../PaidQuotaLimitError";
import { import {
StyledBlock,
StyledSubHeader, StyledSubHeader,
StyledInviteInput, StyledInviteInput,
StyledInviteInputContainer, StyledInviteInputContainer,
StyledToggleButton, StyledToggleButton,
StyledDescription, StyledDescription,
StyledExternalLink,
} from "../StyledInvitePanel"; } from "../StyledInvitePanel";
import { getFreeUsersRoleArray, getFreeUsersTypeArray } from "../utils"; import { getFreeUsersRoleArray, getFreeUsersTypeArray } from "../utils";
@ -212,7 +212,7 @@ const ExternalLinks = ({
roomId === -1 ? getFreeUsersTypeArray() : getFreeUsersRoleArray(); roomId === -1 ? getFreeUsersTypeArray() : getFreeUsersRoleArray();
return ( return (
<StyledBlock noPadding ref={inputsRef}> <StyledExternalLink noPadding ref={inputsRef}>
<StyledSubHeader inline> <StyledSubHeader inline>
{t("InviteViaLink")} {t("InviteViaLink")}
{false && ( //TODO: Change to linksVisible after added link information from backend {false && ( //TODO: Change to linksVisible after added link information from backend
@ -285,7 +285,7 @@ const ExternalLinks = ({
/> />
</StyledInviteInputContainer> </StyledInviteInputContainer>
)} )}
</StyledBlock> </StyledExternalLink>
); );
}; };

View File

@ -41,6 +41,7 @@ const AsidePure = (props: AsideProps) => {
contentPaddingBottom, contentPaddingBottom,
withoutBodyScroll = false, withoutBodyScroll = false,
onClose, onClose,
withoutHeader = false,
...rest ...rest
} = props; } = props;
const contentRef = React.useRef<HTMLElement | null>(null); const contentRef = React.useRef<HTMLElement | null>(null);
@ -55,7 +56,7 @@ const AsidePure = (props: AsideProps) => {
forwardRef={contentRef} forwardRef={contentRef}
data-testid="aside" data-testid="aside"
> >
<AsideHeader onCloseClick={onClose} {...rest} /> {!withoutHeader && <AsideHeader onCloseClick={onClose} {...rest} />}
{withoutBodyScroll ? children : <Scrollbar>{children}</Scrollbar>} {withoutBodyScroll ? children : <Scrollbar>{children}</Scrollbar>}
</StyledAside> </StyledAside>
); );

View File

@ -73,6 +73,7 @@ export type BreadCrumbsProps = {
export type HeaderProps = { export type HeaderProps = {
headerLabel: string; headerLabel: string;
onCloseClick: () => void;
} & THeaderBackButton; } & THeaderBackButton;
export type TSelectorHeader = export type TSelectorHeader =

View File

@ -26,36 +26,25 @@
import React from "react"; import React from "react";
import ArrowPathReactSvgUrl from "PUBLIC_DIR/images/arrow.path.react.svg?url";
import { IconButton } from "../../icon-button";
import { Heading } from "../../heading";
import { StyledHeader } from "../Selector.styled";
import { HeaderProps } from "../Selector.types"; import { HeaderProps } from "../Selector.types";
import { AsideHeader } from "../../aside";
const Header = React.memo( const Header = React.memo(
({ ({
onBackClick, onBackClick,
onCloseClick,
withoutBackButton, withoutBackButton,
headerLabel, headerLabel,
withoutBorder,
}: HeaderProps) => { }: HeaderProps) => {
return ( return (
<StyledHeader withoutBorder={withoutBorder}> <AsideHeader
{!withoutBackButton && typeof withoutBackButton === "boolean" && ( header={headerLabel}
<IconButton isBackButton={
className="arrow-button" !withoutBackButton && typeof withoutBackButton === "boolean"
iconName={ArrowPathReactSvgUrl} }
size={17} onBackClick={onBackClick}
onClick={onBackClick} onCloseClick={onCloseClick}
/> />
)}
<Heading className="heading-text" truncate>
{headerLabel}
</Heading>
</StyledHeader>
); );
}, },
); );