WIP: Migrate to matrix-rust-sdk #111

Draft
pierre wants to merge 92 commits from migrate-to-matrix-sdk into master
2 changed files with 25 additions and 3 deletions
Showing only changes of commit a7bfd713c3 - Show all commits

View File

@@ -1,3 +1,4 @@
import { Divider } from "@mui/material";
import React from "react"; import React from "react";
import { import {
MatrixApiProfile, MatrixApiProfile,
@@ -6,9 +7,9 @@ import {
import { MatrixApiRoom, type Room } from "../../api/matrix/MatrixApiRoom"; import { MatrixApiRoom, type Room } from "../../api/matrix/MatrixApiRoom";
import { MatrixSyncApi } from "../../api/MatrixSyncApi"; import { MatrixSyncApi } from "../../api/MatrixSyncApi";
import { AsyncWidget } from "../AsyncWidget"; import { AsyncWidget } from "../AsyncWidget";
import { SpaceSelector } from "./SpaceSelector";
import { Divider } from "@mui/material";
import { RoomSelector } from "./RoomSelector"; import { RoomSelector } from "./RoomSelector";
import { RoomWidget } from "./RoomWidget";
import { SpaceSelector } from "./SpaceSelector";
export function MainMessageWidget(): React.ReactElement { export function MainMessageWidget(): React.ReactElement {
const [rooms, setRooms] = React.useState<Room[] | undefined>(); const [rooms, setRooms] = React.useState<Room[] | undefined>();
@@ -66,7 +67,19 @@ function _MainMessageWidget(p: {
onChange={setRoom} onChange={setRoom}
/> />
<Divider orientation="vertical" /> <Divider orientation="vertical" />
<span style={{ flex: 1 }}>todo</span> {room === undefined && (
<div
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
flex: 1,
}}
>
No room selected.
</div>
)}
{room && <RoomWidget {...p} room={room} />}
</div> </div>
); );
} }

View File

@@ -0,0 +1,9 @@
import type { UsersMap } from "../../api/matrix/MatrixApiProfile";
import type { Room } from "../../api/matrix/MatrixApiRoom";
export function RoomWidget(p: {
room: Room;
users: UsersMap;
}): React.ReactElement {
return <>room</>;
}