Add proper support for room selection from the enu
This commit is contained in:
parent
31e4a02d27
commit
2a10347515
2 changed files with 21 additions and 16 deletions
|
|
@ -45,10 +45,12 @@ import {
|
|||
CreateRoomVoiceSelector,
|
||||
} from '../../components/create-room/CreateRoomVoiceSelector';
|
||||
|
||||
const getCreateRoomKindToIcon = (kind: CreateRoomKind) => {
|
||||
if (kind === CreateRoomKind.Private) return Icons.HashLock;
|
||||
if (kind === CreateRoomKind.Restricted) return Icons.Hash;
|
||||
return Icons.HashGlobe;
|
||||
const getCreateRoomKindToIcon = (kind: CreateRoomKind, voice?: CreateRoomVoice) => {
|
||||
const isVoiceRoom = voice === CreateRoomVoice.VoiceRoom;
|
||||
// TODO: Add VoiceLock and VoiceGlobe icons
|
||||
if (kind === CreateRoomKind.Private) return isVoiceRoom ? Icons.Lock : Icons.HashLock;
|
||||
if (kind === CreateRoomKind.Restricted) return isVoiceRoom ? Icons.VolumeHigh : Icons.Hash;
|
||||
return isVoiceRoom ? Icons.VolumeHigh : Icons.HashGlobe;
|
||||
};
|
||||
|
||||
const getCreateRoomVoiceToIcon = (kind: CreateRoomVoice) => {
|
||||
|
|
@ -165,6 +167,7 @@ export function CreateRoomForm({
|
|||
|
||||
return (
|
||||
<Box as="form" onSubmit={handleSubmit} grow="Yes" direction="Column" gap="500">
|
||||
{!space && (
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Type</Text>
|
||||
<CreateRoomVoiceSelector
|
||||
|
|
@ -174,6 +177,7 @@ export function CreateRoomForm({
|
|||
getIcon={getCreateRoomVoiceToIcon}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
<Box direction="Column" gap="100">
|
||||
<Text size="L400">Access</Text>
|
||||
<CreateRoomKindSelector
|
||||
|
|
@ -181,14 +185,14 @@ export function CreateRoomForm({
|
|||
onSelect={setKind}
|
||||
canRestrict={allowRestricted}
|
||||
disabled={disabled}
|
||||
getIcon={getCreateRoomKindToIcon}
|
||||
getIcon={(roomKind) => getCreateRoomKindToIcon(roomKind, voice)}
|
||||
/>
|
||||
</Box>
|
||||
<Box shrink="No" direction="Column" gap="100">
|
||||
<Text size="L400">Name</Text>
|
||||
<Input
|
||||
required
|
||||
before={<Icon size="100" src={getCreateRoomKindToIcon(kind)} />}
|
||||
before={<Icon size="100" src={getCreateRoomKindToIcon(kind, voice)} />}
|
||||
name="nameInput"
|
||||
autoFocus
|
||||
size="500"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import {
|
|||
} from '../../state/hooks/createRoomModal';
|
||||
import { CreateRoomModalState } from '../../state/createRoomModal';
|
||||
import { stopPropagation } from '../../utils/keyboard';
|
||||
import { CreateRoomVoice } from '../../components/create-room/CreateRoomVoiceSelector';
|
||||
|
||||
type CreateRoomModalProps = {
|
||||
state: CreateRoomModalState;
|
||||
|
|
@ -58,7 +59,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
|
|||
}}
|
||||
>
|
||||
<Box grow="Yes">
|
||||
<Text size="H4">New Room</Text>
|
||||
<Text size="H4">New {voice === CreateRoomVoice.VoiceRoom && 'Voice '}Room</Text>
|
||||
</Box>
|
||||
<Box shrink="No">
|
||||
<IconButton size="300" radii="300" onClick={closeDialog}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue