Implement minimum amount for a working matrix.to
This commit is contained in:
@@ -19,6 +19,8 @@ import React from "react";
|
||||
import InviteTile from "./InviteTile";
|
||||
import UserPreview, { InviterPreview } from "./UserPreview";
|
||||
import RoomPreview, { RoomPreviewWithTopic } from "./RoomPreview";
|
||||
import Clients from "../clients";
|
||||
import { LinkKind, SafeLink } from "../parser/types";
|
||||
|
||||
export default {
|
||||
title: "InviteTile",
|
||||
@@ -31,35 +33,38 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const userLink: SafeLink = {
|
||||
kind: LinkKind.UserId,
|
||||
identifier: "@jorik:matrix.org",
|
||||
arguments: {
|
||||
vias: [],
|
||||
},
|
||||
originalLink: "asdfsadf",
|
||||
};
|
||||
|
||||
const roomLink: SafeLink = {
|
||||
kind: LinkKind.Alias,
|
||||
identifier: "#element-dev:matrix.org",
|
||||
arguments: {
|
||||
vias: [],
|
||||
},
|
||||
originalLink: "asdfsadf",
|
||||
};
|
||||
|
||||
export const withLink: React.FC<{}> = () => (
|
||||
<InviteTile
|
||||
inviteAction={{
|
||||
type: "link",
|
||||
link: "https://app.element.io/#/room/#asdfasf:matrix.org",
|
||||
}}
|
||||
>
|
||||
<InviteTile client={Clients[0]} link={userLink}>
|
||||
This is an invite with a link
|
||||
</InviteTile>
|
||||
);
|
||||
|
||||
export const withInstruction: React.FC<{}> = () => (
|
||||
<InviteTile
|
||||
inviteAction={{
|
||||
type: "instruction",
|
||||
text: "Type /join #asdfasf:matrix.org",
|
||||
}}
|
||||
>
|
||||
<InviteTile client={Clients[0]} link={userLink}>
|
||||
This is an invite with an instruction
|
||||
</InviteTile>
|
||||
);
|
||||
|
||||
export const withUserPreview: React.FC<{}> = () => (
|
||||
<InviteTile
|
||||
inviteAction={{
|
||||
type: "link",
|
||||
link: "https://app.element.io/#/room/#asdfasf:matrix.org",
|
||||
}}
|
||||
>
|
||||
<InviteTile client={Clients[0]} link={userLink}>
|
||||
<UserPreview
|
||||
user={{
|
||||
avatar_url: "mxc://matrix.org/EqMZYbAYhREvHXvYFyfxOlkf",
|
||||
@@ -71,12 +76,7 @@ export const withUserPreview: React.FC<{}> = () => (
|
||||
);
|
||||
|
||||
export const withRoomPreviewAndRoomTopic: React.FC<{}> = () => (
|
||||
<InviteTile
|
||||
inviteAction={{
|
||||
type: "link",
|
||||
link: "https://app.element.io/#/room/#asdfasf:matrix.org",
|
||||
}}
|
||||
>
|
||||
<InviteTile client={Clients[0]} link={roomLink}>
|
||||
<RoomPreviewWithTopic
|
||||
room={{
|
||||
aliases: ["#murrays:cheese.bar"],
|
||||
@@ -93,12 +93,7 @@ export const withRoomPreviewAndRoomTopic: React.FC<{}> = () => (
|
||||
);
|
||||
|
||||
export const withRoomPreviewAndInviter: React.FC<{}> = () => (
|
||||
<InviteTile
|
||||
inviteAction={{
|
||||
type: "link",
|
||||
link: "https://app.element.io/#/room/#asdfasf:matrix.org",
|
||||
}}
|
||||
>
|
||||
<InviteTile client={Clients[0]} link={roomLink}>
|
||||
<InviterPreview
|
||||
user={{
|
||||
avatar_url: "mxc://matrix.org/EqMZYbAYhREvHXvYFyfxOlkf",
|
||||
|
||||
Reference in New Issue
Block a user