hide channelselect instead of disabling

This commit is contained in:
sektordv 2021-08-06 20:54:18 +02:00
parent 2fa6d42f5e
commit 026bd80e15
2 changed files with 1 additions and 5 deletions

View file

@ -23,13 +23,11 @@ const useStyles = makeStyles(
export interface AppChannelSelectProps extends ChannelProps {
channels: ChannelFragment[];
disabled: boolean;
onChannelSelect: (id: string) => void;
}
const AppChannelSelect: React.FC<AppChannelSelectProps> = ({
channels,
disabled,
onChannelSelect,
selectedChannelId
}) => {
@ -40,7 +38,6 @@ const AppChannelSelect: React.FC<AppChannelSelectProps> = ({
<SingleSelectField
testId="app-channel-select"
choices={mapNodeToChoice(channels)}
disabled={disabled}
value={selectedChannelId}
onChange={event => onChannelSelect(event.target.value)}
/>

View file

@ -216,10 +216,9 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
.includes("mac")}
onClick={() => setNavigatorVisibility(true)}
/>
{channel && location.pathname === "/" && (
{channel && isPickerActive && (
<AppChannelSelect
channels={availableChannels}
disabled={!isPickerActive}
selectedChannelId={channel.id}
onChannelSelect={setChannel}
/>