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