diff --git a/src/CallList.module.css b/src/CallList.module.css index 907cc987..4cffe4ba 100644 --- a/src/CallList.module.css +++ b/src/CallList.module.css @@ -1,12 +1,13 @@ .callTile { display: flex; - width: 329px; + min-width: 240px; height: 94px; padding: 12px; text-decoration: none; background-color: var(--bgColor2); border-radius: 8px; overflow: hidden; + box-sizing: border-box; } .avatar, @@ -54,9 +55,7 @@ } .callList { - display: flex; - flex-wrap: wrap; - justify-content: flex-start; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; - flex: 1; } diff --git a/src/ConferenceCallManagerHooks.jsx b/src/ConferenceCallManagerHooks.jsx index 03f06bca..53d4b9e4 100644 --- a/src/ConferenceCallManagerHooks.jsx +++ b/src/ConferenceCallManagerHooks.jsx @@ -297,7 +297,6 @@ export function ClientProvider({ homeserverUrl, children }) { loading: false, isGuest: false, isAuthenticated: true, - isGuest: false, userName: client.getUserIdLocalpart(), }); @@ -407,40 +406,21 @@ export async function createRoom(client, name) { return room_alias || room_id; } -export function useCreateRoom(client) { - const [creatingRoom, setCreatingRoom] = useState(false); - const [createRoomError, setCreateRoomError] = useState(); - - const onCreateRoom = useCallback( - (roomName) => { - setCreateRoomError(undefined); - setCreatingRoom(true); - - return createRoom(client, roomName).catch((error) => { - setCreateRoomError(error); - setCreatingRoom(false); - }); - }, - [client] - ); - - return { - creatingRoom, - createRoomError, - createRoom: onCreateRoom, - }; -} - -export function useCreateRoomAsPasswordlessUser() { - const { register } = useClient(); +export function useCreateRoom() { + const { register, client } = useClient(); const [creatingRoom, setCreatingRoom] = useState(false); const [createRoomError, setCreateRoomError] = useState(); const onCreateRoom = useCallback( (roomName, userName) => { async function onCreateRoom(roomName, userName) { - const client = await register(userName, randomString(16)); - return await createRoom(client, roomName); + let _client = client; + + if (!_client) { + _client = await register(userName, randomString(16)); + } + + return await createRoom(_client, roomName); } setCreateRoomError(undefined); @@ -451,7 +431,7 @@ export function useCreateRoomAsPasswordlessUser() { setCreatingRoom(false); }); }, - [register] + [register, client] ); return { diff --git a/src/Header.module.css b/src/Header.module.css index dc0950b6..dc2b8ca3 100644 --- a/src/Header.module.css +++ b/src/Header.module.css @@ -3,16 +3,17 @@ display: flex; justify-content: space-between; align-items: center; - height: 64px; user-select: none; flex-shrink: 0; } .nav { display: flex; + flex: 1; align-items: center; white-space: nowrap; - margin: 0 20px; + padding: 0 20px; + height: 64px; } .logo { @@ -25,6 +26,10 @@ margin-right: 12px; } +.rightNav { + justify-content: flex-end; +} + .rightNav > * { margin-right: 24px; } @@ -88,7 +93,7 @@ } @media (min-width: 800px) { - .header { + .nav { height: 98px; } } diff --git a/src/Home.jsx b/src/Home.jsx index 8d57a59b..600cc620 100644 --- a/src/Home.jsx +++ b/src/Home.jsx @@ -21,7 +21,6 @@ import { useGroupCallRooms, usePublicRooms, useCreateRoom, - useCreateRoomAsPasswordlessUser, } from "./ConferenceCallManagerHooks"; import { Header, HeaderLogo, LeftNav, RightNav } from "./Header"; import styles from "./Home.module.css"; @@ -35,21 +34,8 @@ import { ErrorModal } from "./ErrorModal"; export function Home() { const { isAuthenticated, isGuest, loading, error, client } = useClient(); - if (loading) { - return