+ sideColor={theme.filesSection.rowView.sideColor}
+ >
+ isTextOverflow={true}
+ >
{titleWithoutExt}
@@ -220,7 +220,8 @@ const FilesRowContent = ({
containerWidth="15%"
fontSize="12px"
fontWeight={400}
- className="row_update-text">
+ className="row_update-text"
+ >
{contentComponent()}
@@ -231,10 +232,11 @@ const FilesRowContent = ({
className="row-content-text"
fontSize="12px"
fontWeight={400}
- truncate={true}>
+ truncate={true}
+ >
{isRooms
? t(RoomsTypeTranslations[item.roomType])
- : !fileExst && !contentLength && !providerKey && !isMobileOnly
+ : !fileExst && !contentLength && !providerKey && !isMobile()
? `${foldersCount} ${t("Translations:Folders")} | ${filesCount} ${t(
"Translations:Files"
)}`
diff --git a/packages/client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js b/packages/client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js
index c6afb80d8a..acae9a2b1a 100644
--- a/packages/client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js
+++ b/packages/client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js
@@ -4,7 +4,7 @@ import { withTranslation } from "react-i18next";
import DragAndDrop from "@docspace/components/drag-and-drop";
import Row from "@docspace/components/row";
import FilesRowContent from "./FilesRowContent";
-import { isTablet, isMobile } from "react-device-detect";
+import { isMobile } from "react-device-detect";
import withFileActions from "../../../../../HOCs/withFileActions";
import withQuickButtons from "../../../../../HOCs/withQuickButtons";
diff --git a/packages/client/src/pages/Home/Section/Body/TableView/TableContainer.js b/packages/client/src/pages/Home/Section/Body/TableView/TableContainer.js
index 8b730f17c0..6e24c2ccea 100644
--- a/packages/client/src/pages/Home/Section/Body/TableView/TableContainer.js
+++ b/packages/client/src/pages/Home/Section/Body/TableView/TableContainer.js
@@ -6,18 +6,19 @@ import { useNavigate, useLocation } from "react-router-dom";
import TableRow from "./TableRow";
import TableHeader from "./TableHeader";
import TableBody from "@docspace/components/table-container/TableBody";
-import { isMobile } from "react-device-detect";
+
import styled, { css } from "styled-components";
import { Base } from "@docspace/components/themes";
+import { DeviceType } from "@docspace/common/constants";
const marginCss = css`
margin-top: -1px;
- border-top: ${props =>
+ border-top: ${(props) =>
`1px solid ${props.theme.filesSection.tableView.row.borderColor}`};
`;
const fileNameCss = css`
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: -24px;
@@ -32,7 +33,7 @@ const fileNameCss = css`
`;
const contextCss = css`
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: -20px;
@@ -70,13 +71,13 @@ const StyledTableContainer = styled(TableContainer)`
border-left: 0; //for Safari macOS
border-right: 0; //for Safari macOS
- border-image-source: ${props => `linear-gradient(to right,
+ border-image-source: ${(props) => `linear-gradient(to right,
${props.theme.filesSection.tableView.row.borderColorTransition} 17px, ${props.theme.filesSection.tableView.row.borderColor} 31px)`};
}
.table-container_row-context-menu-wrapper {
${contextCss}
- border-image-source: ${props => `linear-gradient(to left,
+ border-image-source: ${(props) => `linear-gradient(to left,
${props.theme.filesSection.tableView.row.borderColorTransition} 17px, ${props.theme.filesSection.tableView.row.borderColor} 31px)`};
}
}
@@ -108,7 +109,7 @@ const StyledTableContainer = styled(TableContainer)`
.table-container_file-name-cell,
.table-container_row-context-menu-wrapper {
- border-bottom: ${props =>
+ border-bottom: ${(props) =>
`1px solid ${props.theme.filesSection.tableView.row.borderColor}`};
}
}
@@ -140,6 +141,7 @@ const Table = ({
columnStorageName,
columnInfoPanelStorageName,
highlightFile,
+ currentDeviceType,
}) => {
const [tagCount, setTagCount] = React.useState(null);
const [hideColumns, setHideColumns] = React.useState(false);
@@ -159,13 +161,13 @@ const Table = ({
(width < 1025 && !infoPanelVisible) ||
((width < 625 || (viewAs === "row" && width < 1025)) &&
infoPanelVisible) ||
- isMobile
+ currentDeviceType !== DeviceType.desktop
) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
}
- }, [sectionWidth]);
+ }, [sectionWidth, currentDeviceType]);
useEffect(() => {
return () => {
@@ -176,7 +178,7 @@ const Table = ({
}, []);
const onResize = useCallback(
- node => {
+ (node) => {
const element = tagRef?.current ? tagRef?.current : node;
if (element) {
@@ -190,7 +192,7 @@ const Table = ({
[tagCount]
);
- const onSetTagRef = useCallback(node => {
+ const onSetTagRef = useCallback((node) => {
if (node) {
tagRef.current = node;
onResize(node);
@@ -258,7 +260,8 @@ const Table = ({
useReactWindow={!withPaging}
infoPanelVisible={infoPanelVisible}
columnInfoPanelStorageName={columnInfoPanelStorageName}
- itemHeight={49}>
+ itemHeight={49}
+ >
{filesListNode}
@@ -286,7 +289,7 @@ export default inject(({ filesStore, treeFoldersStore, auth, tableStore }) => {
highlightFile,
} = filesStore;
- const { withPaging, theme } = auth.settingsStore;
+ const { withPaging, theme, currentDeviceType } = auth.settingsStore;
return {
filesList,
@@ -306,5 +309,6 @@ export default inject(({ filesStore, treeFoldersStore, auth, tableStore }) => {
columnStorageName,
columnInfoPanelStorageName,
highlightFile,
+ currentDeviceType,
};
})(observer(Table));
diff --git a/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js b/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js
index 9e2640b971..f716ea113f 100644
--- a/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js
+++ b/packages/client/src/pages/Home/Section/Body/TableView/TableHeader.js
@@ -256,7 +256,7 @@ class FilesTableHeader extends React.Component {
componentDidMount() {
this.customScrollElm = document.getElementsByClassName("section-scroll")[0];
- this.customScrollElm.addEventListener("scroll", this.onBeginScroll);
+ this.customScrollElm?.addEventListener("scroll", this.onBeginScroll);
}
onBeginScroll = () => {
@@ -319,7 +319,7 @@ class FilesTableHeader extends React.Component {
}
componentWillUnmount() {
- this.customScrollElm.removeEventListener("scroll", this.onBeginScroll);
+ this.customScrollElm?.removeEventListener("scroll", this.onBeginScroll);
}
onColumnChange = (key) => {
diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/FilesTileContent.js b/packages/client/src/pages/Home/Section/Body/TilesView/FilesTileContent.js
index 3e1a04d7c7..c6a0f53ddc 100644
--- a/packages/client/src/pages/Home/Section/Body/TilesView/FilesTileContent.js
+++ b/packages/client/src/pages/Home/Section/Body/TilesView/FilesTileContent.js
@@ -8,7 +8,9 @@ import Link from "@docspace/components/link";
import TileContent from "./sub-components/TileContent";
import withContent from "../../../../../HOCs/withContent";
import withBadges from "../../../../../HOCs/withBadges";
-import { isMobile } from "react-device-detect";
+
+import { DeviceType } from "@docspace/common/constants";
+import { tablet } from "@docspace/components/utils/device";
const SimpleFilesTileContent = styled(TileContent)`
.row-main-container {
@@ -22,7 +24,7 @@ const SimpleFilesTileContent = styled(TileContent)`
}
.badge {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 8px;
@@ -37,7 +39,7 @@ const SimpleFilesTileContent = styled(TileContent)`
.new-items {
position: absolute;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
left: 29px;
@@ -55,7 +57,7 @@ const SimpleFilesTileContent = styled(TileContent)`
.share-icon {
margin-top: -4px;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-left: 8px;
@@ -93,7 +95,7 @@ const SimpleFilesTileContent = styled(TileContent)`
}
`}
- @media (max-width: 1024px) {
+ @media ${tablet} {
display: inline-flex;
height: auto;
@@ -109,6 +111,7 @@ const FilesTileContent = ({
linkStyles,
theme,
isRooms,
+ currentDeviceType,
}) => {
const { fileExst, title, viewAccessability } = item;
@@ -119,18 +122,20 @@ const FilesTileContent = ({
+ isRooms={isRooms}
+ >
+ isTextOverflow
+ >
{titleWithoutExt}
@@ -143,7 +148,11 @@ export default inject(({ auth, treeFoldersStore }) => {
const isRooms = isRoomsFolder || isArchiveFolder;
- return { theme: auth.settingsStore.theme, isRooms };
+ return {
+ theme: auth.settingsStore.theme,
+ currentDeviceType: auth.settingsStore.currentDeviceType,
+ isRooms,
+ };
})(
observer(
withTranslation(["Files", "Translations", "Notifications"])(
diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js
index 8f5c7a40da..ee5d8b7e2f 100644
--- a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js
+++ b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js
@@ -368,7 +368,7 @@ const StyledContent = styled.div`
margin-left: 12px;
}
- @media (max-width: 1024px) {
+ @media ${tablet} {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -641,6 +641,7 @@ class Tile extends React.PureComponent {
const contextMenuHeader = {
icon: children[0].props.item.icon,
title: children[0].props.item.title,
+ color: children[0].props.item.logo?.color,
};
const title = item.isFolder
diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/TileContent.js b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/TileContent.js
index 740433023a..4ada4a08db 100644
--- a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/TileContent.js
+++ b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/TileContent.js
@@ -1,6 +1,7 @@
import React from "react";
import styled, { css } from "styled-components";
import PropTypes from "prop-types";
+import { tablet } from "@docspace/components/utils/device";
const truncateCss = css`
white-space: nowrap;
@@ -36,7 +37,7 @@ const MainContainerWrapper = styled.div`
const MainContainer = styled.div`
height: 20px;
- @media (max-width: 1024px) {
+ @media ${tablet} {
${truncateCss};
}
`;
diff --git a/packages/client/src/pages/Home/Section/Body/index.js b/packages/client/src/pages/Home/Section/Body/index.js
index 75a7186f1e..bf66622e93 100644
--- a/packages/client/src/pages/Home/Section/Body/index.js
+++ b/packages/client/src/pages/Home/Section/Body/index.js
@@ -1,7 +1,6 @@
import React, { useEffect } from "react";
import { withTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";
-import { isMobile, isMobileOnly } from "react-device-detect";
import { observer, inject } from "mobx-react";
import FilesRowContainer from "./RowsView/FilesRowContainer";
@@ -12,6 +11,8 @@ import TableView from "./TableView/TableContainer";
import withHotkeys from "../../../../HOCs/withHotkeys";
import { Consumer } from "@docspace/components/utils/context";
import { isElementInViewport } from "@docspace/common/utils";
+import { isMobile, isTablet } from "@docspace/components/utils/device";
+import { DeviceType } from "@docspace/common/constants";
let currentDroppable = null;
let isDragActive = false;
@@ -43,6 +44,7 @@ const SectionBodyContent = (props) => {
onClickBack,
movingInProgress,
+ currentDeviceType,
} = props;
useEffect(() => {
@@ -54,7 +56,7 @@ const SectionBodyContent = (props) => {
"#customScrollBar > .scroll-wrapper > .scroller"
);
- if (isMobile) {
+ if (isTablet() || isMobile() || currentDeviceType !== DeviceType.desktop) {
customScrollElm && customScrollElm.scrollTo(0, 0);
}
@@ -85,6 +87,7 @@ const SectionBodyContent = (props) => {
folderId,
viewAs,
uploaded,
+ currentDeviceType,
]);
useEffect(() => {
@@ -98,21 +101,26 @@ const SectionBodyContent = (props) => {
let isInViewport = isElementInViewport(targetElement);
if (!isInViewport || viewAs === "table") {
- const bodyScroll = isMobileOnly
- ? document.querySelector(
- "#customScrollBar > .scroll-wrapper > .scroller"
- )
- : document.querySelector(".section-scroll");
+ const bodyScroll =
+ isMobile() || currentDeviceType === DeviceType.mobile
+ ? document.querySelector(
+ "#customScrollBar > .scroll-wrapper > .scroller"
+ )
+ : document.querySelector(".section-scroll");
const count =
filesList.findIndex((elem) => elem.id === scrollToItem.id) *
- (isMobileOnly ? 57 : viewAs === "table" ? 40 : 48);
+ (isMobile() || currentDeviceType === DeviceType.mobile
+ ? 57
+ : viewAs === "table"
+ ? 40
+ : 48);
bodyScroll.scrollTo(0, count);
}
setScrollToItem(null);
}
- }, [scrollToItem]);
+ }, [scrollToItem, currentDeviceType]);
const onBeforeunload = (e) => {
if (!uploaded) {
@@ -287,6 +295,7 @@ const SectionBodyContent = (props) => {
export default inject(
({
+ auth,
filesStore,
selectedFolderStore,
treeFoldersStore,
@@ -337,6 +346,7 @@ export default inject(
uploaded: uploadDataStore.uploaded,
onClickBack: filesActionsStore.onClickBack,
movingInProgress,
+ currentDeviceType: auth.settingsStore,
};
}
)(
diff --git a/packages/client/src/pages/Home/Section/Filter/index.js b/packages/client/src/pages/Home/Section/Filter/index.js
index 31ac284a88..f3573bd9d1 100644
--- a/packages/client/src/pages/Home/Section/Filter/index.js
+++ b/packages/client/src/pages/Home/Section/Filter/index.js
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect } from "react";
import { inject, observer } from "mobx-react";
import { useLocation, useNavigate } from "react-router-dom";
-import { isMobile, isMobileOnly } from "react-device-detect";
+
import { withTranslation } from "react-i18next";
import find from "lodash/find";
import result from "lodash/result";
@@ -26,6 +26,7 @@ import {
EmployeeStatus,
PaymentsType,
AccountLoginType,
+ DeviceType,
} from "@docspace/common/constants";
import { getDefaultRoomName } from "SRC_DIR/helpers/filesUtils";
@@ -251,6 +252,7 @@ const SectionFilterContent = ({
publicRoomKey,
setRoomsFilter,
standalone,
+ currentDeviceType,
}) => {
const location = useLocation();
const navigate = useNavigate();
@@ -522,7 +524,7 @@ const SectionFilterContent = ({
if (
(sectionWidth < 1025 && !infoPanelVisible) ||
(sectionWidth < 625 && infoPanelVisible) ||
- isMobile
+ currentDeviceType !== DeviceType.desktop
) {
setViewAs("row");
} else {
@@ -532,7 +534,7 @@ const SectionFilterContent = ({
setViewAs(view);
}
},
- [sectionWidth, infoPanelVisible, setViewAs]
+ [sectionWidth, infoPanelVisible, setViewAs, currentDeviceType]
);
const getSelectedInputValue = React.useCallback(() => {
@@ -1214,6 +1216,13 @@ const SectionFilterContent = ({
group: FilterGroups.roomFilterType,
label: t("ViewOnlyRooms"),
};
+ case RoomsType.PublicRoom:
+ return {
+ id: "filter_type-public",
+ key: RoomsType.PublicRoom,
+ group: FilterGroups.roomFilterType,
+ label: t("PublicRoom"),
+ };
case RoomsType.CustomRoom:
default:
return {
@@ -1967,7 +1976,7 @@ const SectionFilterContent = ({
);
const onSortButtonClick = (isOpen) => {
- if (isMobileOnly) {
+ if (currentDeviceType === DeviceType.mobile) {
setMainButtonMobileVisible(isOpen);
}
};
@@ -2032,6 +2041,7 @@ const SectionFilterContent = ({
clearSearch={clearSearch}
setClearSearch={setClearSearch}
onSortButtonClick={onSortButtonClick}
+ currentDeviceType={currentDeviceType}
/>
);
};
@@ -2069,7 +2079,7 @@ export default inject(
const { fetchTags } = tagsStore;
const { user } = auth.userStore;
- const { personal, standalone } = auth.settingsStore;
+ const { personal, standalone, currentDeviceType } = auth.settingsStore;
const {
isFavoritesFolder,
isRecentFolder,
@@ -2144,6 +2154,7 @@ export default inject(
publicRoomKey,
setRoomsFilter,
standalone,
+ currentDeviceType,
};
}
)(
diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js
index 20b4bfcc0c..8f3a622c8d 100644
--- a/packages/client/src/pages/Home/Section/Header/index.js
+++ b/packages/client/src/pages/Home/Section/Header/index.js
@@ -31,7 +31,7 @@ import PublicRoomIconUrl from "PUBLIC_DIR/images/public-room.react.svg?url";
import React from "react";
import { inject, observer } from "mobx-react";
import { withTranslation } from "react-i18next";
-import { isMobile, isTablet, isMobileOnly } from "react-device-detect";
+import { isMobile, isTablet } from "react-device-detect";
import styled, { css } from "styled-components";
import copy from "copy-to-clipboard";
import { useNavigate, useLocation } from "react-router-dom";
@@ -46,7 +46,12 @@ import { tablet, mobile } from "@docspace/components/utils/device";
import { Consumer } from "@docspace/components/utils/context";
import toastr from "@docspace/components/toast/toastr";
import TableGroupMenu from "@docspace/components/table-container/TableGroupMenu";
-import { Events, EmployeeType, RoomsType } from "@docspace/common/constants";
+import {
+ Events,
+ EmployeeType,
+ RoomsType,
+ DeviceType,
+} from "@docspace/common/constants";
import { CategoryType } from "SRC_DIR/helpers/constants";
import {
@@ -74,7 +79,7 @@ const StyledContainer = styled.div`
height: 68px;
@media ${tablet} {
- height: 60px;
+ height: 61px;
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
@@ -86,22 +91,8 @@ const StyledContainer = styled.div`
width: calc(100% + 32px);
}
- ${isMobile &&
- css`
- height: 60px;
- ${(props) =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- margin: 0 -16px 0 0;
- `
- : css`
- margin: 0 0 0 -16px;
- `}
- width: calc(100% + 32px);
- `}
-
@media ${mobile} {
- height: 52px;
+ height: 52px !important;
${(props) =>
props.theme.interfaceDirection === "rtl"
@@ -113,20 +104,6 @@ const StyledContainer = styled.div`
`}
width: calc(100% + 32px);
}
-
- ${isMobileOnly &&
- css`
- height: 52px;
- ${(props) =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- margin: 0 -16px 0 0;
- `
- : css`
- margin: 0 0 0 -16px;
- `}
- width: calc(100% + 32px);
- `}
}
.header-container {
@@ -138,7 +115,11 @@ const StyledContainer = styled.div`
display: none;}`}
@media ${tablet} {
- height: 60px;
+ height: 61px;
+ }
+
+ @media ${mobile} {
+ height: 53px;
}
}
`;
@@ -237,6 +218,8 @@ const SectionHeaderContent = (props) => {
isPublicRoomType,
externalLinks,
moveToPublicRoom,
+ currentDeviceType,
+ isFrame,
} = props;
const navigate = useNavigate();
@@ -947,7 +930,7 @@ const SectionHeaderContent = (props) => {
headerMenu,
isInfoPanelVisible,
toggleInfoPanel: onToggleInfoPanel,
- isMobileView: isMobileOnly,
+ isMobileView: currentDeviceType === DeviceType.mobile,
};
if (isAccountsPage) {
@@ -1030,7 +1013,6 @@ const SectionHeaderContent = (props) => {
onClose={onClose}
onClickFolder={onClickFolder}
isTrashFolder={isRecycleBinFolder}
- isRecycleBinFolder={isRecycleBinFolder || isArchiveFolder}
isEmptyFilesList={
isArchiveFolder ? isEmptyArchive : isEmptyFilesList
}
@@ -1059,6 +1041,8 @@ const SectionHeaderContent = (props) => {
isPublicRoomType && !isPublicRoom && PublicRoomIconUrl
}
showRootFolderTitle={insideTheRoom}
+ currentDeviceType={currentDeviceType}
+ isFrame={isFrame}
/>
)}
@@ -1168,8 +1152,13 @@ export default inject(
const selectedFolder = { ...selectedFolderStore };
- const { enablePlugins, theme, whiteLabelLogoUrls, isFrame } =
- auth.settingsStore;
+ const {
+ enablePlugins,
+ theme,
+ whiteLabelLogoUrls,
+ isFrame,
+ currentDeviceType,
+ } = auth.settingsStore;
const { isGracePeriod } = auth.currentTariffStatusStore;
const isRoom = !!roomType;
@@ -1328,6 +1317,7 @@ export default inject(
whiteLabelLogoUrls,
setRoomSharingPanelVisible,
isFrame,
+ currentDeviceType,
};
}
)(
diff --git a/packages/client/src/pages/Home/Section/SettingsBody/StyledSettings.js b/packages/client/src/pages/Home/Section/SettingsBody/StyledSettings.js
index 3975286456..6c7db6475c 100644
--- a/packages/client/src/pages/Home/Section/SettingsBody/StyledSettings.js
+++ b/packages/client/src/pages/Home/Section/SettingsBody/StyledSettings.js
@@ -1,6 +1,5 @@
import styled, { css } from "styled-components";
import { tablet } from "@docspace/components/utils/device";
-import { isMobile } from "react-device-detect";
const StyledSettings = styled.div`
margin-top: ${(props) =>
@@ -21,11 +20,6 @@ const StyledSettings = styled.div`
`}
}
- ${isMobile &&
- css`
- margin-top: 8px;
- `}
-
width: 100%;
display: grid;
diff --git a/packages/client/src/pages/Home/Section/SettingsBody/index.js b/packages/client/src/pages/Home/Section/SettingsBody/index.js
index 018d59819e..7e36abb0a5 100644
--- a/packages/client/src/pages/Home/Section/SettingsBody/index.js
+++ b/packages/client/src/pages/Home/Section/SettingsBody/index.js
@@ -10,7 +10,6 @@ import Submenu from "@docspace/components/submenu";
import PersonalSettings from "./CommonSettings";
import GeneralSettings from "./AdminSettings";
import { tablet } from "@docspace/components/utils/device";
-import { isMobile } from "react-device-detect";
const StyledContainer = styled.div`
margin-top: -22px;
@@ -18,11 +17,6 @@ const StyledContainer = styled.div`
@media ${tablet} {
margin-top: 0px;
}
-
- ${isMobile &&
- css`
- margin-top: 0px;
- `}
`;
const SectionBodyContent = ({ isErrorSettings, user }) => {
diff --git a/packages/client/src/pages/Home/Section/Warning/index.js b/packages/client/src/pages/Home/Section/Warning/index.js
new file mode 100644
index 0000000000..bba7167c15
--- /dev/null
+++ b/packages/client/src/pages/Home/Section/Warning/index.js
@@ -0,0 +1,12 @@
+import React from "react";
+import { useTranslation } from "react-i18next";
+
+import TrashWarning from "@docspace/common/components/Navigation/sub-components/trash-warning";
+
+const Warning = () => {
+ const { t } = useTranslation("Files");
+
+ return ;
+};
+
+export default Warning;
diff --git a/packages/client/src/pages/Home/Section/index.js b/packages/client/src/pages/Home/Section/index.js
index c92018135e..57eeb8c911 100644
--- a/packages/client/src/pages/Home/Section/index.js
+++ b/packages/client/src/pages/Home/Section/index.js
@@ -4,3 +4,4 @@ export { default as AccountsSectionBodyContent } from "./AccountsBody";
export { default as SettingsSectionBodyContent } from "./SettingsBody";
export { default as SectionFilterContent } from "./Filter";
export { default as SectionPagingContent } from "./Paging";
+export { default as SectionWarningContent } from "./Warning";
diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js
index 30dc3485a0..9e4fdb7415 100644
--- a/packages/client/src/pages/Home/index.js
+++ b/packages/client/src/pages/Home/index.js
@@ -14,6 +14,7 @@ import {
SectionFilterContent,
SectionHeaderContent,
SectionPagingContent,
+ SectionWarningContent,
} from "./Section";
import AccountsDialogs from "./Section/AccountsBody/Dialogs";
@@ -295,6 +296,12 @@ const PureHome = (props) => {
)}
+ {isRecycleBinFolder && !isEmptyPage && (
+
+
+
+ )}
+
{(((!isEmptyPage || showFilterLoader) && !isErrorRoomNotAvailable) ||
isAccountsPage) &&
!isSettingsPage && (
@@ -352,6 +359,7 @@ export default inject(
const {
firstLoad,
+ setIsSectionHeaderLoading,
setIsSectionBodyLoading,
setIsSectionFilterLoading,
isLoading,
@@ -359,9 +367,10 @@ export default inject(
showFilterLoader,
} = clientLoadingStore;
- const setIsLoading = (param) => {
- setIsSectionFilterLoading(param);
- setIsSectionBodyLoading(param);
+ const setIsLoading = (param, withoutTimer, withHeaderLoader) => {
+ if (withHeaderLoader) setIsSectionHeaderLoading(param, !withoutTimer);
+ setIsSectionFilterLoading(param, !withoutTimer);
+ setIsSectionBodyLoading(param, !withoutTimer);
};
const {
diff --git a/packages/client/src/pages/PortalSettings/Layout/Article/Body/index.js b/packages/client/src/pages/PortalSettings/Layout/Article/Body/index.js
index 454c7889c3..3df924838d 100644
--- a/packages/client/src/pages/PortalSettings/Layout/Article/Body/index.js
+++ b/packages/client/src/pages/PortalSettings/Layout/Article/Body/index.js
@@ -6,10 +6,9 @@ import { withTranslation } from "react-i18next";
import { isArrayEqual } from "@docspace/components/utils/array";
-import { isMobileOnly } from "react-device-detect";
-
import { isMobile } from "@docspace/components/utils/device";
import withLoading from "SRC_DIR/HOCs/withLoading";
+import { DeviceType } from "@docspace/common/constants";
import {
//getKeyByLink,
@@ -115,6 +114,8 @@ const ArticleBodyContent = (props) => {
standalone,
isEnterprise,
isCommunity,
+ currentDeviceType,
+ isProfileLoading,
} = props;
const [selectedKeys, setSelectedKeys] = React.useState([]);
@@ -160,7 +161,7 @@ const ArticleBodyContent = (props) => {
}, []);
React.useEffect(() => {
- if (tReady) setIsLoadedArticleBody(true);
+ if (tReady && !isProfileLoading) setIsLoadedArticleBody(true);
if (prevLocation.current.pathname !== location.pathname) {
if (location.pathname.includes("common")) {
@@ -198,7 +199,13 @@ const ArticleBodyContent = (props) => {
this.setState({ selectedKeys: ["8-0"] });
}
}
- }, [tReady, setIsLoadedArticleBody, location.pathname, selectedKeys]);
+ }, [
+ tReady,
+ isProfileLoading,
+ setIsLoadedArticleBody,
+ location.pathname,
+ selectedKeys,
+ ]);
const onSelect = (value) => {
if (isArrayEqual([value], selectedKeys)) {
@@ -207,7 +214,7 @@ const ArticleBodyContent = (props) => {
setSelectedKeys([value + "-0"]);
- if (isMobileOnly || isMobile()) {
+ if (currentDeviceType === DeviceType.mobile) {
toggleArticleOpen();
}
@@ -333,10 +340,14 @@ const ArticleBodyContent = (props) => {
const items = catalogItems();
- return !isLoadedArticleBody ? : <>{items}>;
+ return !isLoadedArticleBody || isProfileLoading ? (
+
+ ) : (
+ <>{items}>
+ );
};
-export default inject(({ auth, common }) => {
+export default inject(({ auth, common, clientLoadingStore }) => {
const { isLoadedArticleBody, setIsLoadedArticleBody } = common;
const {
currentTariffStatusStore,
@@ -348,7 +359,13 @@ export default inject(({ auth, common }) => {
const { isNotPaidPeriod } = currentTariffStatusStore;
const { user } = userStore;
const { isOwner } = user;
- const { standalone, showText, toggleArticleOpen } = settingsStore;
+ const { standalone, showText, toggleArticleOpen, currentDeviceType } =
+ settingsStore;
+
+ const isProfileLoading =
+ window.location.pathname.includes("profile") &&
+ clientLoadingStore.showProfileLoader &&
+ !isLoadedArticleBody;
return {
standalone,
@@ -360,6 +377,8 @@ export default inject(({ auth, common }) => {
isNotPaidPeriod,
isOwner,
isCommunity,
+ currentDeviceType,
+ isProfileLoading,
};
})(
withLoading(
diff --git a/packages/client/src/pages/PortalSettings/Layout/Article/Body/loaderArticleBody.js b/packages/client/src/pages/PortalSettings/Layout/Article/Body/loaderArticleBody.js
index 2a2a53e2e1..a1461cc5c7 100644
--- a/packages/client/src/pages/PortalSettings/Layout/Article/Body/loaderArticleBody.js
+++ b/packages/client/src/pages/PortalSettings/Layout/Article/Body/loaderArticleBody.js
@@ -1,19 +1,10 @@
import React, { useEffect, useState } from "react";
import styled, { css } from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { isTablet as isTabletUtils } from "@docspace/components/utils/device";
-import { isTablet } from "react-device-detect";
+
+import { isDesktop, desktop } from "@docspace/components/utils/device";
const StyledLoader = styled.div`
- ${props =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- padding-right: 8px;
- `
- : css`
- padding-left: 8px;
- `}
-
.loader {
padding-bottom: 12px;
}
@@ -32,15 +23,7 @@ const StyledLoader = styled.div`
margin: 0px;
}
- @media (min-width: 1024px) {
- ${props =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- padding-right: 10px;
- `
- : css`
- padding-left: 10px;
- `}
+ @media ${desktop} {
padding-top: 7px;
display: flex;
flex-direction: column;
@@ -59,7 +42,7 @@ const LoaderArticleBody = () => {
const [isTabletView, setIsTabletView] = useState(false);
const checkInnerWidth = () => {
- const isTabletView = window.innerWidth <= 1024 || isTablet;
+ const isTabletView = !isDesktop();
if (isTabletView) {
setIsTabletView(true);
@@ -76,21 +59,10 @@ const LoaderArticleBody = () => {
});
const height = isTabletView ? "28px" : "20px";
- const width = isTabletView ? "28px" : "187px";
+ const width = isTabletView ? "28px" : "210px";
return (
- {isTabletView ? (
-
- ) : (
-
- )}
diff --git a/packages/client/src/pages/PortalSettings/Layout/Section/Header/index.js b/packages/client/src/pages/PortalSettings/Layout/Section/Header/index.js
index 891e361b2d..877ce5de0b 100644
--- a/packages/client/src/pages/PortalSettings/Layout/Section/Header/index.js
+++ b/packages/client/src/pages/PortalSettings/Layout/Section/Header/index.js
@@ -11,7 +11,7 @@ import IconButton from "@docspace/components/icon-button";
import TableGroupMenu from "@docspace/components/table-container/TableGroupMenu";
import DropDownItem from "@docspace/components/drop-down-item";
import LoaderSectionHeader from "../loaderSectionHeader";
-import { tablet } from "@docspace/components/utils/device";
+import { tablet, desktop } from "@docspace/components/utils/device";
import withLoading from "SRC_DIR/HOCs/withLoading";
import Badge from "@docspace/components/badge";
import {
@@ -21,7 +21,6 @@ import {
checkPropertyByLink,
} from "../../../utils";
import { combineUrl } from "@docspace/common/utils";
-import { isMobile, isTablet, isMobileOnly } from "react-device-detect";
const HeaderContainer = styled.div`
position: relative;
@@ -30,7 +29,7 @@ const HeaderContainer = styled.div`
max-width: calc(100vw - 32px);
.settings-section_header {
display: flex;
- align-items: baseline;
+ align-items: center;
.settings-section_badge {
${(props) =>
props.theme.interfaceDirection === "rtl"
@@ -93,22 +92,14 @@ const HeaderContainer = styled.div`
}
}
- ${isTablet &&
- css`
- h1 {
- line-height: 61px;
- font-size: 21px;
- }
- `};
-
- @media (min-width: 600px) and (max-width: 1024px) {
+ @media ${tablet} {
h1 {
line-height: 61px;
font-size: 21px;
}
}
- @media (min-width: 1024px) {
+ @media ${desktop} {
h1 {
font-size: 18px;
line-height: 59px !important;
@@ -133,18 +124,6 @@ const StyledContainer = styled.div`
margin: 0 -16px;
width: calc(100% + 32px);
}
-
- ${isMobile &&
- css`
- margin: 0 -16px;
- width: calc(100% + 32px);
- `}
-
- ${isMobileOnly &&
- css`
- margin: 0 -16px;
- width: calc(100% + 32px);
- `}
}
`;
@@ -172,6 +151,12 @@ const SectionHeaderContent = (props) => {
return isBrandingAndCustomizationAvailable;
case "RestoreBackup":
return isRestoreAndAutoBackupAvailable;
+ case "WhiteLabel":
+ return isBrandingAndCustomizationAvailable;
+ case "CompanyInfoSettings":
+ return isBrandingAndCustomizationAvailable;
+ case "AdditionalResources":
+ return isBrandingAndCustomizationAvailable;
default:
return true;
}
diff --git a/packages/client/src/pages/PortalSettings/Layout/Section/loaderSectionHeader.js b/packages/client/src/pages/PortalSettings/Layout/Section/loaderSectionHeader.js
index 6b656dfc20..ac44e8c2f9 100644
--- a/packages/client/src/pages/PortalSettings/Layout/Section/loaderSectionHeader.js
+++ b/packages/client/src/pages/PortalSettings/Layout/Section/loaderSectionHeader.js
@@ -1,14 +1,14 @@
import React, { useEffect, useState } from "react";
import styled, { css } from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { isTablet, isMobileOnly } from "react-device-detect";
+import { isTablet, isDesktop } from "@docspace/components/utils/device";
const StyledLoader = styled.div`
display: flex;
align-items: center;
.arrow {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-left: 12px;
@@ -18,7 +18,7 @@ const StyledLoader = styled.div`
`}
}
- padding: ${props =>
+ padding: ${(props) =>
props.isTabletView
? "16px 0 17px"
: props.isDesktopView
@@ -36,12 +36,9 @@ const LoaderSectionHeader = () => {
const levelSettings = location.pathname.split("/").length - 1;
const checkInnerWidth = () => {
- const isTabletView =
- (window.innerWidth >= 600 && window.innerWidth <= 1024) ||
- (isTablet && !isMobileOnly);
-
- const isDesktopView = window.innerWidth > 1024;
+ const isTabletView = isTablet();
+ const isDesktopView = isDesktop();
if (isTabletView) {
setIsTabletView(true);
} else {
diff --git a/packages/client/src/pages/PortalSettings/Layout/index.js b/packages/client/src/pages/PortalSettings/Layout/index.js
index 01ac71d6cb..def7dd9c8a 100644
--- a/packages/client/src/pages/PortalSettings/Layout/index.js
+++ b/packages/client/src/pages/PortalSettings/Layout/index.js
@@ -11,9 +11,9 @@ import { useParams } from "react-router-dom";
import HistoryHeader from "../categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryHeader";
import DetailsNavigationHeader from "../categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsNavigationHeader";
-const ArticleSettings = React.memo(() => {
+const ArticleSettings = React.memo(({ showArticleLoader }) => {
return (
-
+
@@ -35,7 +35,17 @@ const Layout = ({
enablePlugins,
isInitPlugins,
initPlugins,
+ setBodyRendered,
+ isLoadedArticleBody,
}) => {
+ useEffect(() => {
+ setBodyRendered(true);
+
+ return () => {
+ setBodyRendered(false);
+ };
+ }, []);
+
useEffect(() => {
currentProductId !== "settings" && setCurrentProductId("settings");
}, [language, currentProductId, setCurrentProductId]);
@@ -52,9 +62,13 @@ const Layout = ({
return (
<>
-
+
{!isGeneralPage && (
-
+
{currentPath === webhookHistoryPath ? (
@@ -81,7 +95,12 @@ export default inject(({ auth, setup, pluginStore }) => {
const { language, settingsStore } = auth;
const { addUsers } = setup.headerAction;
- const { setCurrentProductId, enablePlugins } = settingsStore;
+ const {
+ setCurrentProductId,
+ enablePlugins,
+ setBodyRendered,
+ isLoadedArticleBody,
+ } = settingsStore;
const { isInit: isInitPlugins, initPlugins } = pluginStore;
@@ -93,5 +112,7 @@ export default inject(({ auth, setup, pluginStore }) => {
enablePlugins,
isInitPlugins,
initPlugins,
+ setBodyRendered,
+ isLoadedArticleBody,
};
})(withLoading(observer(Layout)));
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledApperance.js b/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledApperance.js
index 717f84f733..5f44918164 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledApperance.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledApperance.js
@@ -1,4 +1,4 @@
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
import PlusThemeSvgUrl from "PUBLIC_DIR/images/plus.theme.svg?url";
import styled, { css } from "styled-components";
@@ -80,7 +80,7 @@ const StyledComponent = styled.div`
margin-right: 8px;
`}
}
- @media ${smallTablet} {
+ @media ${mobile} {
.button {
width: 100%;
}
@@ -89,7 +89,7 @@ const StyledComponent = styled.div`
${({ isShowDeleteButton }) =>
isShowDeleteButton &&
css`
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
gap: 8px;
margin: 0;
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledPreview.js b/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledPreview.js
index aaf2999df9..7deb572e87 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledPreview.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Appearance/StyledPreview.js
@@ -101,12 +101,10 @@ const StyledComponent = styled.div`
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
- margin-right: 12px;
border-radius: 16px 0px 0px 16px;
border-right-style: none;
`
: css`
- margin-left: 12px;
border-radius: 0px 16px 16px 0px;
border-left-style: none;
`}
@@ -444,7 +442,7 @@ const StyledMobilePreview = styled.div`
themePreview === "Light" ? "#FFFFFF" : "#333333"};
border: ${({ themePreview }) =>
- themePreview === "Light" ? "1px solid #d0d5da" : "1px solid transparent"};
+ themePreview === "Light" ? "1px solid #d0d5da" : "1px solid #474747"};
.section-search {
height: 30px;
@@ -452,7 +450,7 @@ const StyledMobilePreview = styled.div`
align-items: center;
border: 1px solid;
border-radius: 3px;
- padding-left: 8px;
+ padding-inline-start: 8px;
}
.main-button-preview {
@@ -541,7 +539,7 @@ const StyledMobilePreview = styled.div`
.tablet-tile-name {
width: 44% !important;
- margin-left: 16px;
+ margin-inline-start: 16px;
border-right: none !important;
border-radius: 12px 0 16px 0 !important;
}
@@ -567,7 +565,8 @@ const StyledMobilePreview = styled.div`
display: flex;
border-top-width: 1px;
border-top-style: solid;
- padding: 16px 0px 16px 16px;
+ padding-block: 16px;
+ padding-inline: 16px 0;
}
.tile-container {
@@ -576,7 +575,7 @@ const StyledMobilePreview = styled.div`
}
.pin {
- padding-right: 14px;
+ padding-inline-end: 14px;
path {
fill: ${(props) =>
@@ -623,17 +622,17 @@ const StyledMobilePreview = styled.div`
: colorPreview} !important;
}
.section-badge {
- padding-right: 12px;
+ padding-inline-end: 12px;
}
.tile-icon {
- padding-right: 12px;
+ padding-inline-end: 12px;
}
.floating-button {
position: relative;
- margin-left: auto;
- right: 0px;
+ margin-inline-start: auto;
+ inset-inline-end: 0;
bottom: 48px;
}
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Appearance/preview.js b/packages/client/src/pages/PortalSettings/categories/common/Appearance/preview.js
index af298ae2e4..0c571853cf 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Appearance/preview.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Appearance/preview.js
@@ -1,8 +1,8 @@
import PlusPreviewSvgUrl from "PUBLIC_DIR/images/plus.preview.svg?url";
-import React, { useState, useEffect } from "react";
+import React, { useState, useEffect, useLayoutEffect } from "react";
import Loaders from "@docspace/common/components/Loaders";
import ContextMenuButton from "@docspace/components/context-menu-button";
-import { isTablet } from "react-device-detect";
+
import {
StyledComponent,
StyledFloatingButton,
@@ -12,7 +12,8 @@ import {
import ButtonPlusIcon from "PUBLIC_DIR/images/actions.button.plus.react.svg";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
-import { isMobileOnly, isDesktop } from "react-device-detect";
+
+import { isMobile, isTablet } from "@docspace/components/utils/device";
const Preview = (props) => {
const {
@@ -30,11 +31,10 @@ const Preview = (props) => {
const [isSmallWindow, setIsSmallWindow] = useState(false);
const onCheckView = () => {
- const tablet =
- isTablet || (window.innerWidth > 600 && window.innerWidth <= 1024);
+ const tablet = isTablet();
setIsViewTablet(tablet);
- if (isDesktop && window.innerWidth < 600) {
+ if (isMobile()) {
setIsSmallWindow(true);
} else {
setIsSmallWindow(false);
@@ -60,7 +60,7 @@ const Preview = (props) => {
saveToSessionStorage("selectColorAccent", colorPreview);
}, [colorPreview]);
- useEffect(() => {
+ useLayoutEffect(() => {
onCheckView();
window.addEventListener("resize", onCheckView);
@@ -69,7 +69,7 @@ const Preview = (props) => {
};
});
- return isSmallWindow || isMobileOnly ? (
+ return isSmallWindow || isMobile() ? (
{
+const MobileView = ({ isSettingPaid }) => {
const { t } = useTranslation(["Settings"]);
const navigate = useNavigate();
@@ -24,18 +24,24 @@ const MobileView = () => {
title={t("WhiteLabel")}
subtitle={t("BrandingSubtitle")}
url="/portal-settings/customization/branding/white-label"
+ withPaidBadge={!isSettingPaid}
+ badgeLabel={t("Common:Paid")}
onClickLink={onClickLink}
/>
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/StyledWhitelabel.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/StyledWhitelabel.js
index 6772669901..84f761e6e8 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/StyledWhitelabel.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/StyledWhitelabel.js
@@ -1,6 +1,6 @@
import styled from "styled-components";
import { Base } from "@docspace/components/themes";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const WhiteLabelWrapper = styled.div`
.subtitle {
@@ -61,7 +61,7 @@ const WhiteLabelWrapper = styled.div`
flex-direction: row;
gap: 20px;
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
}
}
@@ -78,7 +78,7 @@ const WhiteLabelWrapper = styled.div`
gap: 8px;
margin-bottom: 8px;
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
}
}
@@ -113,7 +113,7 @@ const WhiteLabelWrapper = styled.div`
height: 42px;
padding: 12px 20px;
- @media ${smallTablet} {
+ @media ${mobile} {
width: 310px;
height: 35px;
}
@@ -182,7 +182,7 @@ const WhiteLabelWrapper = styled.div`
margin-top: 24px;
}
- @media ${smallTablet} {
+ @media ${mobile} {
.subtitle,
.header-container {
display: none;
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
index c6359db606..43a834c233 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
@@ -11,12 +11,12 @@ import toastr from "@docspace/components/toast/toastr";
import LoaderAdditionalResources from "../sub-components/loaderAdditionalResources";
import isEqual from "lodash/isEqual";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
-import { smallTablet, size } from "@docspace/components/utils/device";
+import { mobile, size } from "@docspace/components/utils/device";
const StyledComponent = styled.div`
margin-top: 40px;
- @media ${smallTablet} {
+ @media ${mobile} {
margin-top: 0px;
.header {
@@ -44,8 +44,6 @@ const StyledComponent = styled.div`
}
.checkbox {
- width: max-content;
-
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
@@ -110,7 +108,7 @@ const AdditionalResources = (props) => {
}, []);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("additional-resources") &&
navigate("/portal-settings/customization/branding");
};
@@ -272,7 +270,7 @@ const AdditionalResources = (props) => {
onSaveClick={onSave}
onCancelClick={onRestore}
saveButtonLabel={t("Common:SaveButton")}
- cancelButtonLabel={t("Settings:RestoreDefaultButton")}
+ cancelButtonLabel={t("Common:Restore")}
displaySettings={true}
reminderTest={t("YouHaveUnsavedChanges")}
showReminder={(isSettingPaid && hasChange) || isLoading}
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/companyInfoSettings.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/companyInfoSettings.js
index 529c87a5d7..073116b060 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/companyInfoSettings.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/companyInfoSettings.js
@@ -14,7 +14,7 @@ import Link from "@docspace/components/link";
import LoaderCompanyInfoSettings from "../sub-components/loaderCompanyInfoSettings";
import AboutDialog from "../../../../About/AboutDialog";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
-import { smallTablet, size } from "@docspace/components/utils/device";
+import { mobile, size } from "@docspace/components/utils/device";
const StyledComponent = styled.div`
.link {
@@ -40,7 +40,7 @@ const StyledComponent = styled.div`
padding-bottom: 16px;
}
- @media ${smallTablet} {
+ @media ${mobile} {
.header {
display: none;
}
@@ -99,7 +99,7 @@ const CompanyInfoSettings = (props) => {
}, []);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("company-info-settings") &&
navigate("/portal-settings/customization/branding");
};
@@ -440,7 +440,7 @@ const CompanyInfoSettings = (props) => {
onSaveClick={onSave}
onCancelClick={onRestore}
saveButtonLabel={t("Common:SaveButton")}
- cancelButtonLabel={t("Settings:RestoreDefaultButton")}
+ cancelButtonLabel={t("Common:Restore")}
reminderTest={t("YouHaveUnsavedChanges")}
displaySettings={true}
showReminder={(isSettingPaid && showReminder) || isLoading}
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/sub-components/logo.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/sub-components/logo.js
index d362f52da7..afb62d474d 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/sub-components/logo.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/sub-components/logo.js
@@ -1,9 +1,10 @@
import React from "react";
-import { isMobileOnly } from "react-device-detect";
+
import { getLogoFromPath } from "@docspace/common/utils";
import Text from "@docspace/components/text";
import Link from "@docspace/components/link";
+import { isMobile } from "@docspace/components/utils/device";
const Logo = (props) => {
const {
@@ -21,7 +22,7 @@ const Logo = (props) => {
const currentLogo = getLogoFromPath(src);
const onLogoClick = () => {
- isMobileOnly && document.getElementById(inputId).click();
+ isMobile() && document.getElementById(inputId).click();
};
return (
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
index 4c6094e11e..47d5850f3e 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
@@ -65,7 +65,7 @@ const WhiteLabel = (props) => {
}, []);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("white-label") &&
navigate("/portal-settings/customization/branding");
};
@@ -488,8 +488,9 @@ const WhiteLabel = (props) => {
onSaveClick={onSave}
onCancelClick={onRestoreDefault}
saveButtonLabel={t("Common:SaveButton")}
- cancelButtonLabel={t("RestoreDefaultButton")}
+ cancelButtonLabel={t("Common:Restore")}
displaySettings={true}
+ hasScroll={true}
showReminder={isSettingPaid}
saveButtonDisabled={isEqualLogo && isEqualText}
isSaving={isSaving}
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Customization/StyledSettings.js b/packages/client/src/pages/PortalSettings/categories/common/Customization/StyledSettings.js
index ecff1c20b7..6545a4c40c 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Customization/StyledSettings.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Customization/StyledSettings.js
@@ -5,7 +5,7 @@ import ArrowRightIcon from "PUBLIC_DIR/images/arrow.right.react.svg";
import commonIconsStyles from "@docspace/components/utils/common-icons-style";
import { Base } from "@docspace/components/themes";
import { UnavailableStyles } from "../../../utils/commonSettingsStyles";
-import { mobile } from "@docspace/components/utils/device";
+import { mobile, desktop, mobileMore } from "@docspace/components/utils/device";
const menuHeight = "48px";
const sectionHeight = "50px";
@@ -16,7 +16,7 @@ const flex = "4px";
const StyledArrowRightIcon = styled(ArrowRightIcon)`
${commonIconsStyles}
path {
- fill: ${props => props.theme.client.settings.common.arrowColor};
+ fill: ${(props) => props.theme.client.settings.common.arrowColor};
}
`;
@@ -35,7 +35,7 @@ const StyledScrollbar = styled(Scrollbar)`
const StyledSettingsComponent = styled.div`
.dns-setting_helpbutton {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 4px;
@@ -51,9 +51,9 @@ const StyledSettingsComponent = styled.div`
.dns-textarea {
textarea {
- color: ${props => props.theme.text.disableColor};
+ color: ${(props) => props.theme.text.disableColor};
}
- ${props => props.standalone && "margin-top: 14px"};
+ ${(props) => props.standalone && "margin-top: 14px"};
}
.combo-button-label {
@@ -74,15 +74,12 @@ const StyledSettingsComponent = styled.div`
.settings-block-description {
line-height: 20px;
- color: ${props => props.theme.client.settings.security.descriptionColor};
+ color: ${(props) => props.theme.client.settings.security.descriptionColor};
padding-bottom: 12px;
}
- .send-request-button {
- height: 40px;
- }
-
.combo-box-settings {
+ padding: 0px;
.combo-button {
justify-content: space-between !important;
}
@@ -114,12 +111,12 @@ const StyledSettingsComponent = styled.div`
}
}
- @media (max-width: 599px) {
- ${props =>
+ @media ${mobile} {
+ ${(props) =>
props.hasScroll &&
css`
width: ${isMobileOnly ? "100vw" : "calc(100vw - 52px)"};
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
right: -16px;
@@ -132,7 +129,7 @@ const StyledSettingsComponent = styled.div`
.settings-block {
width: ${isMobileOnly ? "calc(100vw - 32px)" : "calc(100vw - 84px)"};
max-width: none;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-right: 16px;
@@ -147,7 +144,7 @@ const StyledSettingsComponent = styled.div`
box-sizing: border-box;
position: absolute;
bottom: 0;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
right: 0;
@@ -164,7 +161,7 @@ const StyledSettingsComponent = styled.div`
}
}
- @media (min-width: 600px) {
+ @media ${mobileMore} {
.settings-block {
max-width: 350px;
height: auto;
@@ -176,13 +173,7 @@ const StyledSettingsComponent = styled.div`
}
}
- @media (min-width: 1024px) {
- .send-request-button {
- height: 32px;
- }
- }
-
- @media (orientation: landscape) and (max-width: 600px) {
+ @media (orientation: landscape) and ${mobile} {
${isMobileOnly &&
css`
.settings-block {
@@ -190,7 +181,7 @@ const StyledSettingsComponent = styled.div`
}
`}
}
- ${props => !props.isSettingPaid && UnavailableStyles}
+ ${(props) => !props.isSettingPaid && UnavailableStyles}
`;
export { StyledSettingsComponent, StyledScrollbar, StyledArrowRightIcon };
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Customization/dns-settings.js b/packages/client/src/pages/PortalSettings/categories/common/Customization/dns-settings.js
index fbedd655f0..ae66d228de 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Customization/dns-settings.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Customization/dns-settings.js
@@ -8,8 +8,7 @@ import Button from "@docspace/components/button";
import { inject, observer } from "mobx-react";
import { useNavigate } from "react-router-dom";
-import { isMobileOnly } from "react-device-detect";
-import { isSmallTablet } from "@docspace/components/utils/device";
+import { isMobile } from "@docspace/components/utils/device";
import checkScrollSettingsBlock from "../utils";
import { StyledSettingsComponent, StyledScrollbar } from "./StyledSettings";
import { setDocumentTitle } from "SRC_DIR/helpers/utils";
@@ -20,6 +19,7 @@ import toastr from "@docspace/components/toast/toastr";
import ToggleButton from "@docspace/components/toggle-button";
import Text from "@docspace/components/text";
import Link from "@docspace/components/link";
+import { DeviceType } from "@docspace/common/constants";
const toggleStyle = {
position: "static",
@@ -36,7 +36,6 @@ const buttonProps = {
tabIndex: 9,
className: "save-cancel-buttons send-request-button",
primary: true,
- size: "small",
};
let timerId = null;
const DNSSettings = (props) => {
@@ -60,6 +59,7 @@ const DNSSettings = (props) => {
enable,
isDefaultDNS,
dnsSettingsUrl,
+ currentDeviceType,
} = props;
const [hasScroll, setHasScroll] = useState(false);
const isLoadedSetting = isLoaded && tReady;
@@ -128,7 +128,7 @@ const DNSSettings = (props) => {
setDNSName(value);
};
const checkInnerWidth = useCallback(() => {
- if (!isSmallTablet()) {
+ if (!isMobile()) {
setIsCustomizationView(true);
const currentUrl = window.location.href.replace(
@@ -144,7 +144,7 @@ const DNSSettings = (props) => {
} else {
setIsCustomizationView(false);
}
- }, [isSmallTablet, setIsCustomizationView]);
+ }, [isMobile, setIsCustomizationView]);
const settingsBlock = (
@@ -191,6 +191,7 @@ const DNSSettings = (props) => {
const buttonContainer = standalone ? (
{
) : (
{
};
export default inject(({ auth, common }) => {
- const { helpLink, currentColorScheme, standalone, dnsSettingsUrl } =
- auth.settingsStore;
+ const {
+ helpLink,
+ currentColorScheme,
+ standalone,
+ dnsSettingsUrl,
+ currentDeviceType,
+ } = auth.settingsStore;
const {
isLoaded,
setIsLoadedDNSSettings,
@@ -282,5 +289,6 @@ export default inject(({ auth, common }) => {
setIsEnableDNS,
saveDNSSettings,
dnsSettingsUrl,
+ currentDeviceType,
};
})(withLoading(withTranslation(["Settings", "Common"])(observer(DNSSettings))));
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Customization/language-and-time-zone.js b/packages/client/src/pages/PortalSettings/categories/common/Customization/language-and-time-zone.js
index 3253fcf393..4823184f2e 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Customization/language-and-time-zone.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Customization/language-and-time-zone.js
@@ -10,8 +10,7 @@ import { inject, observer } from "mobx-react";
import { LANGUAGE, COOKIE_EXPIRATION_YEAR } from "@docspace/common/constants";
import { setCookie } from "@docspace/common/utils";
import { useNavigate } from "react-router-dom";
-import { isMobileOnly } from "react-device-detect";
-import { isSmallTablet } from "@docspace/components/utils/device";
+import { isMobile } from "@docspace/components/utils/device";
import checkScrollSettingsBlock from "../utils";
import { StyledSettingsComponent, StyledScrollbar } from "./StyledSettings";
import LoaderCustomization from "../sub-components/loaderCustomization";
@@ -207,7 +206,7 @@ const LanguageAndTimeZone = (props) => {
findSelectedItemByKey(timezones, portalTimeZoneId) ||
rawTimezones[0];
- const timezoneDefault =
+ const timezoneDefault = timezoneDefaultFromSessionStorage ||
findSelectedItemByKey(timezones, portalTimeZoneId) || timezones[0];
setState((val) => ({ ...val, timezone, timezoneDefault }));
@@ -373,7 +372,7 @@ const LanguageAndTimeZone = (props) => {
};
const checkInnerWidth = () => {
- if (!isSmallTablet()) {
+ if (!isMobile()) {
setState((val) => ({ ...val, isCustomizationView: true }));
const currentUrl = window.location.href.replace(
@@ -439,7 +438,6 @@ const LanguageAndTimeZone = (props) => {
dropDownMaxHeight={300}
className="dropdown-item-width combo-box-settings"
showDisabledItems={true}
- directionY="both"
/>
{
dropDownMaxHeight={300}
className="dropdown-item-width combo-box-settings"
showDisabledItems={true}
- directionY="both"
/>
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Customization/portal-renaming.js b/packages/client/src/pages/PortalSettings/categories/common/Customization/portal-renaming.js
index 79b349dcd5..9d6497be03 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Customization/portal-renaming.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Customization/portal-renaming.js
@@ -6,8 +6,7 @@ import TextInput from "@docspace/components/text-input";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
import { inject, observer } from "mobx-react";
import { useNavigate } from "react-router-dom";
-import { isMobileOnly } from "react-device-detect";
-import { isSmallTablet } from "@docspace/components/utils/device";
+import { isMobile } from "@docspace/components/utils/device";
import checkScrollSettingsBlock from "../utils";
import { StyledSettingsComponent, StyledScrollbar } from "./StyledSettings";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
@@ -240,7 +239,7 @@ const PortalRenaming = (props) => {
};
const checkInnerWidth = useCallback(() => {
- if (!isSmallTablet()) {
+ if (!isMobile()) {
setIsCustomizationView(true);
const currentUrl = window.location.href.replace(
@@ -255,7 +254,7 @@ const PortalRenaming = (props) => {
} else {
setIsCustomizationView(false);
}
- }, [isSmallTablet, setIsCustomizationView]);
+ }, [isMobile, setIsCustomizationView]);
const onOpenModal = () => {
setIsShowModal(true);
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Customization/welcome-page-settings.js b/packages/client/src/pages/PortalSettings/categories/common/Customization/welcome-page-settings.js
index 888ec86ba5..bb476573c5 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Customization/welcome-page-settings.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Customization/welcome-page-settings.js
@@ -4,17 +4,14 @@ import { withTranslation } from "react-i18next";
import FieldContainer from "@docspace/components/field-container";
import toastr from "@docspace/components/toast/toastr";
import TextInput from "@docspace/components/text-input";
-import HelpButton from "@docspace/components/help-button";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import { setDocumentTitle } from "SRC_DIR/helpers/utils";
import { inject, observer } from "mobx-react";
-import config from "PACKAGE_FILE";
import { useNavigate } from "react-router-dom";
-import { isMobileOnly } from "react-device-detect";
-import { isSmallTablet } from "@docspace/components/utils/device";
+import { isMobile } from "@docspace/components/utils/device";
import checkScrollSettingsBlock from "../utils";
-import { StyledSettingsComponent, StyledScrollbar } from "./StyledSettings";
+import { StyledSettingsComponent } from "./StyledSettings";
import LoaderCustomization from "../sub-components/loaderCustomization";
import withLoading from "SRC_DIR/HOCs/withLoading";
import Text from "@docspace/components/text";
@@ -135,10 +132,6 @@ const WelcomePageSettings = (props) => {
setState((val) => ({ ...val, hasScroll: scrollLngTZSettings }));
}
- if (greetingSettings !== prevProps.greetingSettings) {
- setState((val) => ({ ...val, greetingTitle: greetingSettings }));
- }
-
if (state.greetingTitleDefault || state.greetingTitle) {
checkChanges();
}
@@ -156,7 +149,6 @@ const WelcomePageSettings = (props) => {
isLoaded,
setIsLoadedWelcomePageSettings,
tReady,
- greetingSettings,
getSettings,
getGreetingSettingsIsDefault,
state.hasScroll,
@@ -165,6 +157,19 @@ const WelcomePageSettings = (props) => {
state.isLoadingGreetingRestore,
]);
+ React.useEffect(() => {
+ greetingTitleFromSessionStorage = getFromSessionStorage("greetingTitle");
+ const emptyGreetingTitleFromSessionStorage =
+ greetingTitleFromSessionStorage === null ||
+ greetingTitleFromSessionStorage === "none";
+
+ if (!emptyGreetingTitleFromSessionStorage) return;
+
+ if (greetingSettings !== state.greetingTitle) {
+ setState((val) => ({ ...val, greetingTitle: greetingSettings }));
+ }
+ }, [greetingSettings]);
+
React.useEffect(() => {
prevProps.current = { isLoaded, tReady, greetingSettings };
}, [isLoaded, tReady, greetingSettings]);
@@ -217,8 +222,6 @@ const WelcomePageSettings = (props) => {
.then(() => {
setState((val) => ({
...val,
- greetingTitle: greetingSettings,
- greetingTitleDefault: greetingSettings,
showReminder: false,
}));
@@ -262,7 +265,7 @@ const WelcomePageSettings = (props) => {
};
const checkInnerWidth = () => {
- if (!isSmallTablet()) {
+ if (!isMobile()) {
setState((val) => ({ ...val, isCustomizationView: true }));
const currentUrl = window.location.href.replace(
diff --git a/packages/client/src/pages/PortalSettings/categories/common/appearance.js b/packages/client/src/pages/PortalSettings/categories/common/appearance.js
index 2b79a812e7..a432c8813c 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/appearance.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/appearance.js
@@ -15,7 +15,6 @@ import DropDownItem from "@docspace/components/drop-down-item";
import DropDownContainer from "@docspace/components/drop-down";
import HexColorPickerComponent from "./sub-components/hexColorPicker";
-import { isMobileOnly, isDesktop } from "react-device-detect";
import Loader from "./sub-components/loaderAppearance";
@@ -23,6 +22,8 @@ import { StyledComponent, StyledTheme } from "./Appearance/StyledApperance.js";
import { ReactSVG } from "react-svg";
import ModalDialogDelete from "./sub-components/modalDialogDelete";
import hexToRgba from "hex-to-rgba";
+import { isMobile } from "@docspace/components/utils/device";
+import { DeviceType } from "@docspace/common/constants";
const Appearance = (props) => {
const {
@@ -34,6 +35,7 @@ const Appearance = (props) => {
deleteAppearanceTheme,
tReady,
t,
+ currentDeviceType,
} = props;
const defaultAppliedColorAccent = currentColorScheme.main.accent;
@@ -287,7 +289,7 @@ const Appearance = (props) => {
);
const onCheckView = () => {
- if (isDesktop && window.innerWidth < 600) {
+ if (isMobile()) {
setIsSmallWindow(true);
} else {
setIsSmallWindow(false);
@@ -458,36 +460,40 @@ const Appearance = (props) => {
return textColor;
};
- const onAppliedColorAccent = useCallback(() => {
- if (appliedColorAccent.toUpperCase() !== currentColorAccent) {
- setChangeCurrentColorAccent(true);
- }
+ const onAppliedColorAccent = useCallback(
+ (color) => {
+ if (color.toUpperCase() !== currentColorAccent) {
+ setChangeCurrentColorAccent(true);
+ }
- setCurrentColorAccent(appliedColorAccent);
- saveToSessionStorage("selectColorAccent", appliedColorAccent);
+ setCurrentColorAccent(color);
+ saveToSessionStorage("selectColorAccent", color);
- setOpenHexColorPickerAccent(false);
- }, [
- appliedColorAccent,
- currentColorAccent,
- setChangeCurrentColorAccent,
- setOpenHexColorPickerAccent,
- ]);
+ setOpenHexColorPickerAccent(false);
+ },
+ [
+ currentColorAccent,
+ setChangeCurrentColorAccent,
+ setOpenHexColorPickerAccent,
+ ]
+ );
- const onAppliedColorButtons = useCallback(() => {
- if (appliedColorButtons.toUpperCase() !== currentColorButtons) {
- setChangeCurrentColorButtons(true);
- }
+ const onAppliedColorButtons = useCallback(
+ (color) => {
+ if (color.toUpperCase() !== currentColorButtons) {
+ setChangeCurrentColorButtons(true);
+ }
- setCurrentColorButtons(appliedColorButtons);
+ setCurrentColorButtons(color);
- setOpenHexColorPickerButtons(false);
- }, [
- appliedColorButtons,
- currentColorButtons,
- setChangeCurrentColorButtons,
- setOpenHexColorPickerButtons,
- ]);
+ setOpenHexColorPickerButtons(false);
+ },
+ [
+ currentColorButtons,
+ setChangeCurrentColorButtons,
+ setOpenHexColorPickerButtons,
+ ]
+ );
const onSaveNewThemes = useCallback(
async (theme) => {
@@ -588,8 +594,7 @@ const Appearance = (props) => {
id="buttons-hex"
onCloseHexColorPicker={onCloseHexColorPickerButtons}
onAppliedColor={onAppliedColorButtons}
- color={appliedColorButtons}
- setColor={setAppliedColorButtons}
+ appliedColor={appliedColorButtons}
/>
@@ -609,8 +614,7 @@ const Appearance = (props) => {
id="accent-hex"
onCloseHexColorPicker={onCloseHexColorPickerAccent}
onAppliedColor={onAppliedColorAccent}
- color={appliedColorAccent}
- setColor={setAppliedColorAccent}
+ appliedColor={appliedColorAccent}
/>
@@ -624,6 +628,9 @@ const Appearance = (props) => {
);
};
+ const buttonSize =
+ currentDeviceType === DeviceType.desktop ? "small" : "normal";
+
return !tReady ? (
) : (
@@ -734,7 +741,7 @@ const Appearance = (props) => {
label={t("Common:SaveButton")}
onClick={onSave}
primary
- size="small"
+ size={buttonSize}
isDisabled={isDisabledSaveButton}
/>
@@ -742,7 +749,7 @@ const Appearance = (props) => {
className="edit-current-theme button"
label={t("Common:EditButton")}
onClick={onClickEdit}
- size="small"
+ size={buttonSize}
isDisabled={isDisabledEditButton}
/>
{isShowDeleteButton && (
@@ -750,7 +757,7 @@ const Appearance = (props) => {
className="delete-theme button"
label={t("Settings:DeleteTheme")}
onClick={onOpenDialogDelete}
- size="small"
+ size={buttonSize}
isDisabled={isDisabledDeleteButton}
/>
)}
@@ -770,6 +777,7 @@ export default inject(({ auth }) => {
currentColorScheme,
deleteAppearanceTheme,
theme,
+ currentDeviceType,
} = settingsStore;
return {
@@ -779,6 +787,7 @@ export default inject(({ auth }) => {
getAppearanceTheme,
currentColorScheme,
deleteAppearanceTheme,
+ currentDeviceType,
theme,
};
})(withTranslation(["Profile", "Common", "Settings"])(observer(Appearance)));
diff --git a/packages/client/src/pages/PortalSettings/categories/common/branding.js b/packages/client/src/pages/PortalSettings/categories/common/branding.js
index 28bd9c5fdb..fb5e447089 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/branding.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/branding.js
@@ -75,7 +75,7 @@ const Branding = ({
};
}, []);
- if (isMobileView) return ;
+ if (isMobileView) return ;
return (
diff --git a/packages/client/src/pages/PortalSettings/categories/common/customization.js b/packages/client/src/pages/PortalSettings/categories/common/customization.js
index 7024fbf07c..7045ccd908 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/customization.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/customization.js
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { withTranslation } from "react-i18next";
import styled, { css } from "styled-components";
import { inject, observer } from "mobx-react";
-import withCultureNames from "@docspace/common/hoc/withCultureNames";
+//import withCultureNames from "@docspace/common/hoc/withCultureNames";
import LanguageAndTimeZone from "./Customization/language-and-time-zone";
import WelcomePageSettings from "./Customization/welcome-page-settings";
import PortalRenaming from "./Customization/portal-renaming";
@@ -13,6 +13,7 @@ import { setDocumentTitle } from "SRC_DIR/helpers/utils";
import LoaderDescriptionCustomization from "./sub-components/loaderDescriptionCustomization";
import withLoading from "SRC_DIR/HOCs/withLoading";
import StyledSettingsSeparator from "SRC_DIR/pages/PortalSettings/StyledSettingsSeparator";
+import { mobileMore } from "@docspace/components/utils/device";
const StyledComponent = styled.div`
width: 100%;
@@ -58,7 +59,7 @@ const StyledComponent = styled.div`
margin-bottom: 24px;
}
- @media (min-width: 600px) {
+ @media ${mobileMore} {
.settings-block {
max-width: 350px;
height: auto;
diff --git a/packages/client/src/pages/PortalSettings/categories/common/index.js b/packages/client/src/pages/PortalSettings/categories/common/index.js
index 0d14923843..913cd64df1 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/index.js
@@ -11,6 +11,7 @@ import Appearance from "./appearance";
import withLoading from "SRC_DIR/HOCs/withLoading";
import LoaderSubmenu from "./sub-components/loaderSubmenu";
import { resetSessionStorage } from "../../utils";
+import { DeviceType } from "@docspace/common/constants";
const SubmenuCommon = (props) => {
const {
@@ -21,6 +22,7 @@ const SubmenuCommon = (props) => {
loadBaseInfo,
isLoadedSubmenu,
getWhiteLabelLogoUrls,
+ currentDeviceType,
} = props;
const navigate = useNavigate();
@@ -85,11 +87,18 @@ const SubmenuCommon = (props) => {
data={data}
startSelect={currentTab}
onSelect={(e) => onSelect(e)}
+ topProps={
+ currentDeviceType === DeviceType.desktop
+ ? 0
+ : currentDeviceType === DeviceType.mobile
+ ? "53px"
+ : "61px"
+ }
/>
);
};
-export default inject(({ common }) => {
+export default inject(({ auth, common }) => {
const {
isLoaded,
setIsLoadedSubmenu,
@@ -105,5 +114,6 @@ export default inject(({ common }) => {
setIsLoadedSubmenu,
isLoadedSubmenu,
getWhiteLabelLogoUrls,
+ currentDeviceType: auth.settingsStore.currentDeviceType,
};
})(withLoading(withTranslation("Settings")(observer(SubmenuCommon))));
diff --git a/packages/client/src/pages/PortalSettings/categories/common/sub-components/hexColorPicker.js b/packages/client/src/pages/PortalSettings/categories/common/sub-components/hexColorPicker.js
index 66705642b5..a9c79f9405 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/sub-components/hexColorPicker.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/sub-components/hexColorPicker.js
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import styled, { css } from "styled-components";
import Button from "@docspace/components/button";
@@ -7,7 +7,7 @@ import { isMobileOnly } from "react-device-detect";
const StyledComponent = styled.div`
.save-button {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 10px;
@@ -59,12 +59,12 @@ const StyledComponent = styled.div`
height: 32px;
outline: none;
padding: 6px 8px;
- border: 1px solid ${props => (props.theme.isBase ? "#d0d5da" : "#474747")};
+ border: 1px solid ${(props) => (props.theme.isBase ? "#d0d5da" : "#474747")};
border-radius: 3px;
width: 100%;
box-sizing: border-box;
- background: ${props => !props.theme.isBase && "#282828"};
- color: ${props => !props.theme.isBase && "#5C5C5C"};
+ background: ${(props) => !props.theme.isBase && "#282828"};
+ color: ${(props) => !props.theme.isBase && "#5C5C5C"};
}
.hex-value-label {
@@ -75,7 +75,7 @@ const StyledComponent = styled.div`
display: flex;
.apply-button {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 8px;
@@ -112,11 +112,19 @@ const StyledComponent = styled.div`
}
`;
-const HexColorPickerComponent = props => {
- const { onCloseHexColorPicker, onAppliedColor, setColor, color } = props;
+const HexColorPickerComponent = (props) => {
+ const { onCloseHexColorPicker, onAppliedColor, appliedColor } = props;
+
+ const [color, setColor] = useState(appliedColor);
const { t } = useTranslation("Common");
+ useEffect(() => {
+ if (color !== appliedColor) {
+ setColor(appliedColor);
+ }
+ }, [appliedColor]);
+
return (
@@ -140,7 +148,7 @@ const HexColorPickerComponent = props => {
className="apply-button"
primary={true}
scale={true}
- onClick={onAppliedColor}
+ onClick={() => onAppliedColor(color)}
/>
!props.dnsSettings && "block"};
- width: ${props =>
+ display: ${(props) => !props.dnsSettings && "block"};
+ width: ${(props) =>
props.lngTZSettings
? "283px"
: props.welcomePage
@@ -23,7 +23,7 @@ const tabletStyles = css`
.title {
display: block;
- width: ${props =>
+ width: ${(props) =>
props.lngTZSettings
? "61px"
: props.welcomePage
@@ -47,7 +47,7 @@ const tabletStyles = css`
.save-cancel-buttons {
display: block;
position: static;
- width: ${props => (props.welcomePage ? "274px" : "197px")};
+ width: ${(props) => (props.welcomePage ? "274px" : "197px")};
padding: 8px 0 0;
}
@@ -73,7 +73,7 @@ const StyledLoader = styled.div`
}
.title {
- width: ${props => (props.portalRenaming ? "109px" : "61px")};
+ width: ${(props) => (props.portalRenaming ? "109px" : "61px")};
}
.title-long {
@@ -98,7 +98,7 @@ const StyledLoader = styled.div`
position: absolute;
bottom: 0;
width: calc(100% - 32px);
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
right: 0;
@@ -121,7 +121,7 @@ const StyledLoader = styled.div`
}
.padding-right {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-left: 8px;
@@ -135,18 +135,13 @@ const StyledLoader = styled.div`
height: 32px;
}
- @media (min-width: 600px) {
+ @media ${mobileMore} {
${tabletStyles}
}
- ${isTablet &&
- `
- ${tabletStyles}
- `}
-
- @media (min-width: 1024px) {
+ @media ${desktop} {
.save-cancel-buttons {
- width: ${props => (props.welcomePage ? "264px" : "192px")};
+ width: ${(props) => (props.welcomePage ? "264px" : "192px")};
}
}
`;
@@ -193,7 +188,8 @@ const LoaderCustomization = ({
portalRenaming={portalRenaming}
welcomePage={welcomePage}
dnsSettings={dnsSettings}
- className="category-item-wrapper">
+ className="category-item-wrapper"
+ >
{portalRenaming && (
diff --git a/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderDescriptionCustomization.js b/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderDescriptionCustomization.js
index e02a29da70..49947ba168 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderDescriptionCustomization.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderDescriptionCustomization.js
@@ -1,7 +1,7 @@
import React from "react";
import styled, { css } from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { isTablet } from "react-device-detect";
+import { mobileMore } from "@docspace/components/utils/device";
const tabletStyles = css`
.description {
@@ -12,14 +12,9 @@ const tabletStyles = css`
`;
const StyledLoader = styled.div`
- @media (min-width: 600px) {
+ @media ${mobileMore} {
${tabletStyles}
}
-
- ${isTablet &&
- css`
- ${tabletStyles}
- `}
`;
const LoaderDescriptionCustomization = () => {
diff --git a/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderSubmenu.js b/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderSubmenu.js
index 2d51dec7fb..0059da6583 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderSubmenu.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/sub-components/loaderSubmenu.js
@@ -1,13 +1,13 @@
import React from "react";
import styled, { css } from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { isTablet } from "react-device-detect";
+import { mobileMore } from "@docspace/components/utils/device";
const StyledLoader = styled.div`
margin-top: -4px;
.loader {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-left: 4px;
@@ -17,14 +17,9 @@ const StyledLoader = styled.div`
`}
}
- @media (min-width: 600px) {
+ @media ${mobileMore} {
margin-top: -9px;
}
-
- ${isTablet &&
- css`
- margin-top: -9px;
- `}
`;
const LoaderSubmenu = () => {
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/StyledBackup.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/StyledBackup.js
index 8a3e470aeb..53f0253a57 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/StyledBackup.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/StyledBackup.js
@@ -3,28 +3,13 @@ import {
commonSettingsStyles,
UnavailableStyles,
} from "../../../utils/commonSettingsStyles";
-import globalColors from "@docspace/components/utils/globalColors";
-import { isMobileOnly } from "react-device-detect";
-import {
- hugeMobile,
- tablet,
- mobile,
- smallTablet,
-} from "@docspace/components/utils/device";
-const linkColor = globalColors.black;
+import { isMobileOnly } from "react-device-detect";
+import { tablet, mobile } from "@docspace/components/utils/device";
const INPUT_LENGTH = "350px";
const TEXT_LENGTH = "700px";
const commonStyles = css`
- ${(props) =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- margin-left: 16px;
- `
- : css`
- margin-right: 16px;
- `}
.backup_modules-description {
margin-bottom: 24px;
margin-top: 8px;
@@ -70,12 +55,20 @@ const commonStyles = css`
width: 100%;
max-width: ${INPUT_LENGTH};
}
+
+ @media ${mobile} {
+ max-width: 100%;
+ }
}
.backup_text-input {
margin: 4px 0 10px 0;
width: 100%;
max-width: ${INPUT_LENGTH};
font-size: 13px;
+
+ @media ${mobile} {
+ max-width: 100%;
+ }
}
.backup_checkbox {
margin-top: 8px;
@@ -133,7 +126,7 @@ const StyledManualBackup = styled.div`
}
}
- @media ${hugeMobile} {
+ @media ${mobile} {
button:first-child {
max-width: 155px;
}
@@ -372,7 +365,7 @@ const StyledRestoreBackup = styled.div`
margin: 16px 0;
max-width: ${INPUT_LENGTH};
- @media ${smallTablet} {
+ @media ${mobile} {
max-width: none;
}
}
@@ -386,7 +379,7 @@ const StyledRestoreBackup = styled.div`
margin-bottom: 16px;
}
.restore-backup_button {
- @media ${smallTablet} {
+ @media ${mobile} {
width: 100%;
}
}
@@ -519,6 +512,15 @@ const StyledBackup = styled.div`
? "grid-template-columns:minmax(100px, 310px) 32px"
: "grid-template-columns:minmax(100px, 350px) 32px"};
grid-gap: 8px;
+
+ @media ${mobile} {
+ ${(props) =>
+ !props.isMobileScale
+ ? ""
+ : props.isConnectedAccount
+ ? "grid-template-columns:minmax(100px, 1fr) 32px"
+ : "grid-template-columns:minmax(100px, 1fr)"};
+ }
}
.backup_modules-separation {
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/auto-backup/sub-components/ScheduleComponent.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/auto-backup/sub-components/ScheduleComponent.js
index 0b0c049942..326292fcea 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/auto-backup/sub-components/ScheduleComponent.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/auto-backup/sub-components/ScheduleComponent.js
@@ -5,8 +5,8 @@ import { useTranslation } from "react-i18next";
import ComboBox from "@docspace/components/combobox";
import Text from "@docspace/components/text";
import { StyledScheduleComponent } from "../../StyledBackup";
-import { AutoBackupPeriod } from "@docspace/common/constants";
-import { isMobileOnly } from "react-device-detect";
+import { AutoBackupPeriod, DeviceType } from "@docspace/common/constants";
+
import HelpButton from "@docspace/components/help-button";
const { EveryWeekType, EveryMonthType } = AutoBackupPeriod;
@@ -29,6 +29,7 @@ const ScheduleComponent = ({
hoursArray,
maxNumberCopiesArray,
monthlySchedule,
+ currentDeviceType,
}) => {
const { t } = useTranslation("Settings");
const renderHelpContent = () => (
@@ -116,7 +117,9 @@ const ScheduleComponent = ({
noBorder={false}
scaled={false}
scaledOptions={true}
- dropDownMaxHeight={isMobileOnly ? 100 : 200}
+ dropDownMaxHeight={
+ currentDeviceType === DeviceType.mobile ? 100 : 200
+ }
className="schedule-backup_combobox time_options"
showDisabledItems
/>
@@ -135,7 +138,9 @@ const ScheduleComponent = ({
noBorder={false}
scaled={false}
scaledOptions={true}
- dropDownMaxHeight={isMobileOnly ? 100 : 200}
+ dropDownMaxHeight={
+ currentDeviceType === DeviceType.mobile ? 100 : 200
+ }
className="schedule-backup_combobox max_copies"
showDisabledItems
/>
@@ -144,7 +149,7 @@ const ScheduleComponent = ({
);
};
-export default inject(({ backup }) => {
+export default inject(({ auth, backup }) => {
const {
selectedPeriodLabel,
selectedWeekdayLabel,
@@ -176,5 +181,6 @@ export default inject(({ backup }) => {
weeklySchedule,
monthlySchedule,
+ currentDeviceType: auth.settingsStore.currentDeviceType,
};
})(observer(ScheduleComponent));
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/common-container/DirectThirdPartyConnection.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/common-container/DirectThirdPartyConnection.js
index c78673c497..680c370a8f 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/common-container/DirectThirdPartyConnection.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/common-container/DirectThirdPartyConnection.js
@@ -48,6 +48,7 @@ const DirectThirdPartyConnection = (props) => {
onSelectFile,
filterParam,
descriptionText,
+ isMobileScale,
} = props;
const { t } = useTranslation("Translations");
@@ -266,12 +267,12 @@ const DirectThirdPartyConnection = (props) => {
const isDisabledSelector = isLoading || isDisabled;
- console.log("folderList", folderList, selectedThirdPartyAccount);
return (
{
<>
{folderList.id && (
{
id={id ? id : folderList.id}
withoutInitPath={withoutInitPath}
isError={isError}
- isDisabled={
- isLoading ||
- accounts.length === 0 ||
- folderList.length === 0 ||
- isDisabled
- }
+ isDisabled={isDisabledSelector}
isThirdParty
/>
)}
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/index.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/index.js
index 72c4a8b99d..cadfe95d69 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/index.js
@@ -10,6 +10,7 @@ import { inject, observer } from "mobx-react";
import AutoBackup from "./auto-backup";
import ManualBackup from "./manual-backup";
import config from "PACKAGE_FILE";
+import { DeviceType } from "@docspace/common/constants";
const Backup = ({
automaticBackupUrl,
@@ -90,10 +91,11 @@ export default inject(({ auth }) => {
const { settingsStore, currentTariffStatusStore } = auth;
const { isNotPaidPeriod } = currentTariffStatusStore;
- const { automaticBackupUrl, isTabletView, currentColorScheme } =
+ const { automaticBackupUrl, currentDeviceType, currentColorScheme } =
settingsStore;
- const buttonSize = isTabletView ? "normal" : "small";
+ const buttonSize =
+ currentDeviceType === DeviceType.desktop ? "small" : "normal";
return {
automaticBackupUrl,
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/index.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/index.js
index cd2ecf80ee..7382e7add0 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/index.js
@@ -9,7 +9,7 @@ import {
import RestoreBackupLoader from "@docspace/common/components/Loaders/RestoreBackupLoader";
import toastr from "@docspace/components/toast/toastr";
import RadioButtonGroup from "@docspace/components/radio-button-group";
-import { BackupStorageType } from "@docspace/common/constants";
+import { BackupStorageType, DeviceType } from "@docspace/common/constants";
import Checkbox from "@docspace/components/checkbox";
import Text from "@docspace/components/text";
@@ -268,7 +268,7 @@ const RestoreBackup = (props) => {
export default inject(({ auth, backup }) => {
const { settingsStore, currentQuotaStore } = auth;
- const { isTabletView, standalone } = settingsStore;
+ const { currentDeviceType, standalone } = settingsStore;
const { isRestoreAndAutoBackupAvailable } = currentQuotaStore;
const {
getProgress,
@@ -279,7 +279,8 @@ export default inject(({ auth, backup }) => {
setRestoreResource,
} = backup;
- const buttonSize = isTabletView ? "normal" : "small";
+ const buttonSize =
+ currentDeviceType !== DeviceType.desktop ? "normal" : "small";
return {
standalone,
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/sub-components/RoomsModule.js b/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/sub-components/RoomsModule.js
index 8ef7a513a8..fa16db5a15 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/sub-components/RoomsModule.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/backup/restore-backup/sub-components/RoomsModule.js
@@ -17,6 +17,7 @@ const RoomsModule = (props) => {
return (
{
return (
);
diff --git a/packages/client/src/pages/PortalSettings/categories/data-management/index.js b/packages/client/src/pages/PortalSettings/categories/data-management/index.js
index 3f4556b91f..2edcc3516c 100644
--- a/packages/client/src/pages/PortalSettings/categories/data-management/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/data-management/index.js
@@ -16,6 +16,7 @@ import AppLoader from "@docspace/common/components/AppLoader";
import config from "../../../../../package.json";
import ManualBackup from "./backup/manual-backup";
import AutoBackup from "./backup/auto-backup";
+import { DeviceType } from "@docspace/common/constants";
const DataManagementWrapper = (props) => {
const { dataBackupUrl, automaticBackupUrl, buttonSize, t, isNotPaidPeriod } =
@@ -46,7 +47,7 @@ const DataManagementWrapper = (props) => {
{helpInfo}
-
+
{
const {
dataBackupUrl,
automaticBackupUrl,
- isTabletView,
+
currentColorScheme,
+ currentDeviceType,
} = settingsStore;
- const buttonSize = isTabletView ? "normal" : "small";
+ const buttonSize =
+ currentDeviceType !== DeviceType.desktop ? "normal" : "small";
return {
loadBaseInfo: async () => {
await initSettings();
diff --git a/packages/client/src/pages/PortalSettings/categories/delete-data/DeleteDataLoader.js b/packages/client/src/pages/PortalSettings/categories/delete-data/DeleteDataLoader.js
index 95563554d7..6b575f31fe 100644
--- a/packages/client/src/pages/PortalSettings/categories/delete-data/DeleteDataLoader.js
+++ b/packages/client/src/pages/PortalSettings/categories/delete-data/DeleteDataLoader.js
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledLoader = styled.div`
display: flex;
@@ -12,7 +12,7 @@ const StyledLoader = styled.div`
height: 22px;
margin-bottom: 8px;
- @media (${hugeMobile}) {
+ @media ${mobile} {
width: 171px;
}
}
@@ -22,7 +22,7 @@ const StyledLoader = styled.div`
height: 16px;
margin-bottom: 16px;
- @media (${hugeMobile}) {
+ @media ${mobile} {
width: 100%;
}
}
diff --git a/packages/client/src/pages/PortalSettings/categories/delete-data/StyledDeleteData.js b/packages/client/src/pages/PortalSettings/categories/delete-data/StyledDeleteData.js
index aa63d25086..835558907e 100644
--- a/packages/client/src/pages/PortalSettings/categories/delete-data/StyledDeleteData.js
+++ b/packages/client/src/pages/PortalSettings/categories/delete-data/StyledDeleteData.js
@@ -1,5 +1,5 @@
import styled from "styled-components";
-import { smallTablet, mobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
export const DeleteDataLayout = styled.div`
width: 100%;
@@ -38,14 +38,14 @@ export const ButtonWrapper = styled.div`
margin-left: 4px;
}
- @media (${smallTablet}) {
+ @media ${mobile} {
flex-direction: column-reverse;
gap: 16px;
position: absolute;
bottom: 16px;
width: calc(100% - 40px);
- @media (${mobile}) {
+ @media ${mobile} {
width: calc(100% - 32px);
}
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Api/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Api/index.js
index b844bf73c5..56bfdbf256 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Api/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Api/index.js
@@ -2,14 +2,15 @@ import React from "react";
import { withTranslation } from "react-i18next";
import styled from "styled-components";
import { inject, observer } from "mobx-react";
-import { isMobileOnly } from "react-device-detect";
-import { smallTablet } from "@docspace/components/utils/device";
+
+import { mobile } from "@docspace/components/utils/device";
import Button from "@docspace/components/button";
import EmptyScreenContainer from "@docspace/components/empty-screen-container";
import ConfirmWrapper from "../../../../Confirm/ConfirmWrapper";
import ApiSvgUrl from "PUBLIC_DIR/images/settings.api.svg?url";
import ApiDarkSvgUrl from "PUBLIC_DIR/images/settings.api.dark.svg?url";
+import { DeviceType } from "@docspace/common/constants";
const EmptyContainer = styled(EmptyScreenContainer)`
.ec-header {
@@ -20,7 +21,7 @@ const EmptyContainer = styled(EmptyScreenContainer)`
margin-right: 22px;
margin-top: 22px;
- @media ${smallTablet} {
+ @media ${mobile} {
margin-bottom: 22px;
}
}
@@ -33,7 +34,7 @@ const EmptyContainer = styled(EmptyScreenContainer)`
`;
const Api = (props) => {
- const { t, setDocumentTitle, theme, apiBasicLink } = props;
+ const { t, setDocumentTitle, theme, apiBasicLink, currentDeviceType } = props;
const imgSrc = theme.isBase ? ApiSvgUrl : ApiDarkSvgUrl;
@@ -49,7 +50,7 @@ const Api = (props) => {
size="normal"
minwidth="135px"
onClick={() => window.open(apiBasicLink, "_blank")}
- scale={isMobileOnly}
+ scale={currentDeviceType === DeviceType.mobile}
/>
}
descriptionText={t("ApiPageDescription")}
@@ -62,12 +63,13 @@ const Api = (props) => {
};
export default inject(({ auth }) => {
- const { settingsStore, setDocumentTitle } = auth;
+ const { settingsStore, setDocumentTitle, currentDeviceType } = auth;
const { theme, apiBasicLink } = settingsStore;
return {
theme,
setDocumentTitle,
apiBasicLink,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(Api)));
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/index.js
index 6f1da22397..295c405c91 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/index.js
@@ -11,10 +11,10 @@ import Checkbox from "@docspace/components/checkbox";
import ComboBox from "@docspace/components/combobox";
import TabContainer from "@docspace/components/tabs-container";
import FilesSelectorInput from "SRC_DIR/components/FilesSelectorInput";
-import { hugeMobile, tablet } from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
import { objectToGetParams, loadScript } from "@docspace/common/utils";
import { inject, observer } from "mobx-react";
-import { isMobileOnly } from "react-device-detect";
+
import BreakpointWarning from "SRC_DIR/components/BreakpointWarning";
import Loaders from "@docspace/common/components/Loaders";
import HelpButton from "@docspace/components/help-button";
@@ -77,7 +77,7 @@ const CategorySubHeader = styled.div`
}
}
- @media ${hugeMobile} {
+ @media ${mobile} {
&:first-of-type {
margin-top: 0;
}
@@ -183,7 +183,7 @@ const GetCodeButtonWrapper = styled.div`
margin-top: 32px;
background-color: ${({ theme }) => theme.backgroundColor};
- @media ${hugeMobile} {
+ @media ${mobile} {
position: fixed;
padding-inline: 16px;
inset-inline: 0;
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsBar.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsBar.js
index 50a0ec3d34..4398d0a5ed 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsBar.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsBar.js
@@ -10,11 +10,12 @@ import { inject, observer } from "mobx-react";
import { Base } from "@docspace/components/themes";
import { useTranslation } from "react-i18next";
+import { tablet, mobile } from "@docspace/components/utils/device";
+
const BarWrapper = styled.div`
width: 100%;
max-width: 1200px;
display: flex;
- align-items: center;
justify-content: space-between;
margin-top: 24px;
@@ -32,26 +33,20 @@ BarWrapper.defaultProps = { theme: Base };
const BarItem = styled.div`
box-sizing: border-box;
- height: 76px;
+ min-height: 76px;
padding: 16px;
flex-basis: 25%;
- @media (max-width: 1300px) {
+ @media ${tablet} {
flex-basis: 50%;
}
- @media (max-width: 560px) {
+ @media ${mobile} {
flex-basis: 100%;
}
`;
const BarItemHeader = ({ children }) => (
-
+
{children}
);
@@ -66,9 +61,7 @@ const DetailsBar = ({ eventDetails }) => {
const formatDate = (date) => {
return (
- moment(date).locale(i18n.language).format("MMM D, YYYY, h:mm:ss A") +
- " " +
- t("Common:UTC")
+ moment(date).locale(i18n.language).format("MMM D, YYYY, h:mm:ss A") + " " + t("Common:UTC")
);
};
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsNavigationHeader.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsNavigationHeader.js
index 4ff68e8da2..1a404deba0 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsNavigationHeader.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/DetailsNavigationHeader.js
@@ -13,7 +13,7 @@ import RetryIcon from "PUBLIC_DIR/images/refresh.react.svg?url";
import Headline from "@docspace/common/components/Headline";
import IconButton from "@docspace/components/icon-button";
-import { tablet } from "@docspace/components/utils/device";
+import { tablet, mobile } from "@docspace/components/utils/device";
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";
@@ -39,14 +39,21 @@ const HeaderContainer = styled.div`
}
svg {
- ${({ theme }) =>
- theme.interfaceDirection === "rtl" && "transform: scaleX(-1);"}
+ ${({ theme }) => theme.interfaceDirection === "rtl" && "transform: scaleX(-1);"}
}
}
.headline {
font-size: 18px;
margin-inline-end: 16px;
+
+ @media ${tablet} {
+ font-size: 21px;
+ }
+
+ @media ${mobile} {
+ font-size: 18px;
+ }
}
`;
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/MessagesDetails.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/MessagesDetails.js
index 302b4bac66..10e010c933 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/MessagesDetails.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/MessagesDetails.js
@@ -5,14 +5,14 @@ import Submenu from "@docspace/components/submenu";
import RequestDetails from "./RequestDetails";
import ResponseDetails from "./ResponseDetails";
import { useTranslation } from "react-i18next";
-import { isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import { inject, observer } from "mobx-react";
const SubmenuWrapper = styled.div`
.sticky {
z-index: 3;
- top: ${() => (isMobileOnly ? "68px" : "0px")};
+ top: ${isMobile() ? "68px" : "0px"};
}
`;
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/ResponseDetails.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/ResponseDetails.js
index a1f4a74752..e5bf3c35c2 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/ResponseDetails.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookEventDetails/sub-components/ResponseDetails.js
@@ -6,7 +6,7 @@ import Text from "@docspace/components/text";
import { inject, observer } from "mobx-react";
import json_beautifier from "csvjson-json_beautifier";
-import { isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import { useTranslation } from "react-i18next";
const DetailsWrapper = styled.div`
@@ -45,7 +45,7 @@ const LargePayloadStub = styled.div`
border: 1px solid #eceef1;
border-radius: 3px;
- ${isMobileOnly &&
+ ${isMobile() &&
css`
justify-content: flex-start;
flex-wrap: wrap;
@@ -79,9 +79,7 @@ const ResponseDetails = ({ eventDetails }) => {
const openRawPayload = () => {
const rawPayload = window.open("");
isJSON(responsePayload)
- ? rawPayload.document.write(
- beautifiedJSON.replace(/(?:\r\n|\r|\n)/g, " ")
- )
+ ? rawPayload.document.write(beautifiedJSON.replace(/(?:\r\n|\r|\n)/g, " "))
: rawPayload.document.write(responsePayload);
rawPayload.focus();
};
@@ -102,11 +100,7 @@ const ResponseDetails = ({ eventDetails }) => {
copyInfoText={t("ResponseHeaderCopied")}
/>
) : (
-
+
)}
{t("ResponsePostBody")}
@@ -121,7 +115,7 @@ const ResponseDetails = ({ eventDetails }) => {
size="small"
onClick={openRawPayload}
label={t("ViewRawPayload")}
- scale={isMobileOnly}
+ scale={isMobile()}
/>
) : responsePayload === "" ? (
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/FilterDialog/DeliveryDatePicker.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/FilterDialog/DeliveryDatePicker.js
index 1585c06aa6..6b086333dd 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/FilterDialog/DeliveryDatePicker.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/FilterDialog/DeliveryDatePicker.js
@@ -10,7 +10,7 @@ import TimePicker from "@docspace/components/time-picker";
import SelectorAddButton from "@docspace/components/selector-add-button";
import SelectedItem from "@docspace/components/selected-item";
-import { isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
const Selectors = styled.div`
position: relative;
@@ -112,7 +112,7 @@ const DeliveryDatePicker = ({
selectedDate={filters.deliveryDate}
setSelectedDate={onDateSet}
onChange={closeCalendar}
- isMobile={isMobileOnly}
+ isMobile={isMobile()}
forwardedRef={calendarRef}
locale={i18n.language}
/>
@@ -176,6 +176,7 @@ const DeliveryDatePicker = ({
) : (
+ className="mr-8">
{t("From")}
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 10px;
@@ -40,7 +46,7 @@ const Footer = styled.div`
const Separator = styled.hr`
border-top: 1px solid;
- border-color: ${props => (props.theme.isBase ? "#eceef1" : "#474747")};
+ border-color: ${(props) => (props.theme.isBase ? "#eceef1" : "#474747")};
margin-bottom: 14px;
`;
@@ -48,10 +54,7 @@ Separator.defaultProps = { theme: Base };
const constructUrl = (baseUrl, filters) => {
const url = new URL(baseUrl, "http://127.0.0.1:8092/");
- url.searchParams.append(
- "deliveryDate",
- filters.deliveryDate?.format("YYYY-MM-DD") || null
- );
+ url.searchParams.append("deliveryDate", filters.deliveryDate?.format("YYYY-MM-DD") || null);
url.searchParams.append("deliveryFrom", filters.deliveryFrom.format("HH:mm"));
url.searchParams.append("deliveryTo", filters.deliveryTo.format("HH:mm"));
url.searchParams.append("status", JSON.stringify(filters.status));
@@ -60,21 +63,12 @@ const constructUrl = (baseUrl, filters) => {
};
function areArraysEqual(array1, array2) {
- return (
- array1.length === array2.length &&
- array1.every((val, index) => val === array2[index])
- );
+ return array1.length === array2.length && array1.every((val, index) => val === array2[index]);
}
-const FilterDialog = props => {
- const {
- visible,
- closeModal,
- applyFilters,
- formatFilters,
- setHistoryFilters,
- historyFilters,
- } = props;
+const FilterDialog = (props) => {
+ const { visible, closeModal, applyFilters, formatFilters, setHistoryFilters, historyFilters } =
+ props;
const { t } = useTranslation(["Webhooks", "Files", "Common"]);
const { id } = useParams();
const navigate = useNavigate();
@@ -116,12 +110,7 @@ const FilterDialog = props => {
} else {
setFilters(historyFilters);
setIsApplied(true);
- navigate(
- constructUrl(
- `/portal-settings/developer-tools/webhooks/${id}`,
- historyFilters
- )
- );
+ navigate(constructUrl(`/portal-settings/developer-tools/webhooks/${id}`, historyFilters));
}
setIsLoaded(true);
}, [historyFilters, visible]);
@@ -135,11 +124,7 @@ const FilterDialog = props => {
: filters.deliveryDate === null && filters.status.length === 0;
return (
-
+
{t("Files:Filter")}
@@ -173,7 +158,7 @@ const FilterDialog = props => {
)}
-
+
);
};
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryFilterHeader.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryFilterHeader.js
index 9c15444168..c4249c8d6d 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryFilterHeader.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryFilterHeader.js
@@ -12,7 +12,7 @@ import FilterDialog from "./FilterDialog";
import StatusBar from "./StatusBar";
import { useTranslation } from "react-i18next";
-import { isMobile, isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
const ListHeader = styled.header`
display: flex;
@@ -20,15 +20,9 @@ const ListHeader = styled.header`
align-items: center;
${() =>
- isMobile &&
+ isMobile() &&
css`
- margin-top: 9px;
- `}
- ${() =>
- isMobileOnly &&
- css`
- margin-top: 35px;
- padding-inline-end: 8px;
+ margin-top: 8px;
`}
`;
@@ -54,8 +48,7 @@ const FilterButton = styled.div`
z-index: ${(props) => (props.isGroupMenuVisible ? 199 : 201)};
border: 1px solid;
- border-color: ${(props) =>
- props.theme.isBase ? "#d0d5da" : "rgb(71, 71, 71)"};
+ border-color: ${(props) => (props.theme.isBase ? "#d0d5da" : "rgb(71, 71, 71)")};
border-radius: 3px;
cursor: pointer;
@@ -111,8 +104,7 @@ const HistoryFilterHeader = (props) => {
+ isGroupMenuVisible={isGroupMenuVisible}>
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryHeader.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryHeader.js
index afe7481775..6b56025c0d 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryHeader.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/HistoryHeader.js
@@ -10,10 +10,9 @@ import Headline from "@docspace/common/components/Headline";
import IconButton from "@docspace/components/icon-button";
// import { Hint } from "../../styled-components";
-import { tablet } from "@docspace/components/utils/device";
+import { tablet, mobile, isTablet, isMobile } from "@docspace/components/utils/device";
import TableGroupMenu from "@docspace/components/table-container/TableGroupMenu";
-import { isMobile, isMobileOnly } from "react-device-detect";
import DropDownItem from "@docspace/components/drop-down-item";
import toastr from "@docspace/components/toast/toastr";
@@ -22,6 +21,8 @@ import { useParams } from "react-router-dom";
import FloatingButton from "@docspace/components/floating-button";
+import Base from "@docspace/components/themes/base";
+
const HeaderContainer = styled.div`
position: sticky;
top: 0;
@@ -30,24 +31,20 @@ const HeaderContainer = styled.div`
display: flex;
align-items: center;
width: 100%;
- min-height: 70px;
+ min-height: 53px;
flex-wrap: wrap;
- ${() =>
- isMobile &&
- css`
- margin-bottom: 11px;
- `}
+ @media ${tablet} {
+ margin-bottom: 11px;
+ }
- ${() =>
- isMobileOnly &&
- css`
- margin-top: 7px;
- margin-left: -14px;
- padding-left: 14px;
- margin-right: -14px;
- padding-right: 14px;
- `}
+ @media ${mobile} {
+ margin-top: 7px;
+ margin-left: -14px;
+ padding-left: 14px;
+ margin-right: -14px;
+ padding-right: 14px;
+ }
.arrow-button {
margin-inline-end: 18.5px;
@@ -58,21 +55,25 @@ const HeaderContainer = styled.div`
margin-inline-start: -8px;
}
- ${() =>
- isMobileOnly &&
- css`
- margin-inline-end: 13px;
- `}
+ @media ${mobile} {
+ margin-inline-end: 13px;
+ }
svg {
- ${({ theme }) =>
- theme.interfaceDirection === "rtl" && "transform: scaleX(-1);"}
+ ${({ theme }) => theme.interfaceDirection === "rtl" && "transform: scaleX(-1);"}
}
}
.headline {
font-size: 18px;
margin-inline-end: 16px;
+
+ @media ${tablet} {
+ font-size: 21px;
+ }
+ @media ${mobile} {
+ font-size: 18px;
+ }
}
.table-container_group-menu {
@@ -89,31 +90,31 @@ const HeaderContainer = styled.div`
.combo-button_selected-icon {
svg {
path {
- fill: ${(props) => (props.isDisabled ? "#d0d5da" : "#333")};
+ fill: ${(props) => (props.isDisabled ? "#d0d5da" : props.theme.color)};
}
}
}
- ${() =>
- isMobile &&
- css`
- height: 60px;
- margin-block: 0;
- margin-inline: -16px 0;
- width: calc(100% + 32px);
- `}
- ${() =>
- isMobileOnly &&
- css`
- position: absolute;
- height: 48px;
- margin-block: -35px 0;
- margin-inline: -17px 0;
- width: calc(100% + 32px);
- `}
+ @media ${tablet} {
+ height: 60px;
+ margin-block: 0;
+ margin-inline: -16px 0;
+ width: calc(100% + 32px);
+ top: 5px;
+ }
+ @media ${mobile} {
+ position: absolute;
+ height: 48px;
+ margin-block: -17px 0;
+ margin-inline: -17px 0;
+ width: 100%;
+ top: 10px;
+ }
}
`;
+HeaderContainer.defaultProps = { theme: Base };
+
const HistoryHeader = (props) => {
const {
isGroupMenuVisible,
@@ -161,7 +162,7 @@ const HistoryHeader = (props) => {
});
toastr.success(
`${t("WebhookRedilivered")}: ${checkedEventIds.length}`,
- {t("Common:Done")}
+ {t("Common:Done")} ,
);
} catch (error) {
console.log(error);
@@ -181,8 +182,7 @@ const HistoryHeader = (props) => {
},
];
- const onKeyPress = (e) =>
- (e.key === "Esc" || e.key === "Escape") && emptyCheckedIds();
+ const onKeyPress = (e) => (e.key === "Esc" || e.key === "Escape") && emptyCheckedIds();
useEffect(() => {
window.addEventListener("keyup", onKeyPress);
@@ -246,7 +246,7 @@ const HistoryHeader = (props) => {
return (
- {isMobileOnly ? (
+ {isMobile() ? (
<>
{isGroupMenuVisible && }
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryRowView/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryRowView/index.js
index 208527e9d5..91b98c600e 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryRowView/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryRowView/index.js
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import styled from "styled-components";
import { inject, observer } from "mobx-react";
-import { isMobile, isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import { useParams } from "react-router-dom";
import RowContainer from "@docspace/components/row-container";
@@ -15,15 +15,14 @@ const StyledRowContainer = styled(RowContainer)`
.row-list-item {
cursor: pointer;
- padding-inline-end: ${() => (isMobileOnly ? "5px" : "15px")};
+ padding-inline-end: ${() => (isMobile() ? "5px" : "15px")};
}
.row-item::after {
bottom: -3px;
}
.row-list-item:has(.selected-row-item) {
- background-color: ${(props) =>
- props.theme.isBase ? "#f3f4f4" : "#282828"};
+ background-color: ${(props) => (props.theme.isBase ? "#f3f4f4" : "#282828")};
}
`;
@@ -46,7 +45,7 @@ const HistoryRowView = (props) => {
useEffect(() => {
if (viewAs !== "table" && viewAs !== "row") return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || isMobile()) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
@@ -66,14 +65,9 @@ const HistoryRowView = (props) => {
itemCount={totalItems}
draggable
useReactWindow={true}
- itemHeight={59}
- >
+ itemHeight={59}>
{historyItems.map((item) => (
-
+
))}
);
@@ -81,14 +75,8 @@ const HistoryRowView = (props) => {
export default inject(({ setup, webhooksStore }) => {
const { viewAs, setViewAs } = setup;
- const {
- historyItems,
- fetchMoreItems,
- hasMoreItems,
- totalItems,
- historyFilters,
- formatFilters,
- } = webhooksStore;
+ const { historyItems, fetchMoreItems, hasMoreItems, totalItems, historyFilters, formatFilters } =
+ webhooksStore;
return {
viewAs,
setViewAs,
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/HistoryTableRow.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/HistoryTableRow.js
index a1ac3160a0..47a0bb2b24 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/HistoryTableRow.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/HistoryTableRow.js
@@ -65,8 +65,7 @@ const HistoryTableRow = (props) => {
const navigate = useNavigate();
const { id } = useParams();
- const redirectToDetails = () =>
- navigate(window.location.pathname + `/${item.id}`);
+ const redirectToDetails = () => navigate(window.location.pathname + `/${item.id}`);
const handleRetryEvent = async () => {
if (isRetryPending) {
return;
@@ -98,13 +97,11 @@ const HistoryTableRow = (props) => {
];
const formattedDelivery =
- moment(item.delivery)
- .locale(i18n.language)
- .format("MMM D, YYYY, h:mm:ss A") +
+ moment(item.delivery).locale(i18n.language).format("MMM D, YYYY, h:mm:ss A") +
" " +
t("Common:UTC");
- const onChange = (e) => {
+ const onRowClick = (e) => {
if (
e.target.closest(".checkbox") ||
e.target.closest(".table-container_row-checkbox") ||
@@ -117,25 +114,18 @@ const HistoryTableRow = (props) => {
toggleEventId(item.id);
};
+ const onCheckboxClick = () => {
+ toggleEventId(item.id);
+ };
+
const isChecked = isIdChecked(item.id);
return (
-
-
+
+
-
+
{item.id}
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/index.js
index 2b5fae2b63..0555efc606 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/WebhookHistory/sub-components/WebhookHistoryTable/HistoryTableView/index.js
@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from "react";
import styled from "styled-components";
-import { isMobile } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import TableContainer from "@docspace/components/table-container/TableContainer";
import TableBody from "@docspace/components/table-container/TableBody";
@@ -34,14 +34,12 @@ const TableWrapper = styled(TableContainer)`
.table-list-item {
cursor: pointer;
&:hover {
- background-color: ${(props) =>
- props.theme.isBase ? "#f3f4f4" : "#282828"};
+ background-color: ${(props) => (props.theme.isBase ? "#f3f4f4" : "#282828")};
}
}
.table-list-item:has(.selected-table-row) {
- background-color: ${(props) =>
- props.theme.isBase ? "#f3f4f4" : "#282828"};
+ background-color: ${(props) => (props.theme.isBase ? "#f3f4f4" : "#282828")};
}
`;
@@ -72,7 +70,7 @@ const HistoryTableView = (props) => {
useEffect(() => {
if (!sectionWidth) return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || isMobile()) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
@@ -93,8 +91,7 @@ const HistoryTableView = (props) => {
style={{
gridTemplateColumns: "300px 100px 400px 24px",
}}
- useReactWindow
- >
+ useReactWindow>
{
filesLength={historyItems.length}
fetchMoreFiles={fetchMoreFiles}
hasMoreFiles={hasMoreItems}
- itemCount={totalItems}
- >
+ itemCount={totalItems}>
{historyItems.map((item) => (
{
export default inject(({ setup, webhooksStore, auth }) => {
const { viewAs, setViewAs } = setup;
- const {
- historyItems,
- fetchMoreItems,
- hasMoreItems,
- totalItems,
- formatFilters,
- historyFilters,
- } = webhooksStore;
+ const { historyItems, fetchMoreItems, hasMoreItems, totalItems, formatFilters, historyFilters } =
+ webhooksStore;
const { id: userId } = auth.userStore.user;
return {
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/index.js
index 4f173b4a67..948e64f9ac 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/index.js
@@ -122,10 +122,7 @@ const Webhooks = (props) => {
)}
{!isWebhooksEmpty && (
-
+
)}
{
header={t("CreateWebhook")}
onSubmit={onCreateWebhook}
additionalId="create-webhook"
+ isSettingsModal={false}
/>
(props.backgroundColor ? props.backgroundColor : "#f8f7bf")};
color: ${(props) => (props.color ? props.color : "initial")};
border-radius: 6px;
- font-family: "Open Sans";
- font-style: normal;
font-weight: 400;
font-size: 12px;
line-height: 16px;
@@ -21,6 +19,6 @@ export const Hint = styled.div`
position: absolute;
z-index: 2;
- width: 320px;
+ width: calc(100% - 32px);
`}
`;
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/SecretKeyInput.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/SecretKeyInput.js
index ecdf2d900b..0ec0c6424c 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/SecretKeyInput.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/SecretKeyInput.js
@@ -31,7 +31,7 @@ const Header = styled.p`
margin-bottom: 5px;
img {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 4px;
@@ -48,7 +48,7 @@ const StyledInfoIcon = styled.img`
}
`;
-const SecretKeyInput = props => {
+const SecretKeyInput = (props) => {
const {
isResetVisible,
name,
@@ -68,10 +68,9 @@ const SecretKeyInput = props => {
const secretKeyInputRef = useRef(null);
- const toggleHint = () =>
- setIsHintVisible(prevIsHintVisible => !prevIsHintVisible);
+ const toggleHint = () => setIsHintVisible((prevIsHintVisible) => !prevIsHintVisible);
- const handleInputValidation = isValid => {
+ const handleInputValidation = (isValid) => {
setIsPasswordValid(isValid);
};
@@ -83,7 +82,7 @@ const SecretKeyInput = props => {
toggleHint();
};
- const handleOnChange = e => {
+ const handleOnChange = (e) => {
onChange({ target: { name, value: e.target.value } });
};
@@ -175,8 +174,8 @@ const SecretKeyInput = props => {
);
};
-export default inject(({ settingsStore, auth }) => {
- const { passwordSettings } = settingsStore;
+export default inject(({ auth }) => {
+ const { passwordSettings } = auth.settingsStore;
const { webhooksGuideUrl } = auth.settingsStore;
return {
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/StatusBadge.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/StatusBadge.js
index 561e3f27e1..7935a1fad0 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/StatusBadge.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/StatusBadge.js
@@ -41,6 +41,7 @@ const StatusBadge = (props) => {
color={badgeColorScheme.color}
label={status === 0 ? t("NotSent") : status.toString()}
fontSize="9px"
+ maxWidth="80px"
fontWeight={700}
noHover
/>
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhookDialog.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhookDialog.js
index 7c42375a73..0a9b2e8ae5 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhookDialog.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhookDialog.js
@@ -8,6 +8,12 @@ import { SSLVerification } from "./SSLVerification";
import SecretKeyInput from "./SecretKeyInput";
import { useTranslation } from "react-i18next";
+const ModalDialogContainer = styled(ModalDialog)`
+ .modal-body {
+ overflow-y: auto;
+ }
+`;
+
const StyledWebhookForm = styled.form`
margin-top: 7px;
@@ -24,7 +30,7 @@ const Footer = styled.div`
width: 100%;
}
button:first-of-type {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 10px;
@@ -44,17 +50,8 @@ function validateUrl(url) {
return true;
}
-
const WebhookDialog = (props) => {
- const {
- visible,
- onClose,
- header,
- isSettingsModal,
- onSubmit,
- webhook,
- additionalId,
- } = props;
+ const { visible, onClose, header, isSettingsModal, onSubmit, webhook, additionalId } = props;
const [isResetVisible, setIsResetVisible] = useState(isSettingsModal);
@@ -85,14 +82,14 @@ const WebhookDialog = (props) => {
isSettingsModal && setIsResetVisible(true);
};
- const onInputChange = e => {
+ const onInputChange = (e) => {
if (e.target.name) {
!isValid[e.target.name] &&
- setIsValid(prevIsValid => ({
+ setIsValid((prevIsValid) => ({
...prevIsValid,
[e.target.name]: true,
}));
- setWebhookInfo(prevWebhookInfo => ({
+ setWebhookInfo((prevWebhookInfo) => ({
...prevWebhookInfo,
[e.target.name]: e.target.value,
}));
@@ -112,7 +109,7 @@ const WebhookDialog = (props) => {
}
};
- const onFormSubmit = e => {
+ const onFormSubmit = (e) => {
e.preventDefault();
onSubmit(webhookInfo);
setWebhookInfo({
@@ -122,7 +119,7 @@ const WebhookDialog = (props) => {
secretKey: "",
enabled: true,
});
- setPasswordInputKey(prevKey => prevKey + 1);
+ setPasswordInputKey((prevKey) => prevKey + 1);
onModalClose();
};
@@ -144,11 +141,10 @@ const WebhookDialog = (props) => {
});
}, [webhook]);
- const onKeyPress = e =>
- (e.key === "Esc" || e.key === "Escape") && onModalClose();
+ const onKeyPress = (e) => (e.key === "Esc" || e.key === "Escape") && onModalClose();
return (
- {
hasError={!isValid.uri}
required
/>
-
{
passwordInputKey={passwordInputKey}
additionalId={additionalId}
/>
+
@@ -199,9 +195,7 @@ const WebhookDialog = (props) => {
-
+
);
};
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/WebhookRowContent.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/WebhookRowContent.js
index 151c579071..a4b7db119e 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/WebhookRowContent.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/WebhookRowContent.js
@@ -7,7 +7,7 @@ import ToggleButton from "@docspace/components/toggle-button";
import StatusBadge from "../../StatusBadge";
-import { isMobileOnly } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
const StyledRowContent = styled(RowContent)`
display: flex;
@@ -42,27 +42,18 @@ const FlexWrapper = styled.div`
display: flex;
`;
-export const WebhookRowContent = ({
- sectionWidth,
- webhook,
- isChecked,
- handleToggleEnabled,
-}) => {
+export const WebhookRowContent = ({ sectionWidth, webhook, isChecked, handleToggleEnabled }) => {
return (
-
+
{webhook.name}
- {!isMobileOnly && (
+ {!isMobile() && (
{webhook.uri}
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/index.js
index 5a6d513baa..cf84215d60 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksRowView/index.js
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import styled from "styled-components";
import { inject, observer } from "mobx-react";
-import { isMobile } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import RowContainer from "@docspace/components/row-container";
@@ -18,7 +18,7 @@ const WebhooksRowView = (props) => {
useEffect(() => {
if (viewAs !== "table" && viewAs !== "row") return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || isMobile()) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksTableView/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksTableView/index.js
index 6e102673de..83280f461c 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksTableView/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/Webhooks/sub-components/WebhooksTable/WebhooksTableView/index.js
@@ -1,6 +1,6 @@
import React, { useState, useRef, useEffect } from "react";
import { inject, observer } from "mobx-react";
-import { isMobile } from "react-device-detect";
+import { isMobile } from "@docspace/components/utils/device";
import styled from "styled-components";
@@ -55,7 +55,7 @@ const WebhooksTableView = (props) => {
useEffect(() => {
if (!sectionWidth) return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || isMobile()) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/index.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/index.js
index a8ef7850f5..962bf00c8a 100644
--- a/packages/client/src/pages/PortalSettings/categories/developer-tools/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/index.js
@@ -18,21 +18,16 @@ import { isMobile, isMobileOnly } from "react-device-detect";
import AppLoader from "@docspace/common/components/AppLoader";
import SSOLoader from "./sub-components/ssoLoader";
import { WebhookConfigsLoader } from "./Webhooks/sub-components/Loaders";
+import { DeviceType } from "@docspace/common/constants";
const StyledSubmenu = styled(Submenu)`
.sticky {
- margin-top: ${() => (isMobile ? "0" : "4px")};
z-index: 201;
- ${() =>
- isMobileOnly &&
- css`
- top: 58px;
- `}
}
`;
const DeveloperToolsWrapper = (props) => {
- const { loadBaseInfo, enablePlugins } = props;
+ const { loadBaseInfo, currentDeviceType, enablePlugins } = props;
const navigate = useNavigate();
const [isLoading, setIsLoading] = useState(false);
@@ -48,16 +43,6 @@ const DeveloperToolsWrapper = (props) => {
const sdkLabel = (
{t("JavascriptSdk")}
-
-
-
);
@@ -137,7 +122,18 @@ const DeveloperToolsWrapper = (props) => {
return (
}>
-
+
);
};
@@ -149,6 +145,7 @@ export default inject(({ setup, auth }) => {
return {
enablePlugins: settingsStore.enablePlugins,
+ currentDeviceType: settingsStore.currentDeviceType,
loadBaseInfo: async () => {
await initSettings();
},
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.js b/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.js
index d53df11822..e105e3df8d 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.js
@@ -13,6 +13,7 @@ import {
} from "@docspace/components";
import toastr from "@docspace/components/toast/toastr";
import Loaders from "@docspace/common/components/Loaders";
+import { DeviceType } from "@docspace/common/constants";
const URL_REGEX = /^https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\/?$/;
const EDITOR_URL_PLACEHOLDER = `${window.location.protocol}///`;
@@ -22,6 +23,7 @@ const DocumentService = ({
changeDocumentServiceLocation,
currentColorScheme,
integrationSettingsUrl,
+ currentDeviceType,
}) => {
const { t, ready } = useTranslation(["Settings", "Common"]);
@@ -133,6 +135,9 @@ const DocumentService = ({
if (isLoading || !ready) return ;
+ const buttonSize =
+ currentDeviceType === DeviceType.desktop ? "small" : "normal";
+
return (
@@ -242,7 +247,7 @@ const DocumentService = ({
onClick={onSubmit}
className="button"
primary
- size={"small"}
+ size={buttonSize}
label={t("Common:SaveButton")}
isDisabled={
isFormEmpty ||
@@ -256,8 +261,8 @@ const DocumentService = ({
@@ -268,7 +273,8 @@ const DocumentService = ({
};
export default inject(({ auth, settingsStore }) => {
- const { currentColorScheme, integrationSettingsUrl } = auth.settingsStore;
+ const { currentColorScheme, integrationSettingsUrl, currentDeviceType } =
+ auth.settingsStore;
const { getDocumentServiceLocation, changeDocumentServiceLocation } =
settingsStore;
return {
@@ -276,5 +282,6 @@ export default inject(({ auth, settingsStore }) => {
changeDocumentServiceLocation,
currentColorScheme,
integrationSettingsUrl,
+ currentDeviceType,
};
})(observer(DocumentService));
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.styled.js b/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.styled.js
index 8b35e1c62e..877d46ce58 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.styled.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/DocumentService/index.styled.js
@@ -50,6 +50,10 @@ export const LocationForm = styled.form`
width: 100%;
max-width: 350px;
+ @media ${mobile} {
+ max-width: 100%;
+ }
+
display: flex;
flex-direction: column;
gap: 16px;
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/StyledComponent.js b/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/StyledComponent.js
index f8eed341b9..0305d27b05 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/StyledComponent.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/StyledComponent.js
@@ -1,8 +1,10 @@
import styled, { css } from "styled-components";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledComponent = styled.div`
+ max-width: 700px;
+
.smtp-settings_description {
margin-bottom: 20px;
max-width: 700px;
@@ -15,7 +17,7 @@ const StyledComponent = styled.div`
margin: auto 0;
}
.smtp-settings_help-button {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 4px;
@@ -29,7 +31,7 @@ const StyledComponent = styled.div`
display: flex;
span {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 2px;
@@ -44,6 +46,10 @@ const StyledComponent = styled.div`
margin-top: 4px;
max-width: 350px;
+ @media ${mobile} {
+ max-width: 100%;
+ }
+
.field-label-icon {
display: none;
}
@@ -62,12 +68,13 @@ const StyledComponent = styled.div`
const ButtonStyledComponent = styled.div`
margin-top: 20px;
- max-width: 404px;
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
+
+ display: flex;
gap: 8px;
- @media ${hugeMobile} {
+ @media ${mobile} {
+ display: grid;
+ gap: 8px;
grid-template-columns: 1fr;
}
`;
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/sub-components/ButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/sub-components/ButtonContainer.js
index 3fa6f94394..1d03a199f9 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/sub-components/ButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SMTPSettings/sub-components/ButtonContainer.js
@@ -10,6 +10,7 @@ import {
import { ButtonStyledComponent } from "../StyledComponent";
import { SMTPSettingsFields } from "../constants";
+import { DeviceType } from "@docspace/common/constants";
const {
HOST,
@@ -35,6 +36,7 @@ const ButtonContainer = (props) => {
isDefaultSettings,
isSMTPInitialSettings,
setSMTPErrors,
+ currentDeviceType,
} = props;
const [buttonOperation, setButtonOperation] = useState({
@@ -179,35 +181,41 @@ const ButtonContainer = (props) => {
setButtonOperation({ ...buttonOperation, reset: false });
};
+ const buttonSize =
+ currentDeviceType === DeviceType.desktop ? "small" : "normal";
+
return (
);
};
-export default inject(({ setup }) => {
+export default inject(({ auth, setup }) => {
const {
integration,
setSMTPSettingsLoading,
@@ -218,6 +226,9 @@ export default inject(({ setup }) => {
} = setup;
const { smtpSettings } = integration;
const { settings, isLoading, isDefaultSettings } = smtpSettings;
+
+ const { currentDeviceType } = auth.settingsStore;
+
return {
isSMTPInitialSettings,
isDefaultSettings,
@@ -227,5 +238,6 @@ export default inject(({ setup }) => {
resetSMTPSettings,
isLoading,
setSMTPErrors,
+ currentDeviceType,
};
})(observer(ButtonContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/ProviderMetadata.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/ProviderMetadata.js
index bf179fc083..52f3934843 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/ProviderMetadata.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/ProviderMetadata.js
@@ -7,11 +7,7 @@ import { useTranslation } from "react-i18next";
import Text from "@docspace/components/text";
import Button from "@docspace/components/button";
-import {
- smallTablet,
- hugeMobile,
- size,
-} from "@docspace/components/utils/device";
+import { mobile, size } from "@docspace/components/utils/device";
import MetadataUrlField from "./sub-components/MetadataUrlField";
import { useIsMobileView } from "../../../utils/useIsMobileView";
@@ -21,7 +17,7 @@ const StyledWrapper = styled.div`
margin-top: 24px;
}
- @media ${smallTablet} {
+ @media ${mobile} {
.button-wrapper {
box-sizing: border-box;
position: absolute;
@@ -39,7 +35,7 @@ const StyledWrapper = styled.div`
}
}
- @media ${hugeMobile}{
+ @media ${mobile}{
.button-wrapper {
padding: 16px;
}
@@ -64,7 +60,7 @@ const ProviderMetadata = (props) => {
}, []);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("sp-metadata") &&
navigate("/portal-settings/integration/single-sign-on");
};
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SPSettings.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SPSettings.js
index 4f02bb80c1..496c872246 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SPSettings.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SPSettings.js
@@ -20,7 +20,7 @@ const SPSettings = () => {
}, []);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("sp-settings") &&
navigate("/portal-settings/integration/single-sign-on");
};
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js
index 625c3d96ff..d5d5fd99cb 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js
@@ -1,5 +1,4 @@
import React from "react";
-import styled from "styled-components";
import { inject, observer } from "mobx-react";
import { useTranslation } from "react-i18next";
@@ -7,16 +6,6 @@ import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
import ResetConfirmationModal from "./sub-components/ResetConfirmationModal";
-const StyledWrapper = styled.div`
- display: flex;
- flex-direction: row;
- align-items: center;
-
- .save-button {
- margin-right: 8px;
- }
-`;
-
const SubmitResetButtons = (props) => {
const { t } = useTranslation(["SingleSignOn", "Settings", "Common"]);
const {
@@ -32,16 +21,16 @@ const SubmitResetButtons = (props) => {
} = props;
return (
-
+ <>
saveSsoSettings(t)}
onCancelClick={isSsoEnabled ? openResetModal : resetForm}
showReminder={true}
saveButtonLabel={t("Common:SaveButton")}
- cancelButtonLabel={t("Settings:RestoreDefaultButton")}
+ cancelButtonLabel={t("Common:Restore")}
displaySettings={true}
- hasScroll={false}
+ hasScroll={true}
isSaving={isSubmitLoading}
saveButtonDisabled={hasErrors || !hasChanges || isLoadingXml}
cancelEnable={!(isSubmitLoading || isLoadingXml)}
@@ -49,7 +38,7 @@ const SubmitResetButtons = (props) => {
additionalClassCancelButton="restore-button"
/>
{confirmationResetModal && }
-
+ >
);
};
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledInputWrapper.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledInputWrapper.js
index c0604a6004..ce8d2e98aa 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledInputWrapper.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledInputWrapper.js
@@ -1,11 +1,11 @@
import styled from "styled-components";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledInputWrapper = styled.div`
width: 100%;
max-width: ${(props) => props.maxWidth || "520px"};
- @media ${smallTablet} {
+ @media ${mobile} {
max-width: 100%;
}
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledModalDialog.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledModalDialog.js
index dc11acb10d..0980462ead 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledModalDialog.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledModalDialog.js
@@ -1,7 +1,7 @@
import styled from "styled-components";
import ModalDialog from "@docspace/components/modal-dialog";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledModalDialog = styled(ModalDialog)`
.heading {
@@ -22,7 +22,7 @@ const StyledModalDialog = styled(ModalDialog)`
margin-bottom: 5px;
}
- @media ${smallTablet} {
+ @media ${mobile} {
width: 100% !important;
}
}
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/MetadataUrlField.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/MetadataUrlField.js
index cf30c293cd..52b0fcc8b9 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/MetadataUrlField.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/MetadataUrlField.js
@@ -8,7 +8,7 @@ import copy from "copy-to-clipboard";
import { Text, HelpButton, InputBlock } from "@docspace/components";
import toastr from "@docspace/components/toast/toastr";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledWrapper = styled.div`
display: flex;
@@ -21,7 +21,7 @@ const StyledWrapper = styled.div`
width: 100%;
}
- @media ${smallTablet} {
+ @media ${mobile} {
max-width: 100%;
}
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/UploadXML.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/UploadXML.js
index b52b89c645..ff6f64dd17 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/UploadXML.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/UploadXML.js
@@ -12,7 +12,7 @@ import Text from "@docspace/components/text";
import SsoTextInput from "./SsoTextInput";
import FileInput from "@docspace/components/file-input";
import { Base } from "@docspace/components/themes";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledWrapper = styled.div`
display: flex;
@@ -25,7 +25,7 @@ const StyledWrapper = styled.div`
flex-direction: row;
gap: 9px;
- @media ${smallTablet} {
+ @media ${mobile} {
width: 100%;
.upload-xml-input {
@@ -45,7 +45,7 @@ const StyledWrapper = styled.div`
position: static;
}
- @media ${smallTablet} {
+ @media ${mobile} {
width: 100%;
button {
@@ -60,7 +60,7 @@ const StyledWrapper = styled.div`
overflow: inherit;
}
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
gap: 8px;
}
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/index.js b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/index.js
index b07d85443d..596ef571bf 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/index.js
@@ -15,11 +15,7 @@ import Link from "@docspace/components/link";
import Badge from "@docspace/components/badge";
import toastr from "@docspace/components/toast/toastr";
import Button from "@docspace/components/button";
-import {
- mobile,
- smallTablet,
- isSmallTablet,
-} from "@docspace/components/utils/device";
+import { mobile, isMobile } from "@docspace/components/utils/device";
import ConsumerItem from "./sub-components/consumerItem";
import ConsumerModalDialog from "./sub-components/consumerModalDialog";
@@ -38,10 +34,6 @@ const RootContainer = styled(Box)`
cursor: auto;
}
- @media ${mobile} {
- width: calc(100% - 8px);
- }
-
.consumers-list-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(293px, 1fr));
@@ -64,7 +56,7 @@ const RootContainer = styled(Box)`
gap: 24px;
align-items: center;
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
align-items: baseline;
}
@@ -221,7 +213,7 @@ class ThirdPartyServices extends React.Component {
size="normal"
minwidth="138px"
onClick={submitRequest}
- scale={isSmallTablet()}
+ scale={isMobile()}
/>
{!consumers.length ? (
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/consumerModalDialog.js b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/consumerModalDialog.js
index 73ef6816ae..d80deb651e 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/consumerModalDialog.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/consumerModalDialog.js
@@ -12,12 +12,12 @@ import Link from "@docspace/components/link";
import toastr from "@docspace/components/toast/toastr";
import ModalDialogContainer from "./modalDialogContainer";
import { showLoader, hideLoader } from "@docspace/common/utils";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
import styled from "styled-components";
const StyledBox = styled(Box)`
padding: 20px 0 8px;
- @media ${hugeMobile} {
+ @media ${mobile} {
padding-top: 0;
}
`;
@@ -189,13 +189,8 @@ class ConsumerModalDialog extends React.Component {
);
render() {
- const {
- selectedConsumer,
- onModalClose,
- dialogVisible,
- isLoading,
- t,
- } = this.props;
+ const { selectedConsumer, onModalClose, dialogVisible, isLoading, t } =
+ this.props;
const {
state,
onChangeHandler,
@@ -210,6 +205,7 @@ class ConsumerModalDialog extends React.Component {
visible={dialogVisible}
onClose={onModalClose}
displayType="aside"
+ withBodyScroll
>
{selectedConsumer.title}
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/thirdPartyLoader.js b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/thirdPartyLoader.js
index 88683b9040..4d739ae8fd 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/thirdPartyLoader.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/ThirdPartyServicesSettings/sub-components/thirdPartyLoader.js
@@ -15,8 +15,12 @@ const ThirdPartyLoader = () => {
return (
- {rectangles.map((_) => (
-
+ {rectangles.map((_, index) => (
+
))}
);
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/index.js b/packages/client/src/pages/PortalSettings/categories/integration/index.js
index 65ae9d2ddf..ee9baa70e7 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/index.js
@@ -11,10 +11,17 @@ import ThirdParty from "./ThirdPartyServicesSettings";
import SMTPSettings from "./SMTPSettings";
import DocumentService from "./DocumentService";
+import { DeviceType } from "@docspace/common/constants";
const IntegrationWrapper = (props) => {
- const { t, tReady, enablePlugins, toDefault, isSSOAvailable, standalone } =
- props;
+ const {
+ t,
+ tReady,
+ currentDeviceType,
+ toDefault,
+ isSSOAvailable,
+ standalone,
+ } = props;
const navigate = useNavigate();
useEffect(() => {
@@ -71,20 +78,33 @@ const IntegrationWrapper = (props) => {
);
};
- return ;
+ return (
+
+ );
};
export default inject(({ auth, ssoStore }) => {
const { standalone } = auth.settingsStore;
const { load: toDefault } = ssoStore;
- const { enablePlugins } = auth.settingsStore;
+ const { currentDeviceType } = auth.settingsStore;
const { isSSOAvailable } = auth.currentQuotaStore;
return {
- enablePlugins,
toDefault,
isSSOAvailable,
standalone,
+ currentDeviceType,
};
})(
withTranslation(["Settings", "SingleSignOn", "Translations"])(
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/BenefitsContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/BenefitsContainer.js
index 5cdee0efea..b45f1b789e 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/BenefitsContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/BenefitsContainer.js
@@ -2,7 +2,6 @@ import React from "react";
import styled from "styled-components";
import Text from "@docspace/components/text";
import { inject, observer } from "mobx-react";
-import { smallTablet } from "@docspace/components/utils/device";
const StyledBody = styled.div`
border-radius: 12px;
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
index fe23884dd6..90311ec78b 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
@@ -5,7 +5,7 @@ import { Trans } from "react-i18next";
import { inject, observer } from "mobx-react";
import Text from "@docspace/components/text";
-import { size, desktop } from "@docspace/components/utils/device";
+import { size, desktop, mobile } from "@docspace/components/utils/device";
import { Consumer } from "@docspace/components/utils/context";
import { HelpButton } from "@docspace/components";
@@ -30,10 +30,10 @@ const StyledBody = styled.div`
grid-gap: 20px;
margin-bottom: 20px;
- @media (max-width: ${size.smallTablet + 40}px) {
+ @media ${mobile} {
grid-template-columns: 1fr;
- grid-template-rows: ${(props) => "1fr max-content"};
+ grid-template-rows: 1fr max-content;
.price-calculation-container,
.benefits-container {
@@ -48,7 +48,7 @@ const StyledBody = styled.div`
props.isChangeView &&
css`
grid-template-columns: 1fr;
- grid-template-rows: ${(props) => "1fr max-content"};
+ grid-template-rows: 1fr max-content;
.price-calculation-container,
.benefits-container {
@@ -94,7 +94,6 @@ const PaymentContainer = (props) => {
theme,
isNotPaidPeriod,
payerEmail,
- user,
isPaidPeriod,
currencySymbol,
startValue,
@@ -281,9 +280,7 @@ const PaymentContainer = (props) => {
{(context) => (
{isNotPaidPeriod
? expiredTitleSubscriptionWarning()
@@ -369,8 +366,6 @@ export default inject(({ auth, payments }) => {
const { isAlreadyPaid } = payments;
- const { user } = userStore;
-
return {
paymentDate,
isAlreadyPaid,
@@ -388,7 +383,7 @@ export default inject(({ auth, payments }) => {
startValue: planCost.value,
isNotPaidPeriod,
payerEmail: customerId,
- user,
+
isPaidPeriod,
currentTariffPlanTitle,
portalTariffStatus,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
index 0738b65e17..072e0799e8 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
@@ -3,13 +3,13 @@ import styled, { css } from "styled-components";
import { Trans } from "react-i18next";
import Text from "@docspace/components/text";
import { inject, observer } from "mobx-react";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
const StyledBody = styled.div`
max-width: 272px;
margin: 0 auto;
- @media ${smallTablet} {
+ @media ${mobile} {
max-width: 520px;
}
@@ -34,7 +34,7 @@ const StyledBody = styled.div`
.payment_price_month-text {
margin: auto 0;
margin-bottom: 9px;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 8px;
@@ -45,7 +45,7 @@ const StyledBody = styled.div`
}
.payment_price_month-text,
.payment_price_price-text {
- ${props =>
+ ${(props) =>
props.isDisabled &&
css`
color: ${props.theme.client.settings.payment.priceContainer
@@ -77,7 +77,8 @@ const TotalTariffContainer = ({
fontSize={"14"}
textAlign="center"
fontWeight={600}
- className="total-tariff_description">
+ className="total-tariff_description"
+ >
{{ peopleNumber: maxAvailableManagersCount }}
@@ -92,7 +93,8 @@ const TotalTariffContainer = ({
textAlign={"center"}
fontWeight={600}
className="payment_price_price-text"
- noSelect>
+ noSelect
+ >
{{ currencySymbol }}
+ noSelect
+ >
{{ price: totalPrice }}
+ noSelect
+ >
/month
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/StyledComponent.js b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/StyledComponent.js
index 3a5c286de8..c33030fd8a 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/StyledComponent.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/StyledComponent.js
@@ -1,6 +1,6 @@
import styled from "styled-components";
-import { tablet, hugeMobile } from "@docspace/components/utils/device";
+import { tablet, mobile } from "@docspace/components/utils/device";
const StyledComponent = styled.div`
.payments_file-input {
@@ -19,7 +19,7 @@ const StyledButtonComponent = styled.div`
height: 40px;
}
- @media ${hugeMobile} {
+ @media ${mobile} {
width: 100%;
}
}
@@ -31,7 +31,7 @@ const StyledContactComponent = styled.div`
display: flex;
width: 100%;
p {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 4px;
@@ -70,9 +70,9 @@ const StyledTitleComponent = styled.div`
align-items: baseline;
.title {
line-height: 16px;
- ${props => props.limitedWidth && "max-width: 376px"};
+ ${(props) => props.limitedWidth && "max-width: 376px"};
span:first-child {
- ${props => props.isLicenseDateExpired && "margin-top: 5px"};
+ ${(props) => props.isLicenseDateExpired && "margin-top: 5px"};
}
}
}
@@ -80,12 +80,12 @@ const StyledTitleComponent = styled.div`
.payments_subscription-expired {
max-width: fit-content;
border: 1px solid
- ${props =>
+ ${(props) =>
props.theme.client.settings.payment[
props.isLicenseDateExpired ? "warningColor" : "color"
]};
border-radius: 3px;
- color: ${props =>
+ color: ${(props) =>
props.theme.client.settings.payment[
props.isLicenseDateExpired ? "warningColor" : "color"
]};
@@ -97,12 +97,12 @@ const StyledTitleComponent = styled.div`
const StyledBenefitsBody = styled.div`
margin: 20px 0;
border-radius: 12px;
- border: ${props => props.theme.client.settings.payment.border};
+ border: ${(props) => props.theme.client.settings.payment.border};
max-width: 660px;
padding: 23px;
- background: ${props =>
+ background: ${(props) =>
props.theme.client.settings.payment.backgroundBenefitsColor};
.benefits-title {
diff --git a/packages/client/src/pages/PortalSettings/categories/security/StyledSecurity.js b/packages/client/src/pages/PortalSettings/categories/security/StyledSecurity.js
index 5782894a5f..afbf9b4cb9 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/StyledSecurity.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/StyledSecurity.js
@@ -2,7 +2,7 @@ import styled from "styled-components";
import ArrowRightIcon from "PUBLIC_DIR/images/arrow.right.react.svg";
import commonIconsStyles from "@docspace/components/utils/common-icons-style";
import { Base } from "@docspace/components/themes";
-import { mobile, smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
export const StyledArrowRightIcon = styled(ArrowRightIcon)`
${commonIconsStyles}
@@ -84,7 +84,7 @@ export const LearnMoreWrapper = styled.div`
color: ${(props) => props.theme.client.settings.common.descriptionColor};
}
- @media (max-width: 600px) {
+ @media ${mobile} {
display: flex;
flex-direction: column;
margin-bottom: 20px;
@@ -149,7 +149,7 @@ export const StyledBruteForceProtection = styled.div`
text-decoration: underline;
}
- @media (max-width: 600px) {
+ @media ${mobile} {
padding-bottom: 20px;
}
}
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/adminMessage.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/adminMessage.js
index 82ab18c787..663fd752a2 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/adminMessage.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/adminMessage.js
@@ -12,8 +12,9 @@ import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
import isEqual from "lodash/isEqual";
-import { isMobile } from "react-device-detect";
+
import AdmMsgLoader from "../sub-components/loaders/admmsg-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -37,6 +38,7 @@ const AdminMessage = (props) => {
isInit,
currentColorScheme,
administratorMessageSettingsUrl,
+ currentDeviceType,
} = props;
const [type, setType] = useState("");
const [showReminder, setShowReminder] = useState(false);
@@ -91,7 +93,7 @@ const AdminMessage = (props) => {
}, [type]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("admin-message") &&
navigate("/portal-settings/security/access-portal");
};
@@ -118,7 +120,7 @@ const AdminMessage = (props) => {
setShowReminder(false);
};
- if (isMobile && !isInit && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isInit && !isLoading) {
return ;
}
@@ -187,6 +189,7 @@ export default inject(({ auth, setup }) => {
setMessageSettings,
currentColorScheme,
administratorMessageSettingsUrl,
+ currentDeviceType,
} = auth.settingsStore;
const { initSettings, isInit } = setup;
@@ -197,5 +200,6 @@ export default inject(({ auth, setup }) => {
isInit,
currentColorScheme,
administratorMessageSettingsUrl,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(AdminMessage)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/bruteForceProtection.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/bruteForceProtection.js
index f4190de78a..2c8853cc58 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/bruteForceProtection.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/bruteForceProtection.js
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
-import { isMobile } from "react-device-detect";
+
import { withTranslation } from "react-i18next";
import { inject, observer } from "mobx-react";
import { StyledBruteForceProtection } from "../StyledSecurity";
@@ -14,6 +14,7 @@ import { useNavigate, useLocation } from "react-router-dom";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import BruteForceProtectionLoader from "../sub-components/loaders/brute-force-protection-loader";
import Link from "@docspace/components/link";
+import { DeviceType } from "@docspace/common/constants";
const BruteForceProtection = (props) => {
const {
@@ -26,6 +27,7 @@ const BruteForceProtection = (props) => {
initSettings,
isInit,
bruteForceProtectionUrl,
+ currentDeviceType,
} = props;
const defaultNumberAttempt = numberAttempt?.toString();
@@ -117,7 +119,7 @@ const BruteForceProtection = (props) => {
]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("brute-force-protection") &&
navigate("/portal-settings/security/access-portal");
};
@@ -228,7 +230,8 @@ const BruteForceProtection = (props) => {
{t("ErrorMessageBruteForceProtection")}
);
- if (isMobile && !isGetSettingsLoaded) return ;
+ if (currentDeviceType !== DeviceType.desktop && !isGetSettingsLoaded)
+ return ;
return (
@@ -326,6 +329,7 @@ export default inject(({ auth, setup }) => {
setBruteForceProtection,
getBruteForceProtection,
bruteForceProtectionUrl,
+ currentDeviceType,
} = auth.settingsStore;
const { initSettings, isInit } = setup;
@@ -339,5 +343,6 @@ export default inject(({ auth, setup }) => {
initSettings,
isInit,
bruteForceProtectionUrl,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(BruteForceProtection)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/index.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/index.js
index 14838dac97..67eb6ae19d 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/index.js
@@ -37,7 +37,7 @@ const AccessPortal = (props) => {
}, []);
const checkWidth = () => {
- window.innerWidth <= size.smallTablet
+ window.innerWidth <= size.mobile
? setIsMobileView(true)
: setIsMobileView(false);
};
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/ipSecurity.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/ipSecurity.js
index ac5f786602..728202a96e 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/ipSecurity.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/ipSecurity.js
@@ -13,8 +13,9 @@ import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import isEqual from "lodash/isEqual";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
-import { isMobile } from "react-device-detect";
+
import IpSecurityLoader from "../sub-components/loaders/ip-security-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -55,6 +56,7 @@ const IpSecurity = (props) => {
isInit,
ipSettingsUrl,
currentColorScheme,
+ currentDeviceType,
} = props;
const navigate = useNavigate();
@@ -118,7 +120,7 @@ const IpSecurity = (props) => {
}, [enable, ips]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("ip") &&
navigate("/portal-settings/security/access-portal");
};
@@ -163,7 +165,7 @@ const IpSecurity = (props) => {
saveToSessionStorage("defaultIPSettings", {
enable: enable,
- ips: ipsObjectArr,
+ ips: ips,
});
setShowReminder(false);
toastr.success(t("SuccessfullySaveSettingsMessage"));
@@ -181,7 +183,7 @@ const IpSecurity = (props) => {
setShowReminder(false);
};
- if (isMobile && !isInit && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isInit && !isLoading) {
return ;
}
@@ -280,6 +282,7 @@ export default inject(({ auth, setup }) => {
setIpRestrictions,
ipSettingsUrl,
currentColorScheme,
+ currentDeviceType,
} = auth.settingsStore;
const { initSettings, isInit } = setup;
@@ -293,5 +296,6 @@ export default inject(({ auth, setup }) => {
isInit,
ipSettingsUrl,
currentColorScheme,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(IpSecurity)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/passwordStrength.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/passwordStrength.js
index 342142153d..48064ce303 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/passwordStrength.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/passwordStrength.js
@@ -14,8 +14,9 @@ import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import isEqual from "lodash/isEqual";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
-import { isMobile } from "react-device-detect";
+
import PasswordLoader from "../sub-components/loaders/password-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -23,7 +24,7 @@ const MainContainer = styled.div`
.password-slider {
width: 160px;
height: 8px;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin: 24px 0px 24px 16px;
@@ -44,7 +45,7 @@ const MainContainer = styled.div`
}
`;
-const PasswordStrength = props => {
+const PasswordStrength = (props) => {
const {
t,
@@ -54,6 +55,7 @@ const PasswordStrength = props => {
isInit,
currentColorScheme,
passwordStrengthSettingsUrl,
+ currentDeviceType,
} = props;
const navigate = useNavigate();
@@ -128,16 +130,16 @@ const PasswordStrength = props => {
}, [passwordLen, useUpperCase, useDigits, useSpecialSymbols]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("password") &&
navigate("/portal-settings/security/access-portal");
};
- const onSliderChange = e => {
+ const onSliderChange = (e) => {
setPasswordLen(Number(e.target.value));
};
- const onClickCheckbox = e => {
+ const onClickCheckbox = (e) => {
switch (e.target.value) {
case "upperCase":
setUseUpperCase(e.target.checked);
@@ -188,7 +190,7 @@ const PasswordStrength = props => {
setShowReminder(false);
};
- if (isMobile && !isInit && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isInit && !isLoading) {
return ;
}
@@ -206,7 +208,8 @@ const PasswordStrength = props => {
color={currentColorScheme.main.accent}
target="_blank"
isHovered
- href={passwordStrengthSettingsUrl}>
+ href={passwordStrengthSettingsUrl}
+ >
{t("Common:LearnMore")}
@@ -276,6 +279,7 @@ export default inject(({ auth, setup }) => {
passwordSettings,
currentColorScheme,
passwordStrengthSettingsUrl,
+ currentDeviceType,
} = auth.settingsStore;
const { initSettings, isInit } = setup;
@@ -286,5 +290,6 @@ export default inject(({ auth, setup }) => {
isInit,
currentColorScheme,
passwordStrengthSettingsUrl,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(PasswordStrength)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/sessionLifetime.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/sessionLifetime.js
index 60c1d8a24c..98b0528267 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/sessionLifetime.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/sessionLifetime.js
@@ -13,8 +13,9 @@ import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
import isEqual from "lodash/isEqual";
-import { isMobile } from "react-device-detect";
+
import SessionLifetimeLoader from "../sub-components/loaders/session-lifetime-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -45,6 +46,7 @@ const SessionLifetime = (props) => {
isInit,
lifetimeSettingsUrl,
currentColorScheme,
+ currentDeviceType,
} = props;
const [type, setType] = useState(false);
const [sessionLifetime, setSessionLifetime] = useState("1440");
@@ -120,7 +122,7 @@ const SessionLifetime = (props) => {
}, [type, sessionLifetime]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("lifetime") &&
navigate("/portal-settings/security/access-portal");
};
@@ -185,7 +187,7 @@ const SessionLifetime = (props) => {
setShowReminder(false);
};
- if (isMobile && !isInit && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isInit && !isLoading) {
return ;
}
@@ -271,6 +273,7 @@ export default inject(({ auth, setup }) => {
setSessionLifetimeSettings,
lifetimeSettingsUrl,
currentColorScheme,
+ currentDeviceType,
} = auth.settingsStore;
const { initSettings, isInit } = setup;
@@ -282,5 +285,6 @@ export default inject(({ auth, setup }) => {
isInit,
lifetimeSettingsUrl,
currentColorScheme,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(SessionLifetime)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/tfa.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/tfa.js
index 122f5975e2..cdb1127435 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/tfa.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/tfa.js
@@ -11,8 +11,9 @@ import { LearnMoreWrapper } from "../StyledSecurity";
import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
-import { isMobile } from "react-device-detect";
+
import TfaLoader from "../sub-components/loaders/tfa-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -30,6 +31,7 @@ const TwoFactorAuth = (props) => {
setIsInit,
currentColorScheme,
tfaSettingsUrl,
+ currentDeviceType,
} = props;
const [type, setType] = useState("none");
@@ -87,7 +89,7 @@ const TwoFactorAuth = (props) => {
}, [type]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("tfa") &&
navigate("/portal-settings/security/access-portal");
};
@@ -126,7 +128,7 @@ const TwoFactorAuth = (props) => {
setShowReminder(false);
};
- if (isMobile && !isInit && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isInit && !isLoading) {
return ;
}
@@ -209,7 +211,8 @@ export default inject(({ auth, setup }) => {
} = auth.tfaStore;
const { isInit, initSettings, setIsInit } = setup;
- const { currentColorScheme, tfaSettingsUrl } = auth.settingsStore;
+ const { currentColorScheme, tfaSettingsUrl, currentDeviceType } =
+ auth.settingsStore;
return {
setTfaSettings,
@@ -222,5 +225,6 @@ export default inject(({ auth, setup }) => {
setIsInit,
currentColorScheme,
tfaSettingsUrl,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(TwoFactorAuth)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/access-portal/trustedMail.js b/packages/client/src/pages/PortalSettings/categories/security/access-portal/trustedMail.js
index 63ca27174a..371322434d 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/access-portal/trustedMail.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/access-portal/trustedMail.js
@@ -13,8 +13,9 @@ import { size } from "@docspace/components/utils/device";
import { saveToSessionStorage, getFromSessionStorage } from "../../../utils";
import isEqual from "lodash/isEqual";
import SaveCancelButtons from "@docspace/components/save-cancel-buttons";
-import { isMobile } from "react-device-detect";
+
import TrustedMailLoader from "../sub-components/loaders/trusted-mail-loader";
+import { DeviceType } from "@docspace/common/constants";
const MainContainer = styled.div`
width: 100%;
@@ -37,6 +38,7 @@ const TrustedMail = (props) => {
setMailDomainSettings,
currentColorScheme,
trustedMailDomainSettingsUrl,
+ currentDeviceType,
} = props;
const navigate = useNavigate();
@@ -93,7 +95,7 @@ const TrustedMail = (props) => {
}, [type, domains]);
const checkWidth = () => {
- window.innerWidth > size.smallTablet &&
+ window.innerWidth > size.mobile &&
location.pathname.includes("trusted-mail") &&
navigate("/portal-settings/security/access-portal");
};
@@ -156,7 +158,7 @@ const TrustedMail = (props) => {
setShowReminder(false);
};
- if (isMobile && !isLoading) {
+ if (currentDeviceType !== DeviceType.desktop && !isLoading) {
return ;
}
@@ -246,6 +248,7 @@ export default inject(({ auth }) => {
helpLink,
currentColorScheme,
trustedMailDomainSettingsUrl,
+ currentDeviceType,
} = auth.settingsStore;
return {
@@ -255,5 +258,6 @@ export default inject(({ auth }) => {
helpLink,
currentColorScheme,
trustedMailDomainSettingsUrl,
+ currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(TrustedMail)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditContent.js b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditContent.js
index f9587411e4..884d41f580 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditContent.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditContent.js
@@ -1,8 +1,11 @@
-import RowContent from "@docspace/components/row-content";
import React from "react";
-import Text from "@docspace/components/text";
-import moment from "moment";
+import { inject, observer } from "mobx-react";
import styled from "styled-components";
+
+import Text from "@docspace/components/text";
+import RowContent from "@docspace/components/row-content";
+import { convertTime } from "@docspace/common/utils/convertTime";
+
import { UnavailableStyles } from "../../../../utils/commonSettingsStyles";
const StyledRowContent = styled(RowContent)`
@@ -15,18 +18,16 @@ const StyledRowContent = styled(RowContent)`
${(props) => props.isSettingNotPaid && UnavailableStyles}
`;
-export const AuditContent = ({ sectionWidth, item, isSettingNotPaid }) => {
- const DATE_FORMAT = "YYYY-MM-DD LT";
- const to = moment(item.date).local();
-
- const dateStr = to.format(DATE_FORMAT);
+const AuditContent = ({ sectionWidth, item, isSettingNotPaid, locale }) => {
+ const dateStr = convertTime(item.date, locale);
return (
+ isSettingNotPaid={isSettingNotPaid}
+ >
{item.user}
@@ -38,16 +39,28 @@ export const AuditContent = ({ sectionWidth, item, isSettingNotPaid }) => {
fontSize="12px"
fontWeight={600}
truncate={true}
- className="settings_unavailable">
+ className="settings_unavailable"
+ >
{dateStr}
+ className="settings_unavailable"
+ >
{`${item.context ? item.context + " |" : ""} ${item.action}`}
);
};
+
+export default inject(({ auth }) => {
+ const { culture } = auth.settingsStore;
+ const { user } = auth.userStore;
+ const locale = (user && user.cultureName) || culture || "en";
+
+ return {
+ locale,
+ };
+})(observer(AuditContent));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditRowContainer.js b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditRowContainer.js
index ab61f83633..d0afe1ba3d 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditRowContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditRowContainer.js
@@ -1,8 +1,9 @@
import React, { useEffect } from "react";
import { inject, observer } from "mobx-react";
import RowContainer from "@docspace/components/row-container";
-import { isMobile } from "react-device-detect";
+
import { AuditUserRow } from "./AuditUserRow";
+import { DeviceType } from "@docspace/common/constants";
const AuditRowContainer = ({
viewAs,
@@ -11,11 +12,12 @@ const AuditRowContainer = ({
theme,
sectionWidth,
isAuditAvailable,
+ currentDeviceType,
}) => {
useEffect(() => {
if (viewAs !== "table" && viewAs !== "row") return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || currentDeviceType !== DeviceType.desktop) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
@@ -39,12 +41,13 @@ const AuditRowContainer = ({
export default inject(({ setup, auth }) => {
const { viewAs, setViewAs, security } = setup;
- const { theme } = auth.settingsStore;
+ const { theme, currentDeviceType } = auth.settingsStore;
return {
viewAs,
setViewAs,
auditTrailUsers: security.auditTrail.users,
theme,
+ currentDeviceType,
};
})(observer(AuditRowContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditUserRow.js b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditUserRow.js
index 7b13471a99..0029b13307 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditUserRow.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/RowView/AuditUserRow.js
@@ -1,6 +1,6 @@
import React from "react";
import Row from "@docspace/components/row";
-import { AuditContent } from "./AuditContent";
+import AuditContent from "./AuditContent";
export const AuditUserRow = ({ item, sectionWidth, isSettingNotPaid }) => {
return (
diff --git a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableContainer.js b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableContainer.js
index 6cff96a4c2..ea36733c97 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableContainer.js
@@ -4,7 +4,7 @@ import { inject, observer } from "mobx-react";
import TableRow from "./TableRow";
import TableHeader from "./TableHeader";
import TableBody from "@docspace/components/table-container/TableBody";
-import { isMobile } from "react-device-detect";
+import { DeviceType } from "@docspace/common/constants";
const Table = ({
auditTrailUsers,
@@ -13,11 +13,12 @@ const Table = ({
setViewAs,
theme,
isSettingNotPaid,
+ currentDeviceType,
}) => {
const ref = useRef(null);
useEffect(() => {
if (!sectionWidth) return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || currentDeviceType !== DeviceType.desktop) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
@@ -45,12 +46,13 @@ const Table = ({
export default inject(({ auth, setup }) => {
const { security, viewAs, setViewAs } = setup;
- const { theme } = auth.settingsStore;
+ const { theme, currentDeviceType } = auth.settingsStore;
return {
auditTrailUsers: security.auditTrail.users,
theme,
viewAs,
setViewAs,
+ currentDeviceType,
};
})(observer(Table));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableRow.js b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableRow.js
index 34b10dfebb..86eea86a59 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableRow.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/audit-trail/TableView/TableRow.js
@@ -1,9 +1,12 @@
import React from "react";
+import { inject, observer } from "mobx-react";
+import styled from "styled-components";
+
import TableRow from "@docspace/components/table-container/TableRow";
import TableCell from "@docspace/components/table-container/TableCell";
import Text from "@docspace/components/text";
-import styled from "styled-components";
-import moment from "moment";
+import { convertTime } from "@docspace/common/utils/convertTime";
+
import { UnavailableStyles } from "../../../../utils/commonSettingsStyles";
const StyledPeopleRow = styled(TableRow)`
@@ -33,13 +36,9 @@ const StyledPeopleRow = styled(TableRow)`
`;
const PeopleTableRow = (props) => {
- const { item, contextOptionsProps, isSettingNotPaid } = props;
+ const { item, contextOptionsProps, isSettingNotPaid, locale } = props;
const { email, position } = item;
-
- const DATE_FORMAT = "YYYY-MM-DD LT";
- const to = moment(item.date).local();
-
- const dateStr = to.format(DATE_FORMAT);
+ const dateStr = convertTime(item.date, locale);
return (
{
);
};
-export default PeopleTableRow;
+export default inject(({ auth }) => {
+ const { culture } = auth.settingsStore;
+ const { user } = auth.userStore;
+ const locale = (user && user.cultureName) || culture || "en";
+
+ return {
+ locale,
+ };
+})(observer(PeopleTableRow));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/index.js b/packages/client/src/pages/PortalSettings/categories/security/index.js
index 50300a9a6d..2bb56c5d1c 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/index.js
@@ -13,11 +13,10 @@ import MobileSecurityLoader from "./sub-components/loaders/mobile-security-loade
import AccessLoader from "./sub-components/loaders/access-loader";
import AuditTrail from "./audit-trail/index.js";
import { resetSessionStorage } from "../../utils";
-
-import { isMobile } from "react-device-detect";
+import { DeviceType } from "@docspace/common/constants/index.js";
const SecurityWrapper = (props) => {
- const { t, loadBaseInfo, resetIsInit } = props;
+ const { t, loadBaseInfo, resetIsInit, currentDeviceType } = props;
const [currentTab, setCurrentTab] = useState(0);
const [isLoading, setIsLoading] = useState(false);
const navigate = useNavigate();
@@ -72,7 +71,7 @@ const SecurityWrapper = (props) => {
if (!isLoading)
return currentTab === 0 ? (
- isMobile ? (
+ currentDeviceType !== DeviceType.desktop ? (
) : (
@@ -85,11 +84,18 @@ const SecurityWrapper = (props) => {
data={data}
startSelect={currentTab}
onSelect={(e) => onSelect(e)}
+ topProps={
+ currentDeviceType === DeviceType.desktop
+ ? 0
+ : currentDeviceType === DeviceType.mobile
+ ? "53px"
+ : "61px"
+ }
/>
);
};
-export default inject(({ setup }) => {
+export default inject(({ auth, setup }) => {
const { initSettings, resetIsInit } = setup;
return {
@@ -97,5 +103,6 @@ export default inject(({ setup }) => {
await initSettings();
},
resetIsInit,
+ currentDeviceType: auth.settingsStore.currentDeviceType,
};
})(withTranslation(["Settings", "Common"])(observer(SecurityWrapper)));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryContent.js b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryContent.js
index 368581466c..32ebfa29a2 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryContent.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryContent.js
@@ -1,9 +1,11 @@
-import RowContent from "@docspace/components/row-content";
import React from "react";
-import Text from "@docspace/components/text";
-import moment from "moment";
+import { inject, observer } from "mobx-react";
import styled from "styled-components";
+import Text from "@docspace/components/text";
+import RowContent from "@docspace/components/row-content";
+import { convertTime } from "@docspace/common/utils/convertTime";
+
const StyledRowContent = styled(RowContent)`
.row-main-container-wrapper {
display: flex;
@@ -13,11 +15,9 @@ const StyledRowContent = styled(RowContent)`
padding-bottom: 10px;
`;
-export const HistoryContent = ({ sectionWidth, item }) => {
- const DATE_FORMAT = "YYYY-MM-DD LT";
- const to = moment(item.date).local();
+const HistoryContent = ({ sectionWidth, item, locale }) => {
+ const dateStr = convertTime(item.date, locale);
- const dateStr = to.format(DATE_FORMAT);
return (
{
);
};
+
+export default inject(({ auth }) => {
+ const { culture } = auth.settingsStore;
+ const { user } = auth.userStore;
+ const locale = (user && user.cultureName) || culture || "en";
+
+ return {
+ locale,
+ };
+})(observer(HistoryContent));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryRowContainer.js b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryRowContainer.js
index b08da20f44..e56f1171b0 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryRowContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryRowContainer.js
@@ -1,8 +1,9 @@
import React, { useEffect } from "react";
import { inject, observer } from "mobx-react";
import RowContainer from "@docspace/components/row-container";
-import { isMobile } from "react-device-detect";
+
import { HistoryUserRow } from "./HistoryUserRow";
+import { DeviceType } from "@docspace/common/constants";
const HistoryRowContainer = ({
viewAs,
@@ -10,16 +11,17 @@ const HistoryRowContainer = ({
historyUsers,
theme,
sectionWidth,
+ currentDeviceType,
}) => {
useEffect(() => {
if (viewAs !== "table" && viewAs !== "row") return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || currentDeviceType !== DeviceType.desktop) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
}
- }, [sectionWidth]);
+ }, [sectionWidth, currentDeviceType]);
return (
@@ -37,12 +39,13 @@ const HistoryRowContainer = ({
export default inject(({ setup, auth }) => {
const { viewAs, setViewAs, security } = setup;
- const { theme } = auth.settingsStore;
+ const { theme, currentDeviceType } = auth.settingsStore;
return {
viewAs,
setViewAs,
historyUsers: security.loginHistory.users,
theme,
+ currentDeviceType,
};
})(observer(HistoryRowContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryUserRow.js b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryUserRow.js
index 4d1c953d2e..c418177766 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryUserRow.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/login-history/RowView/HistoryUserRow.js
@@ -1,6 +1,6 @@
import React from "react";
import Row from "@docspace/components/row";
-import { HistoryContent } from "./HistoryContent";
+import HistoryContent from "./HistoryContent";
export const HistoryUserRow = ({ item, sectionWidth }) => {
return (
diff --git a/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableContainer.js b/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableContainer.js
index 2644b86c00..8a398bb835 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableContainer.js
@@ -4,19 +4,27 @@ import { inject, observer } from "mobx-react";
import TableRow from "./TableRow";
import TableHeader from "./TableHeader";
import TableBody from "@docspace/components/table-container/TableBody";
-import { isMobile } from "react-device-detect";
-const Table = ({ historyUsers, sectionWidth, viewAs, setViewAs, theme }) => {
+import { DeviceType } from "@docspace/common/constants";
+
+const Table = ({
+ historyUsers,
+ sectionWidth,
+ viewAs,
+ setViewAs,
+ theme,
+ currentDeviceType,
+}) => {
const ref = useRef(null);
useEffect(() => {
if (!sectionWidth) return;
- if (sectionWidth < 1025 || isMobile) {
+ if (sectionWidth < 1025 || currentDeviceType !== DeviceType.desktop) {
viewAs !== "row" && setViewAs("row");
} else {
viewAs !== "table" && setViewAs("table");
}
- }, [sectionWidth]);
+ }, [sectionWidth, currentDeviceType]);
return historyUsers && historyUsers.length > 0 ? (
@@ -34,12 +42,13 @@ const Table = ({ historyUsers, sectionWidth, viewAs, setViewAs, theme }) => {
export default inject(({ auth, setup }) => {
const { security, viewAs, setViewAs } = setup;
- const { theme } = auth.settingsStore;
+ const { theme, currentDeviceType } = auth.settingsStore;
return {
historyUsers: security.loginHistory.users,
theme,
viewAs,
setViewAs,
+ currentDeviceType,
};
})(observer(Table));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableRow.js b/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableRow.js
index 55b0e72dbb..5b3d6e7684 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableRow.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/login-history/TableView/TableRow.js
@@ -1,9 +1,11 @@
import React from "react";
+import { inject, observer } from "mobx-react";
+import styled from "styled-components";
+
import TableRow from "@docspace/components/table-container/TableRow";
import TableCell from "@docspace/components/table-container/TableCell";
import Text from "@docspace/components/text";
-import styled from "styled-components";
-import moment from "moment";
+import { convertTime } from "@docspace/common/utils/convertTime";
const StyledPeopleRow = styled(TableRow)`
.table-container_cell {
@@ -31,13 +33,9 @@ const StyledPeopleRow = styled(TableRow)`
`;
const PeopleTableRow = (props) => {
- const { item, contextOptionsProps, onEmailClick } = props;
+ const { item, contextOptionsProps, onEmailClick, locale } = props;
const { email, position } = item;
-
- const DATE_FORMAT = "YYYY-MM-DD LT";
- const to = moment(item.date).local();
-
- const dateStr = to.format(DATE_FORMAT);
+ const dateStr = convertTime(item.date, locale);
return (
@@ -80,4 +78,12 @@ const PeopleTableRow = (props) => {
);
};
-export default PeopleTableRow;
+export default inject(({ auth }) => {
+ const { culture } = auth.settingsStore;
+ const { user } = auth.userStore;
+ const locale = (user && user.cultureName) || culture || "en";
+
+ return {
+ locale,
+ };
+})(observer(PeopleTableRow));
diff --git a/packages/client/src/pages/PortalSettings/categories/security/sub-components/HistoryMainContent.js b/packages/client/src/pages/PortalSettings/categories/security/sub-components/HistoryMainContent.js
index 6b3ffa94f8..c04fa722e0 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/sub-components/HistoryMainContent.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/sub-components/HistoryMainContent.js
@@ -7,7 +7,7 @@ import styled from "styled-components";
import Button from "@docspace/components/button";
import toastr from "@docspace/components/toast/toastr";
import { UnavailableStyles } from "../../../utils/commonSettingsStyles";
-import { hugeMobile, tablet } from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
import Badge from "@docspace/components/badge";
const StyledTextInput = styled(TextInput)`
@@ -15,7 +15,7 @@ const StyledTextInput = styled(TextInput)`
margin-bottom: 24px;
width: 350px;
- @media ${hugeMobile} {
+ @media ${mobile} {
width: 100%;
}
`;
@@ -38,6 +38,10 @@ const MainContainer = styled.div`
.save-cancel {
padding: 0;
position: static;
+
+ .buttons-flex {
+ padding: 0;
+ }
}
.login-subheader {
@@ -47,7 +51,7 @@ const MainContainer = styled.div`
.latest-text {
font-size: 13px;
- padding: 20px 0;
+ padding: 24px 0;
}
.storage-label {
@@ -90,7 +94,7 @@ const DownLoadWrapper = styled.div`
padding-bottom: 11px;
}
- @media ${hugeMobile} {
+ @media ${mobile} {
width: 100%;
}
}
@@ -109,7 +113,7 @@ const DownLoadWrapper = styled.div`
.downloadReportDescriptionColor};
}
- @media ${hugeMobile} {
+ @media ${mobile} {
flex-direction: column-reverse;
}
`;
diff --git a/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/access-loader.js b/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/access-loader.js
index 220644bbae..dadf6f95b1 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/access-loader.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/access-loader.js
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import Loaders from "@docspace/common/components/Loaders";
-import { tablet } from "@docspace/components/utils/device";
+import { tablet, mobile } from "@docspace/components/utils/device";
const StyledLoader = styled.div`
.header {
@@ -9,12 +9,12 @@ const StyledLoader = styled.div`
height: 29px;
margin-bottom: 14px;
- @media (${tablet}) {
+ @media ${tablet} {
width: 184px;
height: 37px;
}
- @media (max-width: 428px) {
+ @media ${mobile} {
width: 273px;
height: 37px;
margin-bottom: 18px;
@@ -34,13 +34,13 @@ const StyledLoader = styled.div`
gap: 20px;
margin-bottom: 40px;
- @media (max-width: 428px) {
+ @media ${mobile} {
width: 100%;
}
.header {
height: 40px;
- @media (${tablet}) {
+ @media ${tablet} {
height: 60px;
}
}
@@ -53,7 +53,7 @@ const StyledLoader = styled.div`
.description {
width: 700px;
- @media (${tablet}) {
+ @media ${tablet} {
width: 100%;
}
}
diff --git a/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/security-loader.js b/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/security-loader.js
index fe3a3fba5a..98a1c47d38 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/security-loader.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/sub-components/loaders/security-loader.js
@@ -10,7 +10,7 @@ const StyledLoader = styled.div`
height: 29px;
margin-bottom: 14px;
- @media (${tablet}) {
+ @media ${tablet} {
width: 184px;
height: 37px;
}
@@ -30,7 +30,7 @@ const StyledLoader = styled.div`
width: 591px;
margin-bottom: 20px;
- @media (${tablet}) {
+ @media ${tablet} {
width: 100%;
}
}
@@ -39,7 +39,7 @@ const StyledLoader = styled.div`
width: 192px;
height: 32px;
- @media (${tablet}) {
+ @media ${tablet} {
height: 40px;
}
}
diff --git a/packages/client/src/pages/PortalSettings/categories/security/sub-components/user-fields.js b/packages/client/src/pages/PortalSettings/categories/security/sub-components/user-fields.js
index f4ad918080..3af9c81dac 100644
--- a/packages/client/src/pages/PortalSettings/categories/security/sub-components/user-fields.js
+++ b/packages/client/src/pages/PortalSettings/categories/security/sub-components/user-fields.js
@@ -6,6 +6,7 @@ import PlusIcon from "PUBLIC_DIR/images/plus.react.svg";
import Link from "@docspace/components/link";
import TextInput from "@docspace/components/text-input";
import { Base } from "@docspace/components/themes";
+import { mobile } from "@docspace/components/utils/device";
const StyledPlusIcon = styled(PlusIcon)`
${commonIconsStyles}
@@ -33,7 +34,7 @@ const StyledInputWrapper = styled.div`
margin-bottom: 8px;
width: 350px;
- @media (max-width: 375px) {
+ @media ${mobile} {
width: 100%;
}
`;
diff --git a/packages/client/src/pages/PortalSettings/utils/useIsMobileView.js b/packages/client/src/pages/PortalSettings/utils/useIsMobileView.js
index f2103e0ad1..a7eb7720e5 100644
--- a/packages/client/src/pages/PortalSettings/utils/useIsMobileView.js
+++ b/packages/client/src/pages/PortalSettings/utils/useIsMobileView.js
@@ -5,7 +5,7 @@ export const useIsMobileView = () => {
const [isMobileView, setIsMobileView] = useState(false);
const onCheckView = () => {
- window.innerWidth <= size.smallTablet
+ window.innerWidth <= size.mobile
? setIsMobileView(true)
: setIsMobileView(false);
};
diff --git a/packages/client/src/pages/PortalUnavailable/index.js b/packages/client/src/pages/PortalUnavailable/index.js
index bbaeacfa08..37e2117313 100644
--- a/packages/client/src/pages/PortalUnavailable/index.js
+++ b/packages/client/src/pages/PortalUnavailable/index.js
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React, { useState, useEffect } from "react";
import ErrorContainer from "@docspace/common/components/ErrorContainer";
import { useTranslation } from "react-i18next";
import Text from "@docspace/components/text";
@@ -8,6 +8,7 @@ import { ReactSVG } from "react-svg";
import Button from "@docspace/components/button";
import RecoverAccessModalDialog from "@docspace/common/components/Dialogs/RecoverAccessModalDialog";
import { ColorTheme, ThemeType } from "@docspace/components/ColorTheme";
+import { mobile } from "@docspace/components/utils/device";
const StyledBodyContent = styled.div`
max-width: 480px;
@@ -44,7 +45,7 @@ const StyledBody = styled.div`
.portal-unavailable_text {
color: ${(props) => props.theme.portalUnavailable.textDescription};
}
- @media (max-width: 768px) {
+ @media ${mobile} {
.portal-unavailable_svg {
margin-top: 0px;
background: ${(props) => props.theme.catalog.background};
@@ -59,7 +60,12 @@ const StyledBody = styled.div`
}
`;
-const PortalUnavailable = ({ theme, logoUrl, onLogoutClick }) => {
+const PortalUnavailable = ({
+ theme,
+ logoUrl,
+ onLogoutClick,
+ setBodyRendered,
+}) => {
const { t, ready } = useTranslation([
"Errors",
"PortalUnavailable",
@@ -67,6 +73,12 @@ const PortalUnavailable = ({ theme, logoUrl, onLogoutClick }) => {
]);
const [isVisible, setIsVisible] = useState();
+ useEffect(() => {
+ setBodyRendered(true);
+
+ return () => setBodyRendered(false);
+ }, []);
+
const onClick = () => {
onLogoutClick();
};
@@ -124,10 +136,6 @@ const PortalUnavailable = ({ theme, logoUrl, onLogoutClick }) => {
export default inject(({ auth, profileActionsStore }) => {
const { onLogoutClick } = profileActionsStore;
- const { theme, logoUrl } = auth.settingsStore;
- return {
- logoUrl,
- theme,
- onLogoutClick,
- };
+ const { theme, logoUrl, setBodyRendered } = auth.settingsStore;
+ return { setBodyRendered, logoUrl, theme, onLogoutClick };
})(observer(PortalUnavailable));
diff --git a/packages/client/src/pages/PreparationPortal/StyledPreparationPortal.js b/packages/client/src/pages/PreparationPortal/StyledPreparationPortal.js
index 1d09dad891..5fa013429c 100644
--- a/packages/client/src/pages/PreparationPortal/StyledPreparationPortal.js
+++ b/packages/client/src/pages/PreparationPortal/StyledPreparationPortal.js
@@ -1,12 +1,11 @@
import styled from "styled-components";
-import { isMobile } from "react-device-detect";
+import { tablet } from "@docspace/components/utils/device";
const StyledPreparationPortal = styled.div`
width: 100%;
- ${isMobile &&
- `
+ @media ${tablet} {
margin-top: 48px;
- `}
+ }
#header {
font-size: 23px;
diff --git a/packages/client/src/pages/PreparationPortal/index.js b/packages/client/src/pages/PreparationPortal/index.js
index 53649ca7c8..c8ed309a7b 100644
--- a/packages/client/src/pages/PreparationPortal/index.js
+++ b/packages/client/src/pages/PreparationPortal/index.js
@@ -29,11 +29,18 @@ const PreparationPortal = (props) => {
withoutHeader,
style,
clearLocalStorage,
+ setBodyRendered,
} = props;
const [percent, setPercent] = useState(0);
const [errorMessage, setErrorMessage] = useState("");
+ useEffect(() => {
+ setBodyRendered(true);
+
+ return () => setBodyRendered(false);
+ });
+
const clearAllIntervals = () => {
clearInterval(timerId);
clearInterval(progressTimerId);
@@ -236,7 +243,7 @@ const PreparationPortal = (props) => {
);
};
-const PreparationPortalWrapper = inject(({ backup }) => {
+const PreparationPortalWrapper = inject(({ auth, backup }) => {
const { backupSize, clearLocalStorage } = backup;
const multiplicationFactor = backupSize
@@ -246,6 +253,7 @@ const PreparationPortalWrapper = inject(({ backup }) => {
return {
clearLocalStorage,
multiplicationFactor,
+ setBodyRendered: auth.settingsStore.setBodyRendered,
};
})(
withTranslation(["PreparationPortal", "Common"])(observer(PreparationPortal))
diff --git a/packages/client/src/pages/PrivateRoomsPage/i18n.js b/packages/client/src/pages/PrivateRoomsPage/i18n.js
index 69249a00ac..97873ac134 100644
--- a/packages/client/src/pages/PrivateRoomsPage/i18n.js
+++ b/packages/client/src/pages/PrivateRoomsPage/i18n.js
@@ -3,7 +3,7 @@ import { initReactI18next } from "react-i18next";
import Backend from "@docspace/common/utils/i18next-http-backend";
import { LANGUAGE } from "@docspace/common/constants";
import config from "PACKAGE_FILE";
-import { getCookie } from "@docspace/common/utils";
+import { getCookie } from "@docspace/components/utils/cookie";
import { loadLanguagePath } from "SRC_DIR/helpers/utils";
const newInstance = i18n.createInstance();
diff --git a/packages/client/src/pages/PrivateRoomsPage/index.js b/packages/client/src/pages/PrivateRoomsPage/index.js
index 57e9c04175..4e6e320e47 100644
--- a/packages/client/src/pages/PrivateRoomsPage/index.js
+++ b/packages/client/src/pages/PrivateRoomsPage/index.js
@@ -6,7 +6,7 @@ import Link from "@docspace/components/link";
import Button from "@docspace/components/button";
import Loader from "@docspace/components/loader";
import Section from "@docspace/common/components/Section";
-import { smallTablet, tablet } from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
import { I18nextProvider, Trans, withTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";
import { isMobile } from "react-device-detect";
@@ -49,7 +49,7 @@ const StyledPrivacyPage = styled.div`
? `text-align: right;`
: `text-align: left;`}
- @media ${smallTablet} {
+ @media ${mobile} {
text-align: center;
}
}
@@ -58,7 +58,7 @@ const StyledPrivacyPage = styled.div`
display: flex;
flex-direction: row;
- @media ${smallTablet} {
+ @media ${mobile} {
flex-direction: column;
}
}
@@ -98,7 +98,7 @@ const StyledPrivacyPage = styled.div`
: `padding-left: 74px;`}
}
- @media ${smallTablet} {
+ @media ${mobile} {
padding: 0px;
text-align: center;
}
diff --git a/packages/client/src/pages/Profile/Section/Body/index.js b/packages/client/src/pages/Profile/Section/Body/index.js
index 4a8e2fb28c..dfe7936486 100644
--- a/packages/client/src/pages/Profile/Section/Body/index.js
+++ b/packages/client/src/pages/Profile/Section/Body/index.js
@@ -14,7 +14,8 @@ import Notifications from "./sub-components/notifications";
import FileManagement from "./sub-components/file-management";
import InterfaceTheme from "./sub-components/interface-theme";
-import { tablet, hugeMobile } from "@docspace/components/utils/device";
+import { tablet } from "@docspace/components/utils/device";
+import { DeviceType } from "@docspace/common/constants";
const Wrapper = styled.div`
display: flex;
@@ -28,7 +29,7 @@ const Wrapper = styled.div`
`;
const SectionBodyContent = (props) => {
- const { isProfileLoaded, profile, t } = props;
+ const { showProfileLoader, profile, currentDeviceType, t } = props;
const navigate = useNavigate();
const data = [
@@ -71,22 +72,34 @@ const SectionBodyContent = (props) => {
navigate(`${path}/${e.id}`, { state: { disableScrollToTop: true } });
};
- if (!isProfileLoaded) return ;
+ if (showProfileLoader) return ;
return (
-
+
);
};
-export default inject(({ peopleStore, clientLoadingStore }) => {
- const { isProfileLoaded } = clientLoadingStore;
+export default inject(({ auth, peopleStore, clientLoadingStore }) => {
+ const { showProfileLoader } = clientLoadingStore;
const { targetUser: profile } = peopleStore.targetUserStore;
return {
- isProfileLoaded,
profile,
+ currentDeviceType: auth.settingsStore.currentDeviceType,
+ showProfileLoader,
};
})(
observer(
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/index.js
index 560bf57378..898c3df50a 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/index.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/index.js
@@ -5,7 +5,7 @@ import React, { useState, useEffect } from "react";
import { inject, observer } from "mobx-react";
import { withTranslation } from "react-i18next";
import { ReactSVG } from "react-svg";
-import { isMobile } from "react-device-detect";
+import { isDesktop } from "@docspace/components/utils/device";
import Text from "@docspace/components/text";
import Link from "@docspace/components/link";
import Box from "@docspace/components/box";
@@ -111,7 +111,7 @@ const ActiveSessions = ({
return new Date(date).toLocaleString(locale);
};
const tableCell = (platform, browser) =>
- interfaceDirection === "rtl" && !isMobile ? (
+ interfaceDirection === "rtl" && isDesktop() ? (
<>
{browser}
@@ -156,7 +156,7 @@ const ActiveSessions = ({
}
/>
- {isMobile ? (
+ {!isDesktop() ? (
{sessions.map((session) => (
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/styled-active-sessions.js b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/styled-active-sessions.js
index 556d5958a1..90468365e9 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/styled-active-sessions.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/active-session/styled-active-sessions.js
@@ -1,5 +1,5 @@
import styled, { css } from "styled-components";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
export const StyledFooter = styled.div`
.session-logout {
@@ -103,7 +103,7 @@ export const TableDataCell = styled.td`
}
}
- @media ${hugeMobile} {
+ @media ${mobile} {
.session-browser {
position: relative;
top: 4px;
@@ -137,17 +137,44 @@ export const TableDataCell = styled.td`
.session-date {
position: relative;
- margin-left: 0 !important;
- margin-right: 8px;
- :after {
- content: "";
- position: absolute;
- top: 4px;
- right: -8px;
- width: 1px;
- height: 12px;
- background: ${(props) => props.theme.activeSessions.sortHeaderColor};
- }
+
+ ${(props) =>
+ props.theme.interfaceDirection === "ltr"
+ ? css`
+ margin-right: 8px;
+ margin-left: 0 !important;
+ :after {
+ content: "";
+ position: absolute;
+ top: 4px;
+ right: -8px;
+ width: 1px;
+ height: 12px;
+ background: ${(props) =>
+ props.theme.activeSessions.sortHeaderColor};
+ }
+ `
+ : css`
+ margin-left: 8px;
+ margin-right: 0 !important;
+ `}
+ }
+
+ .session-ip {
+ position: relative;
+ ${(props) =>
+ props.theme.interfaceDirection === "rtl" &&
+ css`
+ :after {
+ content: "";
+ position: absolute;
+ top: 4px;
+ right: -8px;
+ width: 1px;
+ height: 12px;
+ background: ${(props) => props.theme.activeSessions.sortHeaderColor};
+ }
+ `}
}
:last-child {
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/index.js
index ca5fb9be2e..192409c8fe 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/index.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/index.js
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import ToggleButton from "@docspace/components/toggle-button";
import Box from "@docspace/components/box";
+import Text from "@docspace/components/text";
import Loaders from "@docspace/common/components/Loaders";
import StyledWrapper from "./styled-file-management";
@@ -105,34 +106,42 @@ const FileManagement = ({
style={{ display: "none" }}
/>
{!isVisitor && (
-
+
+
+ {t("Common:DontAskAgain")}
+
)}
-
- {!isVisitor && (
+
+ {t("OriginalCopy")}
+
+ {!isVisitor && (
+
+
+ {t("DisplayNotification")}
+
)}
{!isVisitor && (
-
+
+
+ {t("UpdateOrCreate")}
+
)}
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/styled-file-management.js b/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/styled-file-management.js
index 9a1c8c4aa1..31e10e5030 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/styled-file-management.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/file-management/styled-file-management.js
@@ -1,6 +1,4 @@
import styled, { css } from "styled-components";
-import { tablet } from "@docspace/components/utils/device";
-import { isMobile } from "react-device-detect";
const StyledWrapper = styled.div`
max-width: 660px;
@@ -10,6 +8,11 @@ const StyledWrapper = styled.div`
display: grid;
grid-gap: 32px;
+ .toggle-btn-wrapper {
+ display: flex;
+ //gap: 8px;
+ }
+
.toggle-btn {
height: 20px;
line-height: 20px;
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/index.js
index 84d97776f8..bb4bc12752 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/index.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/index.js
@@ -10,7 +10,7 @@ import toastr from "@docspace/components/toast/toastr";
import { ThemeKeys } from "@docspace/common/constants";
-import { smallTablet } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
import { showLoader, getSystemTheme } from "@docspace/common/utils";
import ThemePreview from "./theme-preview";
@@ -52,7 +52,7 @@ const StyledWrapper = styled.div`
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 20px;
- @media ${smallTablet} {
+ @media ${mobile} {
display: none;
}
}
@@ -60,7 +60,7 @@ const StyledWrapper = styled.div`
.mobile-themes-container {
display: none;
- @media ${smallTablet} {
+ @media ${mobile} {
display: flex;
padding-left: 30px;
}
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/styled-preview.js b/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/styled-preview.js
index 529d05400b..b6226afe58 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/styled-preview.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/interface-theme/styled-preview.js
@@ -25,10 +25,10 @@ export const StyledWrapper = styled.div`
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
- left: 30px !important;
+ left: 80px !important;
`
: css`
- right: 30px !important;
+ right: 80px !important;
`}
}
`;
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/login-settings/styled-login-settings.js b/packages/client/src/pages/Profile/Section/Body/sub-components/login-settings/styled-login-settings.js
index 2aeb585b16..4eacf88711 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/login-settings/styled-login-settings.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/login-settings/styled-login-settings.js
@@ -1,5 +1,5 @@
import styled from "styled-components";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
export const StyledWrapper = styled.div`
max-width: 660px;
@@ -18,7 +18,7 @@ export const StyledWrapper = styled.div`
gap: 16px;
align-items: center;
- @media ${hugeMobile} {
+ @media ${mobile} {
flex-direction: column;
gap: 12px;
align-items: flex-start;
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js
index 0fd2dd05da..3a00f3b56d 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js
@@ -31,7 +31,7 @@ import {
} from "./styled-main-profile";
import { HelpButton, Tooltip } from "@docspace/components";
import withCultureNames from "@docspace/common/hoc/withCultureNames";
-import { isSmallTablet } from "@docspace/components/utils/device";
+import { isMobile } from "@docspace/components/utils/device";
import { SSO_LABEL } from "SRC_DIR/helpers/constants";
import { useTheme } from "styled-components";
@@ -70,7 +70,7 @@ const MainProfile = (props) => {
const checkWidth = () => {
if (!isMobileOnly) return;
- if (!isSmallTablet()) {
+ if (!isMobile()) {
setHorizontalOrientation(true);
} else {
setHorizontalOrientation(false);
@@ -122,7 +122,7 @@ const MainProfile = (props) => {
);
- const isMobileHorizontalOrientation = isMobileOnly && horizontalOrientation;
+ const isMobileHorizontalOrientation = isMobile() && horizontalOrientation;
const { cultureName, currentCulture } = profile;
const language = convertLanguage(cultureName || currentCulture || culture);
@@ -293,7 +293,7 @@ const MainProfile = (props) => {
selectedOption={selectedLanguage}
onSelect={onLanguageSelect}
isDisabled={false}
- scaled={isMobileOnly}
+ scaled={isMobile()}
scaledOptions={false}
size="content"
showDisabledItems={true}
@@ -302,11 +302,11 @@ const MainProfile = (props) => {
isDefaultMode={
isMobileHorizontalOrientation
? isMobileHorizontalOrientation
- : !isMobileOnly
+ : !isMobile()
}
- withBlur={isMobileHorizontalOrientation ? false : isMobileOnly}
+ withBlur={isMobileHorizontalOrientation ? false : isMobile()}
fillIcon={false}
- modernView={!isMobileOnly}
+ modernView={!isMobile()}
/>
@@ -416,7 +416,7 @@ const MainProfile = (props) => {
selectedOption={selectedLanguage}
onSelect={onLanguageSelect}
isDisabled={false}
- scaled={isMobileOnly}
+ scaled={isMobile()}
scaledOptions={false}
size="content"
showDisabledItems={true}
@@ -425,11 +425,11 @@ const MainProfile = (props) => {
isDefaultMode={
isMobileHorizontalOrientation
? isMobileHorizontalOrientation
- : !isMobileOnly
+ : !isMobile()
}
- withBlur={isMobileHorizontalOrientation ? false : isMobileOnly}
+ withBlur={isMobileHorizontalOrientation ? false : isMobile()}
fillIcon={false}
- modernView={!isMobileOnly}
+ modernView={!isMobile()}
/>
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/styled-main-profile.js b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/styled-main-profile.js
index 63bbe3943b..6cf85b41b7 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/styled-main-profile.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/styled-main-profile.js
@@ -1,10 +1,5 @@
import styled, { css } from "styled-components";
-import {
- hugeMobile,
- mobile,
- smallTablet,
- tablet,
-} from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
import Text from "@docspace/components/text";
export const StyledWrapper = styled.div`
@@ -27,7 +22,7 @@ export const StyledWrapper = styled.div`
max-width: 100%;
}
- @media ${smallTablet} {
+ @media ${mobile} {
background: none;
flex-direction: column;
gap: 24px;
@@ -39,7 +34,7 @@ export const StyledWrapper = styled.div`
export const StyledAvatarWrapper = styled.div`
display: flex;
- @media ${smallTablet} {
+ @media ${mobile} {
width: 100%;
justify-content: center;
}
@@ -47,7 +42,7 @@ export const StyledAvatarWrapper = styled.div`
.badges-wrapper {
display: none;
- @media ${smallTablet} {
+ @media ${mobile} {
display: flex;
position: fixed;
right: 16px;
@@ -247,7 +242,7 @@ export const StyledInfo = styled.div`
display: flex;
}
- @media ${smallTablet} {
+ @media ${mobile} {
.rows-container {
display: none;
}
@@ -344,7 +339,7 @@ export const StyledInfo = styled.div`
}
}
- @media ${hugeMobile} {
+ @media ${mobile} {
gap: 8px;
}
}
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/timezoneCombo.js b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/timezoneCombo.js
index 9420656e74..13ee313f9f 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/timezoneCombo.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/timezoneCombo.js
@@ -5,9 +5,8 @@ import ComboBox from "@docspace/components/combobox";
import Text from "@docspace/components/text";
import toastr from "@docspace/components/toast/toastr";
-import { isMobileOnly } from "react-device-detect";
-
import { StyledRow } from "./styled-main-profile";
+import { isMobile } from "@docspace/components/utils/device";
const TimezoneCombo = ({ title }) => {
const { t } = useTranslation("Wizard");
@@ -28,15 +27,15 @@ const TimezoneCombo = ({ title }) => {
selectedOption={selectedTimezone}
//onSelect={onTimezoneSelect}
isDisabled={false}
- noBorder={!isMobileOnly}
- scaled={isMobileOnly}
+ noBorder={!isMobile()}
+ scaled={isMobile()}
scaledOptions={false}
size="content"
showDisabledItems={true}
dropDownMaxHeight={364}
manualWidth="250px"
- isDefaultMode={!isMobileOnly}
- withBlur={isMobileOnly}
+ isDefaultMode={!isMobile()}
+ withBlur={isMobile()}
fillIcon={false}
/>
diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/styled-social-networks.js b/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/styled-social-networks.js
index d70d8e0010..48756fb18e 100644
--- a/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/styled-social-networks.js
+++ b/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/styled-social-networks.js
@@ -1,5 +1,5 @@
import styled from "styled-components";
-import { hugeMobile } from "@docspace/components/utils/device";
+import { mobile } from "@docspace/components/utils/device";
export const StyledWrapper = styled.div`
max-width: 660px;
@@ -13,7 +13,7 @@ export const StyledWrapper = styled.div`
grid-column-gap: 20px;
grid-row-gap: 12px;
- @media ${hugeMobile} {
+ @media ${mobile} {
grid-template-columns: 1fr;
}
}
diff --git a/packages/client/src/pages/Profile/Section/Header/StyledHeader.js b/packages/client/src/pages/Profile/Section/Header/StyledHeader.js
index b2956bca07..9a9281541e 100644
--- a/packages/client/src/pages/Profile/Section/Header/StyledHeader.js
+++ b/packages/client/src/pages/Profile/Section/Header/StyledHeader.js
@@ -1,20 +1,21 @@
import styled, { css } from "styled-components";
+import { tablet } from "@docspace/components/utils/device";
export const StyledHeader = styled.div`
position: relative;
display: grid;
- grid-template-columns: ${props =>
+ grid-template-columns: ${(props) =>
props.showContextButton ? "auto auto auto 1fr" : "auto 1fr"};
align-items: center;
- @media (max-width: 1024px) {
- grid-template-columns: ${props =>
+ @media ${tablet} {
+ grid-template-columns: ${(props) =>
props.showContextButton ? "auto 1fr auto" : "auto 1fr"};
}
.action-button {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 16px;
@@ -22,8 +23,8 @@ export const StyledHeader = styled.div`
: css`
margin-left: 16px;
`}
- @media (max-width: 1024px) {
- ${props =>
+ @media ${tablet} {
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: auto;
@@ -32,7 +33,7 @@ export const StyledHeader = styled.div`
margin-left: auto;
`}
& > div:first-child {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding: 8px 0px 8px 16px;
@@ -46,12 +47,12 @@ export const StyledHeader = styled.div`
}
}
.arrow-button {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl" &&
css`
transform: scaleX(-1);
`}
- @media (max-width: 1024px) {
+ @media ${tablet} {
padding: 8px 16px 8px 16px;
margin-left: -16px;
margin-right: -16px;
@@ -59,7 +60,7 @@ export const StyledHeader = styled.div`
}
.header-headline {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 16px;
diff --git a/packages/client/src/pages/Profile/Section/Header/index.js b/packages/client/src/pages/Profile/Section/Header/index.js
index 0075fec6f6..8b1ef4328e 100644
--- a/packages/client/src/pages/Profile/Section/Header/index.js
+++ b/packages/client/src/pages/Profile/Section/Header/index.js
@@ -40,8 +40,10 @@ const Header = (props) => {
setDialogData,
- isProfileLoaded,
profileClicked,
+
+ showProfileLoader,
+ setIsLoading,
} = props;
const navigate = useNavigate();
@@ -111,11 +113,13 @@ const Header = (props) => {
const urlParams = roomsFilter.toUrlParams();
const backUrl = `/rooms/shared/filter?${urlParams}`;
+ setIsLoading();
+
navigate(backUrl);
// setFilter(filter);
};
- if (!isProfileLoaded) return ;
+ if (showProfileLoader) return ;
return (
-
+
@@ -107,7 +120,18 @@ export default inject(
({ auth, peopleStore, clientLoadingStore, treeFoldersStore }) => {
const { setDocumentTitle, language } = auth;
- const { setIsProfileLoaded } = clientLoadingStore;
+ const {
+ setIsProfileLoaded,
+ setIsSectionHeaderLoading,
+ setIsSectionBodyLoading,
+ setIsSectionFilterLoading,
+ } = clientLoadingStore;
+
+ const setIsLoading = () => {
+ setIsSectionHeaderLoading(true, false);
+ setIsSectionFilterLoading(true, false);
+ setIsSectionBodyLoading(true, false);
+ };
const { targetUserStore } = peopleStore;
const {
@@ -128,10 +152,12 @@ export default inject(
setIsEditTargetUser,
showCatalog: auth.settingsStore.showCatalog,
+ setBodyRendered: auth.settingsStore.setBodyRendered,
selectedTreeNode,
setSelectedNode,
isVisitor: auth.userStore.user.isVisitor,
setIsProfileLoaded,
+ setIsLoading,
};
}
)(observer(withTranslation(["Profile", "Common"])(withCultureNames(Profile))));
diff --git a/packages/client/src/pages/PublicRoom/StyledPublicRoom.js b/packages/client/src/pages/PublicRoom/StyledPublicRoom.js
index 7993675731..c93ea7a417 100644
--- a/packages/client/src/pages/PublicRoom/StyledPublicRoom.js
+++ b/packages/client/src/pages/PublicRoom/StyledPublicRoom.js
@@ -1,18 +1,18 @@
import styled, { css } from "styled-components";
-import { isMobile, isMobileOnly } from "react-device-detect";
+
import { tablet, mobile } from "@docspace/components/utils/device";
import Headline from "@docspace/common/components/Headline";
const StyledHeadline = styled(Headline)`
font-weight: 700;
- font-size: ${isMobile ? "21px !important" : "18px"};
- line-height: ${isMobile ? "28px !important" : "24px"};
- ${props =>
+ font-size: 18px;
+ line-height: 24px;
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 18px;
`
- : css`
+ : css`
margin-left: 18px;
`}
@@ -30,13 +30,13 @@ const StyledContainer = styled.div`
align-items: center;
.public-room-header_separator {
- ${props =>
- props.theme.interfaceDirection === "rtl"
- ? css`
+ ${(props) =>
+ props.theme.interfaceDirection === "rtl"
+ ? css`
margin: 0 15px 0 16px;
border-right: 1px solid #dfe2e3;
`
- : css`
+ : css`
margin: 0 16px 0 15px;
border-left: 1px solid #dfe2e3;
`}
@@ -48,22 +48,10 @@ const StyledContainer = styled.div`
padding: 16px 0 0px;
}
- ${isMobile &&
- css`
- width: 100% !important;
- padding: 16px 0 0px;
- `}
-
@media ${mobile} {
width: 100%;
padding: 12px 0 0;
}
-
- ${isMobileOnly &&
- css`
- width: 100% !important;
- padding: 12px 0 0;
- `}
`;
export { StyledHeadline, StyledContainer };
diff --git a/packages/client/src/pages/PublicRoom/index.js b/packages/client/src/pages/PublicRoom/index.js
index e5bc741235..c81a4ea4ea 100644
--- a/packages/client/src/pages/PublicRoom/index.js
+++ b/packages/client/src/pages/PublicRoom/index.js
@@ -22,6 +22,7 @@ const PublicRoom = (props) => {
getFilesSettings,
setPublicRoomKey,
setIsArticleLoading,
+ setBodyRendered,
} = props;
const navigate = useNavigate();
@@ -61,6 +62,13 @@ const PublicRoom = (props) => {
if (isLoaded) fetchRoomFiles();
}, [isLoaded]);
+ useEffect(() => {
+ setBodyRendered(true);
+ return () => {
+ setBodyRendered(false);
+ };
+ }, []);
+
const renderLoader = () => {
return (
@@ -102,7 +110,7 @@ export default inject(
publicRoomStore;
const { getFilesSettings } = settingsStore;
- const { setPublicRoomKey } = auth.settingsStore;
+ const { setPublicRoomKey, setBodyRendered } = auth.settingsStore;
const { setIsArticleLoading } = clientLoadingStore;
return {
@@ -116,6 +124,7 @@ export default inject(
validatePublicRoomKey,
setPublicRoomKey,
setIsArticleLoading,
+ setBodyRendered,
};
}
)(observer(PublicRoom));
diff --git a/packages/client/src/pages/PublicRoom/sub-components/RoomStyles.js b/packages/client/src/pages/PublicRoom/sub-components/RoomStyles.js
index 7bf797f991..940316fba6 100644
--- a/packages/client/src/pages/PublicRoom/sub-components/RoomStyles.js
+++ b/packages/client/src/pages/PublicRoom/sub-components/RoomStyles.js
@@ -1,5 +1,5 @@
import styled from "styled-components";
-import { hugeMobile, mobile, tablet } from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
export const StyledPage = styled.div`
display: flex;
@@ -13,25 +13,13 @@ export const StyledPage = styled.div`
padding: 0 16px;
}
- @media ${hugeMobile} {
- margin: 32px 0;
- ${props =>
- props.theme.interfaceDirection === "rtl"
- ? css`
- padding: 0 20px 0 8px;
- `
- : css`
- padding: 0 8px 0 20px;
- `}
- }
-
@media ${mobile} {
- ${props =>
- props.theme.interfaceDirection === "rtl"
- ? css`
+ ${(props) =>
+ props.theme.interfaceDirection === "rtl"
+ ? css`
padding: 0 16px 0 8px;
`
- : css`
+ : css`
padding: 0 8px 0 16px;
`}
}
@@ -89,7 +77,7 @@ export const StyledContent = styled.div`
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
- @media ${hugeMobile} {
+ @media ${mobile} {
justify-content: start;
min-height: 100%;
}
@@ -101,7 +89,7 @@ export const StyledBody = styled.div`
align-items: center;
margin: 56px auto;
- @media ${hugeMobile} {
+ @media ${mobile} {
width: 100%;
margin: 0 auto;
}
diff --git a/packages/client/src/pages/Sdk/index.js b/packages/client/src/pages/Sdk/index.js
index 02387a2cad..32c8a12ef2 100644
--- a/packages/client/src/pages/Sdk/index.js
+++ b/packages/client/src/pages/Sdk/index.js
@@ -25,7 +25,15 @@ const Sdk = ({
getSettings,
user,
updateProfileCulture,
+ setBodyRendered,
}) => {
+ useEffect(() => {
+ setBodyRendered(true);
+ return () => {
+ setBodyRendered(false);
+ };
+ }, []);
+
useEffect(() => {
window.addEventListener("message", handleMessage, false);
return () => {
@@ -161,15 +169,10 @@ const Sdk = ({
component = (
);
break;
@@ -182,8 +185,14 @@ const Sdk = ({
export default inject(({ auth, settingsStore, peopleStore }) => {
const { login, logout, userStore } = auth;
- const { theme, setFrameConfig, frameConfig, getSettings, isLoaded } =
- auth.settingsStore;
+ const {
+ theme,
+ setFrameConfig,
+ frameConfig,
+ getSettings,
+ isLoaded,
+ setBodyRendered,
+ } = auth.settingsStore;
const { loadCurrentUser, user } = userStore;
const { updateProfileCulture } = peopleStore.targetUserStore;
const { getIcon } = settingsStore;
@@ -200,5 +209,6 @@ export default inject(({ auth, settingsStore, peopleStore }) => {
isLoaded,
updateProfileCulture,
user,
+ setBodyRendered,
};
})(observer(Sdk));
diff --git a/packages/client/src/pages/VersionHistory/Section/Header/index.js b/packages/client/src/pages/VersionHistory/Section/Header/index.js
index 0e631ac4b8..f4889a4199 100644
--- a/packages/client/src/pages/VersionHistory/Section/Header/index.js
+++ b/packages/client/src/pages/VersionHistory/Section/Header/index.js
@@ -3,7 +3,7 @@ import React from "react";
import styled, { css } from "styled-components";
import Headline from "@docspace/common/components/Headline";
import IconButton from "@docspace/components/icon-button";
-import { desktop } from "@docspace/components/utils/device";
+import { desktop, tablet } from "@docspace/components/utils/device";
const StyledContainer = styled.div`
display: grid;
@@ -28,7 +28,7 @@ const StyledContainer = styled.div`
theme.interfaceDirection === "rtl" && "transform: scaleX(-1);"}
}
- @media (max-width: 1024px) {
+ @media ${tablet} {
${({ theme }) =>
theme.interfaceDirection === "rtl"
? css`
diff --git a/packages/client/src/pages/Wizard/StyledWizard.js b/packages/client/src/pages/Wizard/StyledWizard.js
index 54f3f89567..33927cd454 100644
--- a/packages/client/src/pages/Wizard/StyledWizard.js
+++ b/packages/client/src/pages/Wizard/StyledWizard.js
@@ -1,6 +1,6 @@
import styled, { css } from "styled-components";
-import { tablet, hugeMobile } from "@docspace/components/utils/device";
-import { isIOS, isFirefox, isMobileOnly } from "react-device-detect";
+import { tablet, mobile } from "@docspace/components/utils/device";
+import { isIOS, isFirefox } from "react-device-detect";
import BackgroundPatternReactSvgUrl from "PUBLIC_DIR/images/background.pattern.react.svg?url";
export const Wrapper = styled.div`
@@ -11,12 +11,12 @@ export const Wrapper = styled.div`
flex-direction: column;
box-sizing: border-box;
- ${isMobileOnly &&
- css`
+ @media ${mobile} {
height: auto;
min-height: 100%;
width: 100%;
- `}
+ min-width: 100%;
+ }
.bg-cover {
background-image: url("${BackgroundPatternReactSvgUrl}");
@@ -30,7 +30,7 @@ export const Wrapper = styled.div`
bottom: 0;
z-index: -1;
- @media ${hugeMobile} {
+ @media ${mobile} {
background-image: none;
}
}
@@ -47,8 +47,10 @@ export const StyledContent = styled.div`
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
- @media ${hugeMobile} {
+ @media ${mobile} {
min-height: 100%;
+ width: calc(100% - 32px);
+ justify-content: start;
}
`;
@@ -64,7 +66,8 @@ export const WizardContainer = styled.div`
max-width: 480px;
}
- @media ${hugeMobile} {
+ @media ${mobile} {
+ max-width: 100%;
margin: 32px auto;
}
@@ -78,7 +81,7 @@ export const WizardContainer = styled.div`
.welcome-text {
padding-bottom: 32px;
- @media ${hugeMobile} {
+ @media ${mobile} {
max-width: 343px;
}
}
@@ -158,7 +161,7 @@ export const StyledInfo = styled.div`
max-width: 300px;
}
- @media ${hugeMobile} {
+ @media ${mobile} {
max-width: 220px;
}
}
diff --git a/packages/client/src/pages/Wizard/index.js b/packages/client/src/pages/Wizard/index.js
index 277774a07a..3e79df1342 100644
--- a/packages/client/src/pages/Wizard/index.js
+++ b/packages/client/src/pages/Wizard/index.js
@@ -3,7 +3,6 @@ import axios from "axios";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
import { inject, observer } from "mobx-react";
-import { isMobileOnly } from "react-device-detect";
import Text from "@docspace/components/text";
import FormWrapper from "@docspace/components/form-wrapper";
@@ -44,6 +43,7 @@ import {
DEFAULT_SELECT_TIMEZONE,
DEFAULT_SELECT_LANGUAGE,
} from "SRC_DIR/helpers/constants";
+import { isMobile } from "@docspace/components/utils/device";
const emailSettings = new EmailSettings();
emailSettings.allowDomainPunycode = true;
@@ -71,6 +71,7 @@ const Wizard = (props) => {
setLicense,
licenseUpload,
resetLicenseUploaded,
+ setBodyRendered,
} = props;
const navigate = useNavigate();
@@ -100,6 +101,13 @@ const Wizard = (props) => {
const convertedCulture = convertLanguage(userCulture);
+ useEffect(() => {
+ setBodyRendered(true);
+ return () => {
+ setBodyRendered(false);
+ };
+ }, []);
+
const mapTimezonesToArray = (timezones) => {
return timezones.map((timezone) => {
return { key: timezone.id, label: timezone.displayName };
@@ -118,7 +126,8 @@ const Wizard = (props) => {
const select = getSelectZone(zones, userTimezone);
setTimezones(zones);
- if (!select) {
+
+ if (select.length === 0) {
setSelectedTimezone(DEFAULT_SELECT_TIMEZONE);
} else {
setSelectedTimezone(select[0]);
@@ -130,7 +139,7 @@ const Wizard = (props) => {
(lang) => lang.key === convertedCulture
);
- if (!select) {
+ if (select.length === 0) {
setSelectedLanguage(DEFAULT_SELECT_LANGUAGE);
} else {
setSelectedLanguage(select[0]);
@@ -404,14 +413,14 @@ const Wizard = (props) => {
selectedOption={selectedLanguage}
onSelect={onLanguageSelect}
isDisabled={isCreated}
- scaled={isMobileOnly}
+ scaled={isMobile()}
scaledOptions={false}
size="content"
showDisabledItems={true}
dropDownMaxHeight={364}
manualWidth="250px"
- isDefaultMode={!isMobileOnly}
- withBlur={isMobileOnly}
+ isDefaultMode={!isMobile()}
+ withBlur={isMobile()}
fillIcon={false}
modernView={true}
/>
@@ -428,14 +437,14 @@ const Wizard = (props) => {
selectedOption={selectedTimezone}
onSelect={onTimezoneSelect}
isDisabled={isCreated}
- scaled={isMobileOnly}
+ scaled={isMobile()}
scaledOptions={false}
size="content"
showDisabledItems={true}
dropDownMaxHeight={364}
manualWidth="350px"
- isDefaultMode={!isMobileOnly}
- withBlur={isMobileOnly}
+ isDefaultMode={!isMobile()}
+ withBlur={isMobile()}
fillIcon={false}
modernView={true}
/>
@@ -497,6 +506,7 @@ export default inject(({ auth, wizard }) => {
getPortalTimezones,
getPortalPasswordSettings,
theme,
+ setBodyRendered,
} = auth.settingsStore;
const { language } = auth;
@@ -535,5 +545,6 @@ export default inject(({ auth, wizard }) => {
setPortalOwner,
setLicense,
resetLicenseUploaded,
+ setBodyRendered,
};
})(withCultureNames(observer(Wizard)));
diff --git a/packages/client/src/store/ClientLoadingStore.js b/packages/client/src/store/ClientLoadingStore.js
index 5e6bf16064..e1af4575ae 100644
--- a/packages/client/src/store/ClientLoadingStore.js
+++ b/packages/client/src/store/ClientLoadingStore.js
@@ -43,8 +43,13 @@ class ClientLoadingStore {
this.firstLoad = firstLoad;
};
- setIsArticleLoading = (isArticleLoading) => {
- this.isArticleLoading = isArticleLoading;
+ setIsArticleLoading = (isArticleLoading, withTimer = true) => {
+ if (!withTimer || !this.firstLoad)
+ return (this.isArticleLoading = isArticleLoading);
+
+ setTimeout(() => {
+ this.setIsArticleLoading(isArticleLoading, false);
+ }, MIN_LOADER_TIMER);
};
updateIsSectionHeaderLoading = (param) => {
@@ -60,19 +65,23 @@ class ClientLoadingStore {
};
setIsSectionHeaderLoading = (isSectionHeaderLoading, withTimer = true) => {
- this.pendingSectionLoaders.header = isSectionHeaderLoading;
if (isSectionHeaderLoading) {
+ if (this.pendingSectionLoaders.header || this.isSectionHeaderLoading)
+ return;
if (this.sectionHeaderTimer) {
return;
}
+ this.pendingSectionLoaders.header = isSectionHeaderLoading;
this.startLoadingTime.header = new Date();
if (withTimer && !this.firstLoad) {
return (this.sectionHeaderTimer = setTimeout(() => {
+ this.sectionHeaderTimer = null;
this.updateIsSectionHeaderLoading(isSectionHeaderLoading);
}, SHOW_LOADER_TIMER));
}
this.updateIsSectionHeaderLoading(isSectionHeaderLoading);
} else {
+ this.pendingSectionLoaders.header = isSectionHeaderLoading;
if (this.startLoadingTime.header) {
const currentDate = new Date();
@@ -101,19 +110,27 @@ class ClientLoadingStore {
};
setIsSectionFilterLoading = (isSectionFilterLoading, withTimer = true) => {
- this.pendingSectionLoaders.filter = isSectionFilterLoading;
+ const id = Math.ceil(Math.random() * 10);
+
if (isSectionFilterLoading) {
+ if (this.pendingSectionLoaders.filter || this.isSectionFilterLoading)
+ return;
if (this.sectionFilterTimer) {
return;
}
+ this.pendingSectionLoaders.filter = isSectionFilterLoading;
+
this.startLoadingTime.filter = new Date();
if (withTimer && !this.firstLoad) {
return (this.sectionFilterTimer = setTimeout(() => {
this.updateIsSectionFilterLoading(isSectionFilterLoading);
+ this.sectionFilterTimer = null;
}, SHOW_LOADER_TIMER));
}
+
this.updateIsSectionFilterLoading(isSectionFilterLoading);
} else {
+ this.pendingSectionLoaders.filter = isSectionFilterLoading;
if (this.startLoadingTime.filter) {
const currentDate = new Date();
@@ -131,6 +148,7 @@ class ClientLoadingStore {
if (ms < MIN_LOADER_TIMER) {
return setTimeout(() => {
this.updateIsSectionFilterLoading(false);
+
this.startLoadingTime.filter = null;
}, MIN_LOADER_TIMER - ms);
}
@@ -141,25 +159,28 @@ class ClientLoadingStore {
}
this.startLoadingTime.filter = null;
+
this.updateIsSectionFilterLoading(false);
}
};
setIsSectionBodyLoading = (isSectionBodyLoading, withTimer = true) => {
- this.pendingSectionLoaders.body = isSectionBodyLoading;
-
if (isSectionBodyLoading) {
+ if (this.pendingSectionLoaders.body || this.isSectionBodyLoading) return;
if (this.sectionBodyTimer) {
return;
}
+ this.pendingSectionLoaders.body = isSectionBodyLoading;
this.startLoadingTime.body = new Date();
if (withTimer && !this.firstLoad) {
return (this.sectionBodyTimer = setTimeout(() => {
+ this.sectionBodyTimer = null;
this.updateIsSectionBodyLoading(isSectionBodyLoading);
}, SHOW_LOADER_TIMER));
}
this.updateIsSectionBodyLoading(isSectionBodyLoading);
} else {
+ this.pendingSectionLoaders.body = isSectionBodyLoading;
if (this.startLoadingTime.body) {
const currentDate = new Date();
@@ -191,8 +212,14 @@ class ClientLoadingStore {
}
};
+ updateIsProfileLoaded = (isLoaded) => {
+ this.isProfileLoaded = isLoaded;
+ };
+
setIsProfileLoaded = (isProfileLoaded) => {
- this.isProfileLoaded = isProfileLoaded;
+ setTimeout(() => {
+ this.updateIsProfileLoaded(isProfileLoaded);
+ }, MIN_LOADER_TIMER);
};
hideLoaders = () => {
@@ -224,6 +251,10 @@ class ClientLoadingStore {
return this.isArticleLoading;
}
+ get showProfileLoader() {
+ return !this.isProfileLoaded;
+ }
+
get showHeaderLoader() {
return this.isSectionHeaderLoading || this.showArticleLoader;
}
diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js
index 761de8b303..acc501e95a 100644
--- a/packages/client/src/store/ContextOptionsStore.js
+++ b/packages/client/src/store/ContextOptionsStore.js
@@ -45,10 +45,7 @@ import config from "PACKAGE_FILE";
import toastr from "@docspace/components/toast/toastr";
import { ShareAccessRights, RoomsType } from "@docspace/common/constants";
import combineUrl from "@docspace/common/utils/combineUrl";
-import {
- isMobile as isMobileUtils,
- isTablet as isTabletUtils,
-} from "@docspace/components/utils/device";
+import { isDesktop } from "@docspace/components/utils/device";
import { Events } from "@docspace/common/constants";
import { connectedCloudsTypeTitleTranslation } from "@docspace/client/src/helpers/filesUtils";
@@ -225,10 +222,14 @@ class ContextOptionsStore {
};
onMoveAction = () => {
+ const { setIsMobileHidden } = this.authStore.infoPanelStore;
+ setIsMobileHidden(true);
this.dialogsStore.setMoveToPanelVisible(true);
};
onCopyAction = () => {
+ const { setIsMobileHidden } = this.authStore.infoPanelStore;
+ setIsMobileHidden(true);
this.dialogsStore.setCopyPanelVisible(true);
};
@@ -236,10 +237,13 @@ class ContextOptionsStore {
const { fetchFileVersions, setIsVerHistoryPanel } =
this.versionHistoryStore;
+ const { setIsMobileHidden } = this.authStore.infoPanelStore;
+
if (this.treeFoldersStore.isRecycleBinFolder) return;
fetchFileVersions(id + "", security);
setIsVerHistoryPanel(true);
+ setIsMobileHidden(true);
};
finalizeVersion = (id) => {
@@ -497,7 +501,7 @@ class ContextOptionsStore {
const { setRemoveItem, setDeleteThirdPartyDialogVisible } =
this.dialogsStore;
- if (id === this.selectedFolderStore.id) {
+ if (id === this.selectedFolderStore.id && isFolder) {
this.onClickDeleteSelectedFolder(t, isRoom);
return;
@@ -845,72 +849,71 @@ class ContextOptionsStore {
!contextOptions.includes("finalize-version") &&
contextOptions.includes("show-version-history");
- const versionActions =
- !isMobile && !isMobileUtils() && !isTabletUtils()
- ? onlyShowVersionHistory
- ? [
- {
- id: "option_show-version-history",
- key: "show-version-history",
- label: t("ShowVersionHistory"),
- icon: HistoryReactSvgUrl,
- onClick: () => this.showVersionHistory(item.id, item.security),
- disabled: false,
- },
- ]
- : [
- {
- id: "option_version",
- key: "version",
- label: t("VersionHistory"),
- icon: HistoryFinalizedReactSvgUrl,
- items: [
- {
- id: "option_finalize-version",
- key: "finalize-version",
- label: t("FinalizeVersion"),
- icon: HistoryFinalizedReactSvgUrl,
- onClick: () =>
- isEditing
- ? this.onShowEditingToast(t)
- : this.finalizeVersion(item.id, item.security),
- disabled: false,
- },
- {
- id: "option_version-history",
- key: "show-version-history",
- label: t("ShowVersionHistory"),
- icon: HistoryReactSvgUrl,
- onClick: () =>
- this.showVersionHistory(item.id, item.security),
- disabled: false,
- },
- ],
- },
- ]
- : [
+ const versionActions = isDesktop()
+ ? onlyShowVersionHistory
+ ? [
{
- id: "option_finalize-version",
- key: "finalize-version",
- label: t("FinalizeVersion"),
- icon: HistoryFinalizedReactSvgUrl,
- onClick: () =>
- isEditing
- ? this.onShowEditingToast(t)
- : this.finalizeVersion(item.id),
- disabled: false,
- },
- {
- id: "option_version-history",
+ id: "option_show-version-history",
key: "show-version-history",
label: t("ShowVersionHistory"),
icon: HistoryReactSvgUrl,
onClick: () => this.showVersionHistory(item.id, item.security),
disabled: false,
},
- ];
+ ]
+ : [
+ {
+ id: "option_version",
+ key: "version",
+ label: t("VersionHistory"),
+ icon: HistoryFinalizedReactSvgUrl,
+ items: [
+ {
+ id: "option_finalize-version",
+ key: "finalize-version",
+ label: t("FinalizeVersion"),
+ icon: HistoryFinalizedReactSvgUrl,
+ onClick: () =>
+ isEditing
+ ? this.onShowEditingToast(t)
+ : this.finalizeVersion(item.id, item.security),
+ disabled: false,
+ },
+ {
+ id: "option_version-history",
+ key: "show-version-history",
+ label: t("ShowVersionHistory"),
+ icon: HistoryReactSvgUrl,
+ onClick: () =>
+ this.showVersionHistory(item.id, item.security),
+ disabled: false,
+ },
+ ],
+ },
+ ]
+ : [
+ {
+ id: "option_finalize-version",
+ key: "finalize-version",
+ label: t("FinalizeVersion"),
+ icon: HistoryFinalizedReactSvgUrl,
+ onClick: () =>
+ isEditing
+ ? this.onShowEditingToast(t)
+ : this.finalizeVersion(item.id),
+ disabled: false,
+ },
+ {
+ id: "option_version-history",
+ key: "show-version-history",
+ label: t("ShowVersionHistory"),
+ icon: HistoryReactSvgUrl,
+ onClick: () => this.showVersionHistory(item.id, item.security),
+ disabled: false,
+ },
+ ];
const moveActions =
- !isMobile && !isMobileUtils() && !isTabletUtils() && !isInfoPanel
+ isDesktop() && !isInfoPanel
? [
{
id: "option_move-or-copy",
diff --git a/packages/client/src/store/CreateEditRoomStore.js b/packages/client/src/store/CreateEditRoomStore.js
index 73012fde5e..1a71ece0b5 100644
--- a/packages/client/src/store/CreateEditRoomStore.js
+++ b/packages/client/src/store/CreateEditRoomStore.js
@@ -1,6 +1,6 @@
import { makeAutoObservable } from "mobx";
import toastr from "@docspace/components/toast/toastr";
-import { isMobile } from "react-device-detect";
+import { isDesktop } from "@docspace/components/utils/device";
import FilesFilter from "@docspace/common/api/files/filter";
import { getCategoryUrl } from "SRC_DIR/helpers/utils";
import { CategoryType } from "SRC_DIR/helpers/constants";
@@ -84,6 +84,8 @@ class CreateEditRoomStore {
calculateRoomLogoParams,
uploadRoomLogo,
addLogoToRoom,
+ selection,
+ bufferSelection,
} = this.filesStore;
const { preparingDataForCopyingToRoom } = this.filesActionsStore;
@@ -154,8 +156,16 @@ class CreateEditRoomStore {
});
} else !withPaging && this.onOpenNewRoom(room);
- if (processCreatingRoomFromData)
- preparingDataForCopyingToRoom(room.id, t);
+ if (processCreatingRoomFromData) {
+ const selections =
+ selection.length > 0 && selection[0] != null
+ ? selection
+ : bufferSelection != null
+ ? [bufferSelection]
+ : [];
+
+ preparingDataForCopyingToRoom(room.id, selections, t);
+ }
this.roomIsCreated = true;
} catch (err) {
@@ -173,6 +183,7 @@ class CreateEditRoomStore {
onOpenNewRoom = async (room) => {
const { setIsSectionFilterLoading } = this.clientLoadingStore;
+ const { setSelection } = this.filesStore;
const { setView, setIsVisible } = this.infoPanelStore;
const setIsLoading = (param) => {
@@ -194,9 +205,11 @@ class CreateEditRoomStore {
const path = getCategoryUrl(CategoryType.SharedRoom, room.id);
+ setSelection && setSelection([]);
+
window.DocSpace.navigate(`${path}?${newFilter.toUrlParams()}`, { state });
- !isMobile && setIsVisible(true);
+ isDesktop() && setIsVisible(true);
this.setIsLoading(false);
this.setConfirmDialogIsLoading(false);
diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js
index a9009bd179..b0d22ded70 100644
--- a/packages/client/src/store/FilesActionsStore.js
+++ b/packages/client/src/store/FilesActionsStore.js
@@ -31,13 +31,13 @@ import {
FolderType,
} from "@docspace/common/constants";
import { makeAutoObservable } from "mobx";
-import { isMobile } from "react-device-detect";
+
import toastr from "@docspace/components/toast/toastr";
import { TIMEOUT } from "@docspace/client/src/helpers/filesConstants";
import { checkProtocol } from "../helpers/files-helpers";
import { combineUrl } from "@docspace/common/utils";
import config from "PACKAGE_FILE";
-import { isTablet } from "@docspace/components/utils/device";
+import { isDesktop } from "@docspace/components/utils/device";
import { getCategoryType } from "SRC_DIR/helpers/utils";
import { muteRoomNotification } from "@docspace/common/api/settings";
import { CategoryType } from "SRC_DIR/helpers/constants";
@@ -1018,7 +1018,14 @@ class FilesActionStore {
}
})
.then(() => setSelected("close"))
- .finally(() => toastr.success(t("RoomPinned")));
+ .then(() =>
+ toastr.success(
+ items.length > 1
+ ? t("RoomsPinned", { count: items.length })
+ : t("RoomPinned")
+ )
+ )
+ .catch((error) => console.log(error));
case "unpin":
items.forEach((item) => {
updateRoomPin(item);
@@ -1032,7 +1039,14 @@ class FilesActionStore {
}
})
.then(() => setSelected("close"))
- .finally(() => toastr.success(t("RoomUnpinned")));
+ .then(() => {
+ toastr.success(
+ items.length > 1
+ ? t("RoomsUnpinned", { count: items.length })
+ : t("RoomUnpinned")
+ );
+ })
+ .catch((error) => console.log(error));
default:
return;
}
@@ -1379,6 +1393,8 @@ class FilesActionStore {
url !== window.DocSpace.location.pathname
);
+ if (!isDesktop()) this.authStore.infoPanelStore.setIsVisible(false);
+
window.DocSpace.navigate(`${url}?${newFilter.toUrlParams()}`, { state });
};
@@ -1740,7 +1756,7 @@ class FilesActionStore {
switch (option) {
case "show-info":
- if (!isTablet() && !isMobile) return null;
+ if (isDesktop()) return null;
else
return {
id: "menu-show-info",
@@ -2341,19 +2357,10 @@ class FilesActionStore {
this.isGroupMenuBlocked = blocked;
};
- preparingDataForCopyingToRoom = async (destFolderId, t) => {
- const { selection, bufferSelection } = this.filesStore;
-
+ preparingDataForCopyingToRoom = async (destFolderId, selections, t) => {
let fileIds = [];
let folderIds = [];
- const selections =
- selection.length > 0 && selection[0] != null
- ? selection
- : bufferSelection != null
- ? [bufferSelection]
- : [];
-
if (!selections.length) return;
const oneFolder = selections.length === 1 && selections[0].isFolder;
@@ -2364,18 +2371,14 @@ class FilesActionStore {
const selectedFolder = await getFolder(selections[0].id);
const { folders, files, total } = selectedFolder;
- if (total > 1) this.setSelectedItems(false, total);
-
- if (total === 1) {
- const title = !!folders.length ? folders[0].title : files[0].title;
- this.setSelectedItems(title, total);
- }
-
if (total === 0) {
this.filesStore.setSelection([]);
this.filesStore.setBufferSelection(null);
return;
}
+
+ const title = !!folders.length ? folders[0].title : files[0].title;
+ this.setSelectedItems(title, total);
} catch (err) {
toastr.error(err);
}
@@ -2387,7 +2390,7 @@ class FilesActionStore {
else folderIds.push(item.id);
});
- !oneFolder && this.setSelectedItems();
+ !oneFolder && this.setSelectedItems(selections[0].title, selections.length);
this.filesStore.setSelection([]);
this.filesStore.setBufferSelection(null);
diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js
index e75eba2f0f..ec69fdc5d7 100644
--- a/packages/client/src/store/FilesStore.js
+++ b/packages/client/src/store/FilesStore.js
@@ -13,7 +13,7 @@ import {
import { combineUrl } from "@docspace/common/utils";
import { updateTempContent } from "@docspace/common/utils";
-import { isMobile, isMobileOnly } from "react-device-detect";
+
import toastr from "@docspace/components/toast/toastr";
import config from "PACKAGE_FILE";
import { thumbnailStatuses } from "@docspace/client/src/helpers/filesConstants";
@@ -25,7 +25,7 @@ import {
getCategoryUrl,
getCategoryTypeByFolderType,
} from "SRC_DIR/helpers/utils";
-import { isDesktop } from "@docspace/components/utils/device";
+import { isDesktop, isMobile } from "@docspace/components/utils/device";
import { PluginFileType } from "SRC_DIR/helpers/plugins/constants";
@@ -62,7 +62,7 @@ class FilesStore {
pluginStore;
viewAs =
- isMobile && storageViewAs !== "tile" ? "row" : storageViewAs || "table";
+ !isDesktop() && storageViewAs !== "tile" ? "row" : storageViewAs || "table";
dragging = false;
privacyInstructions = "https://www.onlyoffice.com/private-rooms.aspx";
@@ -86,7 +86,7 @@ class FilesStore {
filter = FilesFilter.getDefault();
roomsFilter = RoomsFilter.getDefault();
- membersFilter = { page: 0, pageCount: 100, total: 0 };
+ membersFilter = { page: 0, pageCount: 100, total: 0, startIndex: 0 };
categoryType = getCategoryType(window.location);
@@ -752,7 +752,11 @@ class FilesStore {
};
setIsEmptyPage = (isEmptyPage) => {
- this.isEmptyPage = isEmptyPage;
+ // this.isEmptyPage = isEmptyPage;
+
+ runInAction(() => {
+ this.isEmptyPage = isEmptyPage;
+ });
};
setIsLoadedEmptyPage = (isLoadedEmptyPage) => {
@@ -1039,6 +1043,8 @@ class FilesStore {
return roomType === RoomsType.ReviewRoom;
case `room-${RoomsType.ReadOnlyRoom}`:
return roomType === RoomsType.ReadOnlyRoom;
+ case `room-${RoomsType.PublicRoom}`:
+ return roomType === RoomsType.PublicRoom;
default:
return false;
}
@@ -1414,8 +1420,8 @@ class FilesStore {
} else {
this.setIsEmptyPage(isEmptyList);
}
- this.setFolders(isPrivacyFolder && isMobile ? [] : data.folders);
- this.setFiles(isPrivacyFolder && isMobile ? [] : data.files);
+ this.setFolders(isPrivacyFolder && !isDesktop() ? [] : data.folders);
+ this.setFiles(isPrivacyFolder && !isDesktop() ? [] : data.files);
});
if (clearFilter) {
@@ -1663,7 +1669,7 @@ class FilesStore {
tags ||
withoutTags;
- if (isFiltered) {
+ if (!!isFiltered) {
this.setIsEmptyPage(false);
} else {
this.setIsEmptyPage(isEmptyList);
@@ -2474,25 +2480,27 @@ class FilesStore {
}
getDefaultMembersFilter = () => {
- return { page: 0, pageCount: 100, total: 0 };
+ return { page: 0, pageCount: 100, total: 0, startIndex: 0 };
};
setRoomMembersFilter = (roomMembersFilter) => {
this.roomMembersFilter = roomMembersFilter;
};
- getRoomMembers = (id, clearFilter = true) => {
- let newFilter = clone(this.membersFilter);
+ getRoomMembers = (id, clearFilter = true, membersFilter) => {
+ let newFilter = membersFilter ? membersFilter : clone(this.membersFilter);
if (clearFilter) {
newFilter = this.getDefaultMembersFilter();
- } else {
+ } else if (!membersFilter) {
newFilter.page += 1;
+ newFilter.pageCount = 100;
+ newFilter.startIndex = newFilter.page * newFilter.pageCount;
+ this.setRoomMembersFilter(newFilter);
}
- this.setRoomMembersFilter(newFilter);
const membersFilters = {
- startIndex: newFilter.page * newFilter.pageCount,
+ startIndex: newFilter.startIndex,
count: newFilter.pageCount,
filterType: 0, // 0 (Members)
};
@@ -2563,7 +2571,7 @@ class FilesStore {
scrollToTop = () => {
if (this.authStore.settingsStore.withPaging) return;
- const scrollElm = isMobileOnly
+ const scrollElm = isMobile()
? document.querySelector("#customScrollBar > .scroll-wrapper > .scroller")
: document.querySelector("#sectionScroll > .scroll-wrapper > .scroller");
@@ -2914,8 +2922,6 @@ class FilesStore {
if (items.length > 0 && this.isEmptyPage) {
this.setIsEmptyPage(false);
- } else if (items.length === 0 && !this.isEmptyPage) {
- this.setIsEmptyPage(true);
}
const newItem = items.map((item) => {
@@ -3156,7 +3162,8 @@ class FilesStore {
elem !== `room-${RoomsType.CustomRoom}` &&
elem !== `room-${RoomsType.EditingRoom}` &&
elem !== `room-${RoomsType.ReviewRoom}` &&
- elem !== `room-${RoomsType.ReadOnlyRoom}`
+ elem !== `room-${RoomsType.ReadOnlyRoom}` &&
+ elem !== `room-${RoomsType.PublicRoom}`
);
if (hasFiles) cbMenu.push(FilterType.FilesOnly);
@@ -3196,6 +3203,8 @@ class FilesStore {
return t("Common:Review");
case `room-${RoomsType.ReadOnlyRoom}`:
return t("ViewOnlyRooms");
+ case `room-${RoomsType.PublicRoom}`:
+ return t("Common:PublicRoomLabel");
default:
return "";
@@ -3232,7 +3241,8 @@ class FilesStore {
return "selected-only-review-rooms";
case `room-${RoomsType.ReadOnlyRoom}`:
return "selected-only-view-rooms";
-
+ case `room-${RoomsType.PublicRoom}`:
+ return "selected-only-public-rooms";
default:
return "";
}
diff --git a/packages/client/src/store/HotkeyStore.js b/packages/client/src/store/HotkeyStore.js
index c2da309d89..8641864274 100644
--- a/packages/client/src/store/HotkeyStore.js
+++ b/packages/client/src/store/HotkeyStore.js
@@ -1,5 +1,5 @@
import { combineUrl } from "@docspace/common/utils";
-import { isDesktop } from "@docspace/components/utils/device";
+import { isDesktop, isMobile } from "@docspace/components/utils/device";
import { makeAutoObservable } from "mobx";
import config from "PACKAGE_FILE";
import { getCategoryUrl } from "SRC_DIR/helpers/utils";
@@ -42,7 +42,11 @@ class HotkeyStore {
scrollToCaret = () => {
const { offsetTop, item } = this.getItemOffset();
- const scroll = document.getElementsByClassName("section-scroll")[0];
+
+ const scroll = isMobile()
+ ? document.querySelector("#customScrollBar > .scroll-wrapper > .scroller")
+ : document.getElementsByClassName("section-scroll")[0];
+
const scrollRect = scroll?.getBoundingClientRect();
if (item && item[0]) {
@@ -75,7 +79,9 @@ class HotkeyStore {
infiniteLoaderComponent.tabIndex = -1;
}
- const someDialogIsOpen = checkDialogsOpen();
+ const { isViewerOpen } = this.filesActionsStore.mediaViewerDataStore;
+
+ const someDialogIsOpen = checkDialogsOpen() || isViewerOpen;
if (
someDialogIsOpen ||
@@ -157,10 +163,13 @@ class HotkeyStore {
if (filesList.length) {
// scroll to first element
- const scroll = document.querySelector(
- "#sectionScroll > .scroll-wrapper > .scroller"
- );
- scroll.scrollTo(0, 0);
+ const scroll = isMobile()
+ ? document.querySelector(
+ "#customScrollBar > .scroll-wrapper > .scroller"
+ )
+ : document.getElementsByClassName("section-scroll")[0];
+
+ scroll?.scrollTo(0, 0);
this.filesStore.setSelection([filesList[0]]);
this.setCaret(filesList[0]);
@@ -175,12 +184,8 @@ class HotkeyStore {
};
selectFile = () => {
- const {
- selection,
- setSelection,
- hotkeyCaret,
- setHotkeyCaretStart,
- } = this.filesStore;
+ const { selection, setSelection, hotkeyCaret, setHotkeyCaretStart } =
+ this.filesStore;
const index = selection.findIndex(
(f) => f.id === hotkeyCaret?.id && f.isFolder === hotkeyCaret?.isFolder
@@ -221,13 +226,8 @@ class HotkeyStore {
};
selectLeft = () => {
- const {
- hotkeyCaret,
- filesList,
- setHotkeyCaretStart,
- selection,
- viewAs,
- } = this.filesStore;
+ const { hotkeyCaret, filesList, setHotkeyCaretStart, selection, viewAs } =
+ this.filesStore;
if (viewAs !== "tile") return;
if (!hotkeyCaret && !selection.length) {
@@ -240,13 +240,8 @@ class HotkeyStore {
};
selectRight = () => {
- const {
- hotkeyCaret,
- filesList,
- setHotkeyCaretStart,
- selection,
- viewAs,
- } = this.filesStore;
+ const { hotkeyCaret, filesList, setHotkeyCaretStart, selection, viewAs } =
+ this.filesStore;
if (viewAs !== "tile") return;
if (!hotkeyCaret && !selection.length) {
@@ -501,12 +496,8 @@ class HotkeyStore {
};
selectAll = () => {
- const {
- filesList,
- hotkeyCaret,
- setHotkeyCaretStart,
- setSelected,
- } = this.filesStore;
+ const { filesList, hotkeyCaret, setHotkeyCaretStart, setSelected } =
+ this.filesStore;
setSelected("all");
if (!hotkeyCaret) {
diff --git a/packages/client/src/store/MediaViewerDataStore.js b/packages/client/src/store/MediaViewerDataStore.js
index e04364e6a9..c3a162b273 100644
--- a/packages/client/src/store/MediaViewerDataStore.js
+++ b/packages/client/src/store/MediaViewerDataStore.js
@@ -120,6 +120,10 @@ class MediaViewerDataStore {
this.changeUrl(fileId);
};
+ get isViewerOpen() {
+ return this.visible && this.playlist.length > 0;
+ }
+
get currentPostionIndex() {
if (this.playlist.length === 0) {
return 0;
diff --git a/packages/client/src/store/PeopleStore.js b/packages/client/src/store/PeopleStore.js
index 2a70e4bf3f..8664fbc975 100644
--- a/packages/client/src/store/PeopleStore.js
+++ b/packages/client/src/store/PeopleStore.js
@@ -23,7 +23,6 @@ import {
isTablet,
isDesktop,
} from "@docspace/components/utils/device";
-import { isMobileRDD } from "react-device-detect";
import toastr from "@docspace/components/toast/toastr";
import { EmployeeStatus, Events } from "@docspace/common/constants";
@@ -48,7 +47,7 @@ class PeopleStore {
accessRightsStore = null;
profileActionsStore = null;
isInit = false;
- viewAs = isMobileRDD ? "row" : "table";
+ viewAs = isDesktop() ? "table" : "row";
isLoadedProfileSectionBody = false;
constructor(authStore, setupStore, accessRightsStore, dialogsStore) {
@@ -253,9 +252,7 @@ class PeopleStore {
id: "menu-info",
key: "info",
label: t("Common:Info"),
- disabled:
- isVisible ||
- !(isTablet() || isMobile() || isMobileRDD || !isDesktop()),
+ disabled: isVisible || !(isTablet() || isMobile() || !isDesktop()),
onClick: (item) => this.onOpenInfoPanel(item),
iconUrl: InfoReactSvgUrl,
},
diff --git a/packages/client/src/store/PluginStore.js b/packages/client/src/store/PluginStore.js
index e67acafd6f..7fda9c085c 100644
--- a/packages/client/src/store/PluginStore.js
+++ b/packages/client/src/store/PluginStore.js
@@ -1,6 +1,5 @@
import { makeAutoObservable } from "mobx";
import { cloneDeep } from "lodash";
-import { isMobileOnly, isTablet } from "react-device-detect";
import api from "@docspace/common/api";
@@ -10,7 +9,6 @@ import {
PluginFileType,
PluginScopes,
PluginUsersType,
- PluginDevices,
PluginStatus,
} from "SRC_DIR/helpers/plugins/constants";
import { getPluginUrl, messageActions } from "SRC_DIR/helpers/plugins/utils";
@@ -366,6 +364,8 @@ class PluginStore {
getUserRole = () => {
const { user } = this.authStore.userStore;
+ if (!user) return PluginUsersType.user;
+
const { isOwner, isAdmin, isCollaborator, isVisitor } = user;
const userRole = isOwner
@@ -382,13 +382,9 @@ class PluginStore {
};
getCurrentDevice = () => {
- const device = isTablet
- ? PluginDevices.tablet
- : isMobileOnly
- ? PluginDevices.mobile
- : PluginDevices.desktop;
+ const { currentDeviceType } = this.authStore.settingsStore;
- return device;
+ return currentDeviceType;
};
getContextMenuKeysByType = (type, fileExst) => {
diff --git a/packages/client/src/store/ProfileActionsStore.js b/packages/client/src/store/ProfileActionsStore.js
index cc0e83bbbe..fce3d81755 100644
--- a/packages/client/src/store/ProfileActionsStore.js
+++ b/packages/client/src/store/ProfileActionsStore.js
@@ -12,11 +12,12 @@ import LogoutReactSvgUrl from "PUBLIC_DIR/images/logout.react.svg?url";
import { makeAutoObservable } from "mobx";
import { combineUrl } from "@docspace/common/utils";
-import { isDesktop, isTablet, isMobile } from "react-device-detect";
+import { isMobile } from "react-device-detect";
import { ZendeskAPI } from "@docspace/common/components/Zendesk";
import { LIVE_CHAT_LOCAL_STORAGE_KEY } from "@docspace/common/constants";
import toastr from "@docspace/components/toast/toastr";
+import { isDesktop, isTablet } from "@docspace/components/utils/device";
const PROXY_HOMEPAGE_URL = combineUrl(window.DocSpaceConfig?.proxy?.url, "/");
const PROFILE_SELF_URL = combineUrl(PROXY_HOMEPAGE_URL, "/profile");
@@ -165,7 +166,7 @@ class ProfileActionsStore {
};
onAboutClick = () => {
- if (isDesktop || isTablet) {
+ if (isDesktop() || isTablet()) {
this.setIsAboutDialogVisible(true);
} else {
window.DocSpace.navigate(ABOUT_URL);
diff --git a/packages/client/src/store/SettingsSetupStore.js b/packages/client/src/store/SettingsSetupStore.js
index a962f3e14b..1cf6e72f62 100644
--- a/packages/client/src/store/SettingsSetupStore.js
+++ b/packages/client/src/store/SettingsSetupStore.js
@@ -11,7 +11,7 @@ import {
} from "@docspace/common/api/settings";
import { combineUrl } from "@docspace/common/utils";
import config from "PACKAGE_FILE";
-import { isMobile } from "react-device-detect";
+import { isDesktop } from "@docspace/components/utils/device";
class SettingsSetupStore {
selectionStore = null;
@@ -19,7 +19,7 @@ class SettingsSetupStore {
isInit = false;
logoutVisible = false;
logoutAllVisible = false;
- viewAs = isMobile ? "row" : "table";
+ viewAs = isDesktop() ? "table" : "row";
isLoadingDownloadReport = false;
@@ -371,7 +371,7 @@ class SettingsSetupStore {
getLoginHistoryReport = async () => {
const res = await api.settings.getLoginHistoryReport();
- window.open(res);
+ setTimeout(() => window.open(res), 100); //hack for ios
return this.setAuditTrailReport(res);
};
@@ -379,7 +379,7 @@ class SettingsSetupStore {
try {
this.setIsLoadingDownloadReport(true);
const res = await api.settings.getAuditTrailReport();
- window.open(res);
+ setTimeout(() => window.open(res), 100); //hack for ios
return this.setAuditTrailReport(res);
} catch (error) {
console.error(error);
diff --git a/packages/client/src/store/UploadDataStore.js b/packages/client/src/store/UploadDataStore.js
index 1978b1471c..c72ef46f4a 100644
--- a/packages/client/src/store/UploadDataStore.js
+++ b/packages/client/src/store/UploadDataStore.js
@@ -17,7 +17,7 @@ import {
getFolder,
} from "@docspace/common/api/files";
import toastr from "@docspace/components/toast/toastr";
-import { isMobile } from "react-device-detect";
+
import {
isMobile as isMobileUtils,
isTablet as isTabletUtils,
@@ -501,10 +501,7 @@ class UploadDataStore {
const percent = this.getConversationPercent(index + 1);
- if (
- numberFiles === 1 &&
- !(isMobile || isMobileUtils() || isTabletUtils())
- ) {
+ if (numberFiles === 1 && !(isMobileUtils() || isTabletUtils())) {
this.setConversionPercent(progress);
} else {
this.setConversionPercent(percent);
diff --git a/packages/client/tests/catalog_tests.js b/packages/client/tests/catalog_tests.js
index c33fa86383..693b688e9d 100644
--- a/packages/client/tests/catalog_tests.js
+++ b/packages/client/tests/catalog_tests.js
@@ -170,7 +170,7 @@ Scenario("Catalog actions", ({ I }) => {
}
}
- if (deviceType === "tablet" || deviceType === "smallTablet") {
+ if (deviceType === "tablet") {
I.saveScreenshot(`catalog.close.png`);
if (!isModel) {
I.seeVisualDiff(`catalog.close.png`, {
diff --git a/packages/common/api/rooms/index.js b/packages/common/api/rooms/index.js
index 12ec2c4e11..162c902bf0 100644
--- a/packages/common/api/rooms/index.js
+++ b/packages/common/api/rooms/index.js
@@ -51,11 +51,9 @@ export function getRoomInfo(id) {
export function getRoomMembers(id, filter) {
let params = "";
- const str = toUrlParams(filter);
- if (str) {
- params = `?${str}`;
- }
+ const str = toUrlParams(filter);
+ if (str) params = `?${str}`;
const options = {
method: "get",
diff --git a/packages/common/components/AdvancedSelector/AdvancedSelector.js b/packages/common/components/AdvancedSelector/AdvancedSelector.js
index 08cb0b59c0..52bf3f3ba9 100644
--- a/packages/common/components/AdvancedSelector/AdvancedSelector.js
+++ b/packages/common/components/AdvancedSelector/AdvancedSelector.js
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
import styled, { css } from "styled-components";
import { isMobile } from "react-device-detect";
-import { tablet } from "@docspace/components/utils/device";
+import { tablet, mobile } from "@docspace/components/utils/device";
import { Base } from "@docspace/components/themes";
import Selector from "./sub-components/Selector";
@@ -38,7 +38,7 @@ const StyledBlock = styled.div`
max-width: calc(100% - 69px);
`}
- @media (max-width: 428px) {
+ @media ${mobile} {
bottom: 0;
top: unset;
height: calc(100% - 64px);
@@ -83,7 +83,7 @@ const StyledControlContainer = styled.div`
top: 18px;
`}
- @media (max-width: 428px) {
+ @media ${mobile} {
top: -27px;
${({ theme }) =>
diff --git a/packages/common/components/AppLoader/index.js b/packages/common/components/AppLoader/index.js
index 7216d9ccb8..34cfe60425 100644
--- a/packages/common/components/AppLoader/index.js
+++ b/packages/common/components/AppLoader/index.js
@@ -1,13 +1,28 @@
import React from "react";
-import Section from "../Section";
+import styled from "styled-components";
import Loader from "@docspace/components/loader";
+import { Base } from "@docspace/components/themes";
+
+const StyledContainer = styled.div`
+ // width: 100vw;
+ // height: 100vh;
+ overflow: hidden;
+ background: ${(props) => props.theme.backgroundColor};
+ z-index: 5000;
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+`;
+
+StyledContainer.defaultProps = { theme: Base };
+
const AppLoader = () => (
-
+
+
+
);
export default AppLoader;
diff --git a/packages/common/components/Article/index.js b/packages/common/components/Article/index.js
index e6e9c3b3d3..765cc6a6e1 100644
--- a/packages/common/components/Article/index.js
+++ b/packages/common/components/Article/index.js
@@ -1,13 +1,7 @@
import React from "react";
import { inject, observer } from "mobx-react";
import PropTypes from "prop-types";
-import { isMobile, isMobileOnly, isTablet } from "react-device-detect";
-
-import {
- isDesktop as isDesktopUtils,
- isTablet as isTabletUtils,
- isMobile as isMobileUtils,
-} from "@docspace/components/utils/device";
+import { isMobile, isMobileOnly, isIOS } from "react-device-detect";
import SubArticleBackdrop from "./sub-components/article-backdrop";
import SubArticleHeader from "./sub-components/article-header";
@@ -20,6 +14,8 @@ import ArticleApps from "./sub-components/article-apps";
import { StyledArticle } from "./styled-article";
import HideArticleMenuButton from "./sub-components/article-hide-menu-button";
import Portal from "@docspace/components/portal";
+import { DeviceType } from "../../constants";
+import ArticleProfileLoader from "../Loaders/ArticleProfileLoader/ArticleProfileLoader";
const Article = ({
showText,
@@ -45,6 +41,8 @@ const Article = ({
onLogoClickAction,
theme,
+ currentDeviceType,
+ showArticleLoader,
...rest
}) => {
const [articleHeaderContent, setArticleHeaderContent] = React.useState(null);
@@ -52,22 +50,38 @@ const Article = ({
React.useState(null);
const [articleBodyContent, setArticleBodyContent] = React.useState(null);
const [correctTabletHeight, setCorrectTabletHeight] = React.useState(null);
+ const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] =
+ React.useState(false);
+ const updateSizeRef = React.useRef(null);
React.useEffect(() => {
- if (isMobileOnly) {
- window.addEventListener("popstate", onMobileBack);
- return () => window.removeEventListener("popstate", onMobileBack);
- }
+ window.addEventListener("popstate", onMobileBack);
+ return () => window.removeEventListener("popstate", onMobileBack);
}, [onMobileBack]);
React.useEffect(() => {
- window.addEventListener("resize", sizeChangeHandler);
- return () => window.removeEventListener("resize", sizeChangeHandler);
- }, []);
+ // const showArticle = JSON.parse(localStorage.getItem("showArticle"));
- React.useEffect(() => {
- sizeChangeHandler();
- }, []);
+ if (currentDeviceType === DeviceType.mobile) {
+ setShowText(true);
+ setIsMobileArticle(true);
+
+ return;
+ }
+
+ if (currentDeviceType === DeviceType.tablet) {
+ setIsMobileArticle(true);
+
+ // if (showArticle) return;
+
+ setShowText(false);
+
+ return;
+ }
+
+ setShowText(true);
+ setIsMobileArticle(false);
+ }, [setShowText, setIsMobileArticle, currentDeviceType]);
React.useEffect(() => {
React.Children.forEach(children, (child) => {
@@ -90,68 +104,66 @@ const Article = ({
});
}, [children]);
- const sizeChangeHandler = React.useCallback(() => {
- const showArticle = JSON.parse(localStorage.getItem("showArticle"));
-
- if (isMobileOnly || isMobileUtils() || window.innerWidth === 375) {
- setShowText(true);
- setIsMobileArticle(true);
- }
- if (
- ((isTabletUtils() && window.innerWidth !== 375) || isMobile) &&
- !isMobileOnly
- ) {
- setIsMobileArticle(true);
-
- if (showArticle) return;
-
- setShowText(false);
- }
- if (isDesktopUtils() && !isMobile) {
- setShowText(true);
- setIsMobileArticle(false);
- }
- }, [setShowText, setIsMobileArticle]);
-
const onMobileBack = React.useCallback(() => {
//close article
+ if (currentDeviceType !== DeviceType.mobile) return;
setArticleOpen(false);
- }, [setArticleOpen]);
+ }, [setArticleOpen, currentDeviceType]);
// TODO: make some better
- const onResize = React.useCallback(() => {
- let correctTabletHeight = window.innerHeight;
+ const onResize = React.useCallback(
+ (e) => {
+ let correctTabletHeight = window.innerHeight;
- if (mainBarVisible)
- correctTabletHeight -= window.innerHeight <= 768 ? 62 : 90;
+ if (mainBarVisible) {
+ const mainBar = document.getElementById("main-bar");
- const isTouchDevice =
- "ontouchstart" in window ||
- navigator.maxTouchPoints > 0 ||
- navigator.msMaxTouchPoints > 0;
+ if (!mainBar.offsetHeight)
+ return (updateSizeRef.current = setTimeout(() => onResize(), 0));
- const path = window.location.pathname.toLowerCase();
+ correctTabletHeight -= mainBar.offsetHeight;
+ }
- if (
- isBannerVisible &&
- isMobile &&
- isTouchDevice &&
- (path.includes("rooms") || path.includes("files"))
- )
- correctTabletHeight -= 80;
+ const isTouchDevice =
+ "ontouchstart" in window ||
+ navigator.maxTouchPoints > 0 ||
+ navigator.msMaxTouchPoints > 0;
- setCorrectTabletHeight(correctTabletHeight);
- }, [mainBarVisible, isBannerVisible]);
+ const path = window.location.pathname.toLowerCase();
+
+ if (
+ isBannerVisible &&
+ isMobile &&
+ isTouchDevice &&
+ (path.includes("rooms") || path.includes("files"))
+ ) {
+ correctTabletHeight -= 80;
+
+ if (e?.target?.height) {
+ const diff = window.innerHeight - e.target.height;
+ setIsVirtualKeyboardOpen(true);
+ correctTabletHeight -= diff;
+ } else {
+ setIsVirtualKeyboardOpen(false);
+ }
+ }
+
+ setCorrectTabletHeight(correctTabletHeight);
+ },
+ [mainBarVisible, isBannerVisible]
+ );
React.useEffect(() => {
- if (isTablet) {
- onResize();
- window.addEventListener("resize", onResize);
+ onResize();
+ window.addEventListener("resize", onResize);
+ if (isMobile && !isMobileOnly && isIOS) {
+ window?.visualViewport?.addEventListener("resize", onResize);
}
-
return () => {
window.removeEventListener("resize", onResize);
+ window?.visualViewport?.removeEventListener("resize", onResize);
+ clearTimeout(updateSizeRef.current);
};
}, [onResize]);
@@ -163,19 +175,20 @@ const Article = ({
articleOpen={articleOpen}
$withMainButton={withMainButton}
correctTabletHeight={correctTabletHeight}
+ isMobile={currentDeviceType === DeviceType.mobile}
{...rest}
>
{articleHeaderContent ? articleHeaderContent.props.children : null}
{articleMainButtonContent &&
withMainButton &&
- !isMobileOnly &&
- !isMobileUtils() ? (
+ currentDeviceType !== DeviceType.mobile ? (
{articleMainButtonContent.props.children}
@@ -183,32 +196,49 @@ const Article = ({
{articleBodyContent ? articleBodyContent.props.children : null}
+ {!showArticleLoader && (
+ <>
+
+
+ {!isMobile && isLiveChatAvailable && (
+
+ )}
+ >
+ )}
+
+ {!showArticleLoader && (
- {!hideProfileBlock && !isMobileOnly && (
-
- )}
+ )}
-
-
- {!isMobile && isLiveChatAvailable && (
-
- )}
-
+ {!hideProfileBlock && currentDeviceType !== DeviceType.mobile && (
+ <>
+ {showArticleLoader ? (
+
+ ) : (
+
+ )}
+ >
+ )}
- {articleOpen && (isMobileOnly || window.innerWidth <= 375) && (
+ {articleOpen && currentDeviceType === DeviceType.mobile && (
<>
>
)}
- {articleMainButtonContent && (isMobileOnly || isMobileUtils()) ? (
+ {articleMainButtonContent && currentDeviceType === DeviceType.mobile ? (
{articleMainButtonContent.props.children}
@@ -233,7 +263,9 @@ const Article = ({
// withMainButton,
// });
- return isMobileOnly ? renderPortalArticle() : articleComponent;
+ return currentDeviceType === DeviceType.mobile
+ ? renderPortalArticle()
+ : articleComponent;
};
Article.propTypes = {
@@ -279,6 +311,7 @@ export default inject(({ auth }) => {
setArticleOpen,
mainBarVisible,
theme,
+ currentDeviceType,
} = settingsStore;
return {
@@ -298,5 +331,6 @@ export default inject(({ auth }) => {
isLiveChatAvailable,
theme,
+ currentDeviceType,
};
})(observer(Article));
diff --git a/packages/common/components/Article/styled-article.js b/packages/common/components/Article/styled-article.js
index c8910473cd..c0ac7e396b 100644
--- a/packages/common/components/Article/styled-article.js
+++ b/packages/common/components/Article/styled-article.js
@@ -1,12 +1,6 @@
import styled, { css } from "styled-components";
-import { isMobile, isMobileOnly, isTablet } from "react-device-detect";
-import {
- mobile,
- tablet,
- isMobile as isMobileUtils,
- hugeMobile,
-} from "@docspace/components/utils/device";
+import { mobile, tablet } from "@docspace/components/utils/device";
import { Base } from "@docspace/components/themes";
import MenuIcon from "PUBLIC_DIR/images/menu.react.svg";
@@ -25,8 +19,6 @@ const StyledArticle = styled.article`
user-select: none;
- //padding: 0 20px;
-
${({ theme }) =>
theme.interfaceDirection === "rtl"
? `border-left: ${theme.catalog.verticalLine};`
@@ -38,20 +30,8 @@ const StyledArticle = styled.article`
height: ${(props) =>
props.correctTabletHeight ? `${props.correctTabletHeight}px` : `100%`};
-
- //padding: 0 8px;
}
- ${isTablet &&
- css`
- min-width: ${(props) => (props.showText ? "243px" : "60px")};
- max-width: ${(props) => (props.showText ? "243px" : "60px")};
- //padding: 0 8px;
-
- height: ${(props) =>
- props.correctTabletHeight ? `${props.correctTabletHeight}px` : `100%`};
- `}
-
@media ${mobile} {
display: ${(props) => (props.articleOpen ? "flex" : "none")};
flex-direction: column;
@@ -60,83 +40,38 @@ const StyledArticle = styled.article`
position: fixed;
margin: 0;
+ border: none;
+
height: calc(100% - 64px) !important;
- margin-top: 16px;
- //padding: 0 8px;
+ position: absolute;
+ top: 64px;
}
- ${isMobileOnly &&
- css`
- display: ${(props) => (props.articleOpen ? "flex" : "none")} !important;
- flex-direction: column;
-
- min-width: 100% !important;
- width: 100%;
- position: fixed;
- margin: 0;
- padding: 0;
- top: 64px;
- height: calc(100% - 64px) !important;
-
- ${({ theme }) =>
- theme.interfaceDirection === "rtl"
- ? `border-left: none;`
- : `border-right: none;`}
- `}
-
- z-index: ${(props) =>
- props.showText && (isMobileOnly || isMobileUtils()) ? "230" : "205"};
+ z-index: ${(props) => (props.showText && props.isMobile ? "230" : "205")};
.article-body__scrollbar {
height: ${(props) =>
`calc(100% - ${props.$withMainButton ? "190px" : "150px"})`} !important;
- ${!isMobileOnly &&
- css`
- @media ${tablet} {
- height: calc(100% - 126px) !important;
- }
- `}
+ @media ${tablet} {
+ height: calc(100% - 184px) !important;
+ }
@media ${mobile} {
height: 100% !important;
margin-top: 32px;
}
- @media ${hugeMobile} {
- height: 100% !important;
- }
-
- ${isTablet &&
- css`
- height: calc(100% - 126px) !important;
- `}
-
- ${isMobileOnly &&
- css`
- height: 100% !important;
- margin-top: 32px !important;
- `}
-
.article-scroller {
@media ${tablet} {
- height: calc(100% - 60px);
+ height: 100%;
+ height: 100% !important;
}
- ${isTablet &&
- css`
- height: calc(100% - 60px);
- `}
-
@media ${mobile} {
height: 100%;
}
-
- ${isMobileOnly &&
- css`
- height: 100%;
- `}
}
.scroll-body {
@@ -152,21 +87,10 @@ const StyledArticle = styled.article`
padding: 0 8px !important;
}
- ${isTablet &&
- css`
- padding: 0 8px !important;
- `}
-
@media ${mobile} {
display: block;
padding-bottom: 20px;
}
-
- ${isMobileOnly &&
- css`
- display: block;
- padding-bottom: 20px;
- `}
}
}
`;
@@ -193,30 +117,11 @@ const StyledArticleHeader = styled.div`
box-sizing: border-box;
}
- ${isTablet &&
- css`
- padding: 18px 8px 19px;
- margin: 0;
- justify-content: ${(props) => (props.showText ? "flex-start" : "center")};
-
- height: 61px;
- min-height: 61px;
- max-height: 61px;
- box-sizing: border-box;
- `}
-
@media ${mobile} {
border-bottom: ${(props) => props.theme.catalog.header.borderBottom};
padding: 12px 0 12px;
}
- ${isMobileOnly &&
- css`
- border-bottom: ${(props) =>
- props.theme.catalog.header.borderBottom} !important;
- padding: 12px 0 12px !important;
- `}
-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
`;
@@ -250,29 +155,12 @@ const StyledHeading = styled.div`
: `margin-left: 9px;`}
}
- ${isTablet &&
- css`
- display: ${(props) => (props.showText ? "block" : "none")};
- ${({ theme }) =>
- theme.interfaceDirection === "rtl"
- ? `margin-right: 9px !important;`
- : `margin-left: 9px !important`}
- `}
-
@media ${mobile} {
${({ theme }) =>
theme.interfaceDirection === "rtl"
? `margin-right: 0;`
: `margin-left: 0;`}
}
-
- ${isMobileOnly &&
- css`
- ${({ theme }) =>
- theme.interfaceDirection === "rtl"
- ? `margin-right: 0 !important;`
- : `margin-left: 0 !important;`}
- `}
`;
const StyledIconBox = styled.div`
@@ -289,19 +177,9 @@ const StyledIconBox = styled.div`
display: ${(props) => (props.showText ? "none" : "flex")};
}
- ${isTablet &&
- css`
- display: ${(props) => (props.showText ? "none" : "flex")};
- `}
-
@media ${mobile} {
display: none;
}
-
- ${isMobileOnly &&
- css`
- display: none !important;
- `}
`;
const StyledMenuIcon = styled(MenuIcon)`
@@ -326,12 +204,6 @@ const StyledArticleMainButton = styled.div`
padding: 0;
margin: 0;
}
-
- ${isMobile &&
- css`
- padding: 0;
- margin: 0;
- `}
`;
const StyledControlContainer = styled.div`
@@ -381,11 +253,6 @@ const StyledArticleProfile = styled.div`
padding: 16px 14px;
}
- ${isTablet &&
- css`
- padding: 16px 14px;
- `}
-
.profile-avatar {
cursor: pointer;
}
@@ -431,7 +298,7 @@ const StyledUserName = styled.div`
const StyledProfileWrapper = styled.div`
z-index: 209;
- position: fixed;
+ position: ${(props) => (props.isVirtualKeyboardOpen ? "absolute" : "fixed")};
bottom: 0;
${(props) =>
props.theme.interfaceDirection === "rtl"
@@ -449,12 +316,6 @@ const StyledProfileWrapper = styled.div`
min-width: ${(props) => (props.showText ? "243px" : "60px")};
max-width: ${(props) => (props.showText ? "243px" : "60px")};
}
-
- ${isTablet &&
- css`
- min-width: ${(props) => (props.showText ? "243px" : "60px")};
- max-width: ${(props) => (props.showText ? "243px" : "60px")};
- `}
`;
const StyledArticleAlertsComponent = styled.div`
diff --git a/packages/common/components/Article/sub-components/article-apps.js b/packages/common/components/Article/sub-components/article-apps.js
index 919905ab50..13296e36a0 100644
--- a/packages/common/components/Article/sub-components/article-apps.js
+++ b/packages/common/components/Article/sub-components/article-apps.js
@@ -12,8 +12,7 @@ import Text from "@docspace/components/text";
import IconButton from "@docspace/components/icon-button";
import { Base } from "@docspace/components/themes";
-import { desktop, tablet, hugeMobile } from "@docspace/components/utils/device";
-import { isTablet } from "react-device-detect";
+import { tablet, mobile } from "@docspace/components/utils/device";
const StyledArticleApps = styled.div`
display: flex;
@@ -34,7 +33,7 @@ const StyledArticleApps = styled.div`
`}
}
- @media ${hugeMobile} {
+ @media ${mobile} {
position: relative;
bottom: 0px;
margin-top: 32px;
diff --git a/packages/common/components/Article/sub-components/article-header.js b/packages/common/components/Article/sub-components/article-header.js
index 891c3e8ef7..2bd21e8d1b 100644
--- a/packages/common/components/Article/sub-components/article-header.js
+++ b/packages/common/components/Article/sub-components/article-header.js
@@ -2,10 +2,9 @@ import React from "react";
import PropTypes from "prop-types";
import { useNavigate } from "react-router-dom";
import Loaders from "@docspace/common/components/Loaders";
-import { isTablet as isTabletUtils } from "@docspace/components/utils/device";
+
import { Link } from "react-router-dom";
-import { isTablet, isMobileOnly } from "react-device-detect";
-import { isMobile } from "@docspace/components/utils/device";
+
import { inject, observer } from "mobx-react";
import {
StyledArticleHeader,
@@ -13,6 +12,7 @@ import {
StyledIconBox,
} from "../styled-article";
import { getLogoFromPath } from "../../../utils";
+import { DeviceType } from "../../../constants";
const ArticleHeader = ({
showText,
@@ -22,13 +22,11 @@ const ArticleHeader = ({
isBurgerLoading,
whiteLabelLogoUrls,
theme,
+ currentDeviceType,
...rest
}) => {
const navigate = useNavigate();
- const isTabletView =
- (isTabletUtils() || isTablet) && !isMobileOnly && !isMobile();
-
const onLogoClick = () => {
onLogoClickAction && onLogoClickAction();
navigate("/");
@@ -41,23 +39,24 @@ const ArticleHeader = ({
? getLogoFromPath(whiteLabelLogoUrls[0].path.dark)
: getLogoFromPath(whiteLabelLogoUrls[0].path.light);
- if (isMobileOnly || isMobile()) return <>>;
+ if (currentDeviceType === DeviceType.mobile) return <>>;
- const isLoadingComponent = isTabletView ? (
-
- ) : (
-
- );
+ const isLoadingComponent =
+ currentDeviceType === DeviceType.tablet ? (
+
+ ) : (
+
+ );
const mainComponent = (
<>
- {isTabletView && (
+ {currentDeviceType === DeviceType.tablet && (
)}
- {isTabletView ? (
+ {currentDeviceType === DeviceType.tablet ? (
) : (
diff --git a/packages/common/components/Article/sub-components/article-hide-menu-button.js b/packages/common/components/Article/sub-components/article-hide-menu-button.js
index 3ae467a918..0989233107 100644
--- a/packages/common/components/Article/sub-components/article-hide-menu-button.js
+++ b/packages/common/components/Article/sub-components/article-hide-menu-button.js
@@ -3,7 +3,7 @@ import styled, { css } from "styled-components";
import Text from "@docspace/components/text";
import { ReactSVG } from "react-svg";
import { desktop, mobile, tablet } from "@docspace/components/utils/device";
-import { isTablet, isMobileOnly } from "react-device-detect";
+
import { useTranslation } from "react-i18next";
import Base from "@docspace/components/themes/base";
import ArticleHideMenuReactSvgUrl from "PUBLIC_DIR/images/article-hide-menu.react.svg?url";
@@ -12,11 +12,11 @@ import ArticleShowMenuReactSvgUrl from "PUBLIC_DIR/images/article-show-menu.reac
const StyledHideArticleMenuButton = styled.div`
display: flex;
align-items: center;
- position: fixed;
+ position: ${(props) => (props.isVirtualKeyboardOpen ? "absolute" : "fixed")};
height: 44px;
- z-index: 209;
+ z-index: 510;
bottom: 89px;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
right: 0;
@@ -31,24 +31,16 @@ const StyledHideArticleMenuButton = styled.div`
max-width: ${({ showText }) => (showText ? "243px" : "60px")};
@media ${desktop} {
- ${!isTablet &&
- css`
- display: none;
- `}
+ display: none;
}
@media ${mobile} {
display: none;
}
- ${isMobileOnly &&
- css`
- display: none;
- `}
-
.article-hide-menu-container {
align-items: center;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 16px;
@@ -57,7 +49,7 @@ const StyledHideArticleMenuButton = styled.div`
margin-left: 16px;
`}
.article-hide-menu-text {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 8px;
@@ -71,11 +63,6 @@ const StyledHideArticleMenuButton = styled.div`
@media ${tablet} {
display: ${({ showText }) => (showText ? "flex" : "none")};
}
-
- ${isTablet &&
- css`
- display: ${({ showText }) => (showText ? "flex" : "none")};
- `}
}
.article-show-menu-container {
@@ -85,17 +72,12 @@ const StyledHideArticleMenuButton = styled.div`
@media ${tablet} {
display: ${({ showText }) => (showText ? "none" : "flex")};
}
-
- ${isTablet &&
- css`
- display: ${({ showText }) => (showText ? "none" : "flex")};
- `}
}
.article-hide-menu-icon_svg,
.article-show-menu-icon_svg {
height: 28px;
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl" &&
css`
transform: scaleX(-1);
@@ -103,7 +85,7 @@ const StyledHideArticleMenuButton = styled.div`
}
.article-hide-menu-icon_svg {
- ${props =>
+ ${(props) =>
props.theme.interfaceDirection === "rtl" &&
css`
transform: scaleX(-1);
@@ -118,7 +100,7 @@ const StyledHideArticleMenuButton = styled.div`
.article-show-menu-icon_svg {
svg {
path {
- fill: ${props => props.theme.article.catalogShowText};
+ fill: ${(props) => props.theme.article.catalogShowText};
}
}
}
@@ -130,6 +112,7 @@ const HideArticleMenuButton = ({
showText,
toggleShowText,
currentColorScheme,
+ isVirtualKeyboardOpen,
}) => {
const { t } = useTranslation("Common");
@@ -137,11 +120,14 @@ const HideArticleMenuButton = ({
+ currentColorScheme={currentColorScheme}
+ isVirtualKeyboardOpen={isVirtualKeyboardOpen}
+ >
{showText ? (
) : (