Browse Source

Disambiguate Room type.

main
Titouan Rigoudy 4 years ago
parent
commit
178319f949
3 changed files with 7 additions and 7 deletions
  1. +2
    -2
      src/modules/room/RoomList.tsx
  2. +3
    -3
      src/modules/room/RoomListEntry.tsx
  3. +2
    -2
      src/modules/room/slice.ts

+ 2
- 2
src/modules/room/RoomList.tsx View File

@ -2,10 +2,10 @@ import { FC } from "react";
import { useDispatch } from "react-redux";
import SearchableList from "components/SearchableList";
import RoomComponent from "modules/room/Room";
import RoomListEntry from "modules/room/RoomListEntry";
import { RoomSliceState, roomGetAll } from "modules/room/slice";
const SearchableRoomList = SearchableList(RoomComponent);
const SearchableRoomList = SearchableList(RoomListEntry);
const RoomList: FC<RoomSliceState> = ({ rooms }) => {
const dispatch = useDispatch();


src/modules/room/Room.tsx → src/modules/room/RoomListEntry.tsx View File

@ -2,14 +2,14 @@ import { FC } from "react";
import { NavLink } from "react-router-dom";
import { encode } from "modules/base64";
import { RoomMembership, Room as RoomState } from "modules/room/slice";
import { RoomMembership, RoomState } from "modules/room/slice";
interface Props {
name: string;
data: RoomState;
}
const Room: FC<Props> = ({ name, data }) => {
const RoomListEntry: FC<Props> = ({ name, data }) => {
const { membership, userCount } = data;
const classes = ["room"];
@ -29,4 +29,4 @@ const Room: FC<Props> = ({ name, data }) => {
);
};
export default Room;
export default RoomListEntry;

+ 2
- 2
src/modules/room/slice.ts View File

@ -14,7 +14,7 @@ export interface RoomMessage {
message: string;
}
export interface Room {
export interface RoomState {
name: string;
membership: RoomMembership;
visibility: string;
@ -29,7 +29,7 @@ export interface Room {
}
export interface RoomMap {
[name: string]: Room;
[name: string]: RoomState;
}
export interface RoomSliceState {


Loading…
Cancel
Save