Web:Files:Components: add isShared prop for modal loader

This commit is contained in:
Timofey Boyko 2022-04-19 14:58:57 +03:00
parent 4b327b642a
commit 58d61b4366
2 changed files with 27 additions and 8 deletions

View File

@ -13,7 +13,14 @@ import {
} from "./StyledSharingPanel";
import RectangleLoader from "../RectangleLoader/RectangleLoader";
const SharingPanelLoaderModal = ({ id, className, style, ...rest }) => {
const SharingPanelLoaderModal = ({
id,
className,
style,
isShared,
...rest
}) => {
console.log(isShared);
return (
<StyledContainer>
<StyledHeader isPersonal={true}>
@ -26,12 +33,16 @@ const SharingPanelLoaderModal = ({ id, className, style, ...rest }) => {
width={"146px"}
height={"22px"}
/>
<RectangleLoader
className="rectangle-loader"
width={"368px"}
height={"32px"}
/>
<RectangleLoader width={"184px"} height={"20px"} />
{isShared && (
<>
<RectangleLoader
className="rectangle-loader"
width={"368px"}
height={"32px"}
/>
<RectangleLoader width={"184px"} height={"20px"} />
</>
)}
</StyledExternalLink>
<StyledButtons>
<RectangleLoader width={"100%"} height={"40px"} />

View File

@ -292,6 +292,8 @@ class SharingPanelComponent extends React.Component {
let folderId = [];
let fileId = [];
console.log(selection);
for (let item of selection) {
if (item.access === 1 || item.access === 0) {
if (item.fileExst) {
@ -317,6 +319,8 @@ class SharingPanelComponent extends React.Component {
const folderId = returnValue[0];
const fileId = returnValue[1];
console.log(fileId, folderId);
if (folderId.length !== 0 || fileId.length !== 0) {
this.setState(
{
@ -470,6 +474,7 @@ class SharingPanelComponent extends React.Component {
sharingPanelVisible,
isPrivacy,
theme,
isShared,
} = this.props;
const {
isNotifyUsers,
@ -549,7 +554,7 @@ class SharingPanelComponent extends React.Component {
isPersonal={isPersonal}
>
<ModalDialog.Body>
<SharingPanelLoaderModal />
<SharingPanelLoaderModal isShared={isShared} />
</ModalDialog.Body>
</ModalDialog>
</>
@ -780,6 +785,8 @@ const SharingPanel = inject(
updateUploadedItem,
} = uploadDataStore;
console.log(selection[0].shared);
return {
theme: auth.settingsStore.theme,
isPersonal: personal,
@ -816,6 +823,7 @@ const SharingPanel = inject(
id,
setBufferSelection,
access,
isShared: selection[0].shared,
};
}
)(