hide channelselect instead of disabling
This commit is contained in:
parent
2fa6d42f5e
commit
026bd80e15
2 changed files with 1 additions and 5 deletions
|
@ -23,13 +23,11 @@ const useStyles = makeStyles(
|
||||||
|
|
||||||
export interface AppChannelSelectProps extends ChannelProps {
|
export interface AppChannelSelectProps extends ChannelProps {
|
||||||
channels: ChannelFragment[];
|
channels: ChannelFragment[];
|
||||||
disabled: boolean;
|
|
||||||
onChannelSelect: (id: string) => void;
|
onChannelSelect: (id: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppChannelSelect: React.FC<AppChannelSelectProps> = ({
|
const AppChannelSelect: React.FC<AppChannelSelectProps> = ({
|
||||||
channels,
|
channels,
|
||||||
disabled,
|
|
||||||
onChannelSelect,
|
onChannelSelect,
|
||||||
selectedChannelId
|
selectedChannelId
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -40,7 +38,6 @@ const AppChannelSelect: React.FC<AppChannelSelectProps> = ({
|
||||||
<SingleSelectField
|
<SingleSelectField
|
||||||
testId="app-channel-select"
|
testId="app-channel-select"
|
||||||
choices={mapNodeToChoice(channels)}
|
choices={mapNodeToChoice(channels)}
|
||||||
disabled={disabled}
|
|
||||||
value={selectedChannelId}
|
value={selectedChannelId}
|
||||||
onChange={event => onChannelSelect(event.target.value)}
|
onChange={event => onChannelSelect(event.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -216,10 +216,9 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
|
||||||
.includes("mac")}
|
.includes("mac")}
|
||||||
onClick={() => setNavigatorVisibility(true)}
|
onClick={() => setNavigatorVisibility(true)}
|
||||||
/>
|
/>
|
||||||
{channel && location.pathname === "/" && (
|
{channel && isPickerActive && (
|
||||||
<AppChannelSelect
|
<AppChannelSelect
|
||||||
channels={availableChannels}
|
channels={availableChannels}
|
||||||
disabled={!isPickerActive}
|
|
||||||
selectedChannelId={channel.id}
|
selectedChannelId={channel.id}
|
||||||
onChannelSelect={setChannel}
|
onChannelSelect={setChannel}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue