From 5716b75711888978a38b44d4c4576c930d698182 Mon Sep 17 00:00:00 2001
From: Ajay Bura <32841439+ajbura@users.noreply.github.com>
Date: Sun, 26 Jan 2025 21:12:41 +0530
Subject: [PATCH] add device placeholder tile
---
.../features/settings/devices/DeviceTile.tsx | 28 +++++++-
src/app/features/settings/devices/Devices.tsx | 67 ++++---------------
2 files changed, 39 insertions(+), 56 deletions(-)
diff --git a/src/app/features/settings/devices/DeviceTile.tsx b/src/app/features/settings/devices/DeviceTile.tsx
index 314d3545..1d948c43 100644
--- a/src/app/features/settings/devices/DeviceTile.tsx
+++ b/src/app/features/settings/devices/DeviceTile.tsx
@@ -1,11 +1,37 @@
import React, { FormEventHandler, useCallback, useEffect, useState } from 'react';
-import { Box, Text, IconButton, Icon, Icons, Chip, Input, Button, color, Spinner } from 'folds';
+import {
+ Box,
+ Text,
+ IconButton,
+ Icon,
+ Icons,
+ Chip,
+ Input,
+ Button,
+ color,
+ Spinner,
+ toRem,
+} from 'folds';
import { IMyDevice, MatrixError } from 'matrix-js-sdk';
import { SettingTile } from '../../../components/setting-tile';
import { useMatrixClient } from '../../../hooks/useMatrixClient';
import { timeDayMonYear, timeHourMinute, today, yesterday } from '../../../utils/time';
import { BreakWord } from '../../../styles/Text.css';
import { AsyncStatus, useAsyncCallback } from '../../../hooks/useAsyncCallback';
+import { SequenceCard } from '../../../components/sequence-card';
+import { SequenceCardStyle } from '../styles.css';
+
+export function DeviceTilePlaceholder() {
+ return (
+
+ );
+}
function DeviceActiveTime({ ts }: { ts: number }) {
return (
diff --git a/src/app/features/settings/devices/Devices.tsx b/src/app/features/settings/devices/Devices.tsx
index fb1ee4e2..7849bab1 100644
--- a/src/app/features/settings/devices/Devices.tsx
+++ b/src/app/features/settings/devices/Devices.tsx
@@ -1,17 +1,5 @@
import React, { useCallback, useState } from 'react';
-import {
- Box,
- Text,
- IconButton,
- Icon,
- Icons,
- Scroll,
- Button,
- Spinner,
- toRem,
- Menu,
- config,
-} from 'folds';
+import { Box, Text, IconButton, Icon, Icons, Scroll, Button, Spinner, Menu, config } from 'folds';
import { AuthDict, MatrixError } from 'matrix-js-sdk';
import { Page, PageContent, PageHeader } from '../../../components/page';
import { SequenceCard } from '../../../components/sequence-card';
@@ -23,46 +11,13 @@ import { AsyncState, AsyncStatus, useAsync } from '../../../hooks/useAsyncCallba
import { ActionUIA, ActionUIAFlowsLoader } from '../../../components/ActionUIA';
import { useUIAMatrixError } from '../../../hooks/useUIAFlows';
import { LocalBackup } from './LocalBackup';
-import { DeviceTile } from './DeviceTile';
+import { DeviceTile, DeviceTilePlaceholder } from './DeviceTile';
function DevicesPlaceholder() {
return (
-
-
-
-
-
+
+
);
}
@@ -236,10 +191,9 @@ export function Devices({ requestClose }: DevicesProps) {
/>
- {devices === null && }
- {currentDevice && (
-
- Current
+
+ Current
+ {currentDevice ? (
-
- )}
+ ) : (
+
+ )}
+
+ {devices === null && }
{otherDevices && otherDevices.length > 0 && (
Others