style(settings): flatten the device list to match the Dawn list, tinting pending-delete rows instead of boxing them
This commit is contained in:
parent
172b00a732
commit
1de93f3c88
3 changed files with 20 additions and 27 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Text } from 'folds';
|
import { Box, Text } from 'folds';
|
||||||
import { SequenceCard } from '../../../components/sequence-card';
|
import { SectionLabel, SettingFlatRow } from '../styles.css';
|
||||||
import { SectionLabel, SettingRow } from '../styles.css';
|
|
||||||
import { SettingTile } from '../../../components/setting-tile';
|
import { SettingTile } from '../../../components/setting-tile';
|
||||||
import { SettingsPage } from '../SettingsPage';
|
import { SettingsPage } from '../SettingsPage';
|
||||||
import { SettingsSection } from '../SettingsSection';
|
import { SettingsSection } from '../SettingsSection';
|
||||||
|
|
@ -94,13 +93,7 @@ export function Devices({ requestClose }: DevicesProps) {
|
||||||
{t('Settings.current')}
|
{t('Settings.current')}
|
||||||
</Text>
|
</Text>
|
||||||
{currentDevice ? (
|
{currentDevice ? (
|
||||||
<SequenceCard
|
<Box className={SettingFlatRow} direction="Column" gap="400">
|
||||||
className={SettingRow}
|
|
||||||
variant="Background"
|
|
||||||
outlined
|
|
||||||
direction="Column"
|
|
||||||
gap="400"
|
|
||||||
>
|
|
||||||
<DeviceTile
|
<DeviceTile
|
||||||
device={currentDevice}
|
device={currentDevice}
|
||||||
refreshDeviceList={refreshDeviceList}
|
refreshDeviceList={refreshDeviceList}
|
||||||
|
|
@ -120,7 +113,7 @@ export function Devices({ requestClose }: DevicesProps) {
|
||||||
{crypto && verificationStatus === VerificationStatus.Verified && (
|
{crypto && verificationStatus === VerificationStatus.Verified && (
|
||||||
<BackupRestoreTile crypto={crypto} />
|
<BackupRestoreTile crypto={crypto} />
|
||||||
)}
|
)}
|
||||||
</SequenceCard>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<DeviceTilePlaceholder />
|
<DeviceTilePlaceholder />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, config, Menu, Spinner, Text } from 'folds';
|
import { Box, Button, config, Menu, Spinner, Text } from 'folds';
|
||||||
import { AuthDict, IMyDevice, MatrixError } from 'matrix-js-sdk';
|
import { AuthDict, IMyDevice, MatrixError } from 'matrix-js-sdk';
|
||||||
import { SequenceCard } from '../../../components/sequence-card';
|
import classNames from 'classnames';
|
||||||
import { SectionLabel, SettingRow } from '../styles.css';
|
import { SectionLabel, SettingFlatRow, SettingFlatRowCritical } from '../styles.css';
|
||||||
import { ActionUIA, ActionUIAFlowsLoader } from '../../../components/ActionUIA';
|
import { ActionUIA, ActionUIAFlowsLoader } from '../../../components/ActionUIA';
|
||||||
import { DeviceDeleteBtn, DeviceTile } from './DeviceTile';
|
import { DeviceDeleteBtn, DeviceTile } from './DeviceTile';
|
||||||
import { AsyncState, AsyncStatus, useAsync } from '../../../hooks/useAsyncCallback';
|
import { AsyncState, AsyncStatus, useAsync } from '../../../hooks/useAsyncCallback';
|
||||||
|
|
@ -110,14 +110,7 @@ export function OtherDevices({ devices, refreshDeviceList, showVerification }: O
|
||||||
</Text>
|
</Text>
|
||||||
<Box direction="Column">
|
<Box direction="Column">
|
||||||
{authMetadata && (
|
{authMetadata && (
|
||||||
<SequenceCard
|
<Box className={SettingFlatRow} direction="Column" gap="400">
|
||||||
className={SettingRow}
|
|
||||||
variant="Background"
|
|
||||||
outlined
|
|
||||||
mergeBorder
|
|
||||||
direction="Column"
|
|
||||||
gap="400"
|
|
||||||
>
|
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title={t('Settings.device_dashboard')}
|
title={t('Settings.device_dashboard')}
|
||||||
description={t('Settings.device_dashboard_desc')}
|
description={t('Settings.device_dashboard_desc')}
|
||||||
|
|
@ -134,7 +127,7 @@ export function OtherDevices({ devices, refreshDeviceList, showVerification }: O
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{devices
|
{devices
|
||||||
.sort((d1, d2) => {
|
.sort((d1, d2) => {
|
||||||
|
|
@ -142,12 +135,12 @@ export function OtherDevices({ devices, refreshDeviceList, showVerification }: O
|
||||||
return d1.last_seen_ts < d2.last_seen_ts ? 1 : -1;
|
return d1.last_seen_ts < d2.last_seen_ts ? 1 : -1;
|
||||||
})
|
})
|
||||||
.map((device) => (
|
.map((device) => (
|
||||||
<SequenceCard
|
<Box
|
||||||
key={device.device_id}
|
key={device.device_id}
|
||||||
className={SettingRow}
|
className={classNames(
|
||||||
variant={deleted.has(device.device_id) ? 'Critical' : 'Background'}
|
SettingFlatRow,
|
||||||
outlined
|
deleted.has(device.device_id) && SettingFlatRowCritical
|
||||||
mergeBorder={!deleted.has(device.device_id)}
|
)}
|
||||||
direction="Column"
|
direction="Column"
|
||||||
gap="400"
|
gap="400"
|
||||||
>
|
>
|
||||||
|
|
@ -186,7 +179,7 @@ export function OtherDevices({ devices, refreshDeviceList, showVerification }: O
|
||||||
}
|
}
|
||||||
</DeviceVerificationStatus>
|
</DeviceVerificationStatus>
|
||||||
)}
|
)}
|
||||||
</SequenceCard>
|
</Box>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,13 @@ export const SettingFlatRow = style({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// A flat row in a destructive/pending state — replaces the old Critical-variant
|
||||||
|
// boxed card (e.g. a device marked for deletion) with a full-bleed critical tint.
|
||||||
|
export const SettingFlatRowCritical = style({
|
||||||
|
backgroundColor: color.Critical.Container,
|
||||||
|
color: color.Critical.OnContainer,
|
||||||
|
});
|
||||||
|
|
||||||
// A full-bleed hairline rule under a section/profile header — the "ДОСТУП ───"
|
// A full-bleed hairline rule under a section/profile header — the "ДОСТУП ───"
|
||||||
// divider in the flat layout.
|
// divider in the flat layout.
|
||||||
export const SettingRule = style({
|
export const SettingRule = style({
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue