Tweak pill UI (#10417)

This commit is contained in:
Michael Weimann
2023-03-22 13:27:24 +01:00
committed by GitHub
parent 4c2b18c5d9
commit 3eb6a55b93
8 changed files with 177 additions and 54 deletions
+7 -1
View File
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { ButtonEvent } from "../components/views/elements/AccessibleButton";
import { PillType } from "../components/views/elements/Pill";
@@ -70,6 +70,11 @@ interface HookResult {
* null here means that the type cannot be detected. Most likely if the URL was not a permalink.
*/
type: PillType | "space" | null;
/**
* Target event of the permalink.
* Null if unable to load the event.
*/
event: MatrixEvent | null;
}
/**
@@ -166,6 +171,7 @@ export const usePermalink: (args: Args) => HookResult = ({
}
return {
event,
member,
onClick,
resourceId,