Web: Files: added view saving to localStorage, refactoring
This commit is contained in:
parent
352cfaf2f1
commit
fbbb5a34ef
@ -591,7 +591,7 @@ class FilesContent extends React.Component {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{viewAs !== "tile" && (
|
||||
{viewAs !== "tile" ? (
|
||||
<Text
|
||||
containerMinWidth="120px"
|
||||
containerWidth="15%"
|
||||
@ -605,8 +605,8 @@ class FilesContent extends React.Component {
|
||||
>
|
||||
{fileOwner}
|
||||
</Text>
|
||||
)}
|
||||
{viewAs !== "tile" && (
|
||||
) : null}
|
||||
{viewAs !== "tile" ? (
|
||||
<Text
|
||||
containerMinWidth="200px"
|
||||
containerWidth="15%"
|
||||
@ -618,8 +618,8 @@ class FilesContent extends React.Component {
|
||||
>
|
||||
{(fileExst || !providerKey) && updatedDate && updatedDate}
|
||||
</Text>
|
||||
)}
|
||||
{viewAs !== "tile" && (
|
||||
) : null}
|
||||
{viewAs !== "tile" ? (
|
||||
<Text
|
||||
containerMinWidth="90px"
|
||||
containerWidth="10%"
|
||||
@ -639,7 +639,7 @@ class FilesContent extends React.Component {
|
||||
)}: ${foldersCount}`
|
||||
: ""}
|
||||
</Text>
|
||||
)}
|
||||
) : null}
|
||||
</Content>
|
||||
</>
|
||||
);
|
||||
|
@ -109,6 +109,7 @@ const getSideInfo = (content) => {
|
||||
const lastIndex = content.length - 1;
|
||||
|
||||
content.forEach((element, index) => {
|
||||
if (element) {
|
||||
const delimiter = index === lastIndex ? "" : " | ";
|
||||
if (index > 1) {
|
||||
info +=
|
||||
@ -116,6 +117,7 @@ const getSideInfo = (content) => {
|
||||
? element.props.children + delimiter
|
||||
: "";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return info;
|
||||
@ -158,7 +160,7 @@ const TileContent = (props) => {
|
||||
<MainIcons className="mainIcons">{children[1]}</MainIcons>
|
||||
</MainContainerWrapper>
|
||||
{children.map((element, index) => {
|
||||
if (index > 1) {
|
||||
if (index > 1 && element) {
|
||||
return (
|
||||
<SideContainerWrapper
|
||||
disableSideInfo={disableSideInfo}
|
||||
|
@ -45,7 +45,7 @@ const Badges = (props) => {
|
||||
onShowVersionHistory,
|
||||
onBadgeClick,
|
||||
} = props;
|
||||
const { id, locked, fileStatus, versionGroup, access, title } = item;
|
||||
const { id, locked, fileStatus, versionGroup, title } = item;
|
||||
const { fileExst } = item;
|
||||
|
||||
const showNew = !!newItems;
|
||||
|
@ -26,7 +26,7 @@ class FilesStore {
|
||||
|
||||
isLoaded = false;
|
||||
isLoading = false;
|
||||
viewAs = "row";
|
||||
viewAs = localStorage.getItem("viewAs") || "row";
|
||||
dragging = false;
|
||||
privacyInstructions = "https://www.onlyoffice.com/private-rooms.aspx";
|
||||
isInit = false;
|
||||
@ -71,6 +71,7 @@ class FilesStore {
|
||||
|
||||
setViewAs = (viewAs) => {
|
||||
this.viewAs = viewAs;
|
||||
localStorage.setItem("viewAs", viewAs);
|
||||
};
|
||||
|
||||
setDragging = (dragging) => {
|
||||
|
Loading…
Reference in New Issue
Block a user