Add keyboard activation to the interactive elements and use stable keys. [skip build]
This commit is contained in:
@@ -3,7 +3,6 @@ import { isKeyHotkey } from 'is-hotkey';
|
||||
import { Editor } from 'slate';
|
||||
import { IconButton, Line, PopOut } from 'folds';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { Room } from 'matrix-js-sdk';
|
||||
import { Icon, Icons } from '../../components/icons';
|
||||
import {
|
||||
CustomEditor,
|
||||
@@ -28,7 +27,6 @@ import { PluginButtonSlot } from '../settings/plugins/PluginButtonSlot';
|
||||
type ForumChatComposerProps = {
|
||||
editor: Editor;
|
||||
roomId: string;
|
||||
room: Room;
|
||||
placeholder?: string;
|
||||
onSend?: () => void;
|
||||
showAttachButton?: boolean;
|
||||
@@ -39,7 +37,6 @@ type ForumChatComposerProps = {
|
||||
export function ForumChatComposer({
|
||||
editor,
|
||||
roomId,
|
||||
room,
|
||||
placeholder = 'Send a message…',
|
||||
onSend,
|
||||
showAttachButton = false,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { ChangeEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import React, { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Box, Text, Input, Avatar, Button, config, Spinner, color, toRem } from 'folds';
|
||||
import { HexColorPicker } from 'react-colorful';
|
||||
@@ -38,13 +38,7 @@ import {
|
||||
/**
|
||||
* Banner upload component for user's profile banner (MSC4427 via MSC4133).
|
||||
*/
|
||||
function ProfileBanner({
|
||||
avatarRef,
|
||||
nameRef,
|
||||
}: {
|
||||
avatarRef: React.RefObject<HTMLDivElement>;
|
||||
nameRef: React.RefObject<HTMLDivElement>;
|
||||
}) {
|
||||
function ProfileBanner() {
|
||||
const mx = useMatrixClient();
|
||||
const useAuthentication = useMediaAuthentication();
|
||||
const userId = mx.getUserId()!;
|
||||
@@ -1207,8 +1201,5 @@ function ProfileBanner({
|
||||
}
|
||||
|
||||
export function Profile() {
|
||||
const avatarRef = useRef<HTMLDivElement>(null);
|
||||
const nameRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
return <ProfileBanner avatarRef={avatarRef} nameRef={nameRef} />;
|
||||
return <ProfileBanner />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user