Web: Files: fixed view for mobile devices
This commit is contained in:
parent
bab3425bd1
commit
790d696a58
@ -2,12 +2,13 @@ import React, { useEffect } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import RowContainer from "@appserver/components/row-container";
|
||||
import SimpleFilesRow from "./SimpleFilesRow";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const FilesRowContainer = ({ filesList, sectionWidth, viewAs, setViewAs }) => {
|
||||
useEffect(() => {
|
||||
if ((viewAs !== "table" && viewAs !== "row") || !sectionWidth) return;
|
||||
|
||||
if (sectionWidth < 1025) {
|
||||
if (sectionWidth < 1025 || isMobile) {
|
||||
viewAs !== "row" && setViewAs("row");
|
||||
} else {
|
||||
viewAs !== "table" && setViewAs("table");
|
||||
|
@ -4,6 +4,7 @@ import { inject, observer } from "mobx-react";
|
||||
import TableRow from "./TableRow";
|
||||
import TableHeader from "./TableHeader";
|
||||
import TableBody from "@appserver/components/table-container/TableBody";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const Table = ({ filesList, sectionWidth, viewAs, setViewAs }) => {
|
||||
const ref = useRef(null);
|
||||
@ -11,7 +12,7 @@ const Table = ({ filesList, sectionWidth, viewAs, setViewAs }) => {
|
||||
useEffect(() => {
|
||||
if ((viewAs !== "table" && viewAs !== "row") || !setViewAs) return;
|
||||
|
||||
if (sectionWidth < 1025) {
|
||||
if (sectionWidth < 1025 || isMobile) {
|
||||
viewAs !== "row" && setViewAs("row");
|
||||
} else {
|
||||
viewAs !== "table" && setViewAs("table");
|
||||
|
@ -3,6 +3,7 @@ import { inject, observer } from "mobx-react";
|
||||
import RowContainer from "@appserver/components/row-container";
|
||||
import SimpleUserRow from "./SimpleUserRow";
|
||||
import EmptyScreen from "../EmptyScreen";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const PeopleRowContainer = ({
|
||||
peopleList,
|
||||
@ -13,7 +14,7 @@ const PeopleRowContainer = ({
|
||||
useEffect(() => {
|
||||
if (viewAs !== "table" && viewAs !== "row") return;
|
||||
|
||||
if (sectionWidth < 1025) {
|
||||
if (sectionWidth < 1025 || isMobile) {
|
||||
viewAs !== "row" && setViewAs("row");
|
||||
} else {
|
||||
viewAs !== "table" && setViewAs("table");
|
||||
|
@ -5,13 +5,14 @@ import TableRow from "./TableRow";
|
||||
import TableHeader from "./TableHeader";
|
||||
import TableBody from "@appserver/components/table-container/TableBody";
|
||||
import EmptyScreen from "../EmptyScreen";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const Table = ({ peopleList, sectionWidth, viewAs, setViewAs }) => {
|
||||
const ref = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!sectionWidth) return;
|
||||
if (sectionWidth < 1025) {
|
||||
if (sectionWidth < 1025 || isMobile) {
|
||||
viewAs !== "row" && setViewAs("row");
|
||||
} else {
|
||||
viewAs !== "table" && setViewAs("table");
|
||||
|
Loading…
Reference in New Issue
Block a user