feat: show network stats for collaboration

This commit is contained in:
Aakansha Doshi 2021-02-06 19:50:35 +05:30
parent 1e17c1967b
commit 8157c84d11
6 changed files with 83 additions and 1 deletions

View file

@ -30,6 +30,7 @@ export const Stats = (props: {
setAppState: React.Component<any, AppState>["setState"];
elements: readonly NonDeletedExcalidrawElement[];
onClose: () => void;
isCollaborating: boolean;
}) => {
const isMobile = useIsMobile();
const [storageSizes, setStorageSizes] = useState<StorageSizes>({
@ -192,6 +193,21 @@ export const Stats = (props: {
{hash}
</td>
</tr>
{props.isCollaborating ? (
<>
<tr>
<th colSpan={2}>{t("stats.collaboration")}</th>
</tr>
<tr>
<td>{t("stats.collaborators")}</td>
<td>{props.appState.collaborators.size}</td>
</tr>
<tr>
<td>{t("stats.networkSpeed")}</td>
<td>{props.appState.networkSpeed}</td>
</tr>
</>
) : null}
</tbody>
</table>
</Island>