feat: connection section for mobile
This commit is contained in:
@@ -15,12 +15,9 @@ function ConnectionPanel({
|
|||||||
onDisconnect: () => void;
|
onDisconnect: () => void;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
const statusLabel =
|
const connected = isConnected(dsp);
|
||||||
isConnected(dsp)
|
const status = dsp.isConnecting ? 'connecting' : connected ? 'connected' : 'disconnected';
|
||||||
? 'Connected'
|
const statusLabel = { connecting: 'Connecting…', connected: 'Connected', disconnected: 'Disconnected' }[status];
|
||||||
: dsp.isConnecting
|
|
||||||
? 'Connecting…'
|
|
||||||
: 'Disconnected';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="connection-section">
|
<div className="connection-section">
|
||||||
@@ -36,7 +33,7 @@ function ConnectionPanel({
|
|||||||
|
|
||||||
<div className="connection-panel__status">
|
<div className="connection-panel__status">
|
||||||
<span className="connection-panel__led">
|
<span className="connection-panel__led">
|
||||||
<Led status={dsp.isConnecting ? "connecting" : isConnected(dsp) ? "connected" : "disconnected"} />
|
<Led status={status} />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>{statusLabel}</span>
|
<span>{statusLabel}</span>
|
||||||
@@ -65,7 +62,7 @@ function ConnectionPanel({
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div className="connection-panel__actions">
|
<div className="connection-panel__actions">
|
||||||
{isConnected(dsp) ? (
|
{connected ? (
|
||||||
<Button variant="outline" onClick={onDisconnect}>
|
<Button variant="outline" onClick={onDisconnect}>
|
||||||
Disconnect
|
Disconnect
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||||
.dsp-content,
|
.dsp-content,
|
||||||
.dsp-loading-overlay,
|
.dsp-loading-overlay,
|
||||||
.app-root:has(.sidebar-rail--expanded) .dsp-content,
|
.app-root:has(.sidebar-rail--expanded) .dsp-content,
|
||||||
|
|||||||
Reference in New Issue
Block a user