Commit aba65cb5 authored by Chunchi Che's avatar Chunchi Che

add sendBox.tsx

parent d7b95792
Pipeline #20431 passed with stages
in 4 minutes and 12 seconds
...@@ -23,6 +23,8 @@ import NeosLayout from "./layout"; ...@@ -23,6 +23,8 @@ import NeosLayout from "./layout";
import { initStrings } from "../../api/strings"; import { initStrings } from "../../api/strings";
import NeosConfig from "../../../neos.config.json"; import NeosConfig from "../../../neos.config.json";
import DuelTimeLine from "./timeLine"; import DuelTimeLine from "./timeLine";
import { Row } from "antd";
import SendBox from "./sendBox";
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126 // Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => { const NeosDuel = () => {
...@@ -44,7 +46,7 @@ const NeosDuel = () => { ...@@ -44,7 +46,7 @@ const NeosDuel = () => {
return ( return (
<> <>
<NeosLayout <NeosLayout
sider={<DuelTimeLine />} sider={<NeosSider />}
header={<div>header</div>} header={<div>header</div>}
content={<NeosCanvas />} content={<NeosCanvas />}
footer={<div>footer</div>} footer={<div>footer</div>}
...@@ -61,6 +63,17 @@ const NeosDuel = () => { ...@@ -61,6 +63,17 @@ const NeosDuel = () => {
); );
}; };
const NeosSider = () => (
<div>
<Row>
<DuelTimeLine />
</Row>
<Row align="bottom">
<SendBox />
</Row>
</div>
);
const NeosCanvas = () => ( const NeosCanvas = () => (
<ReactReduxContext.Consumer> <ReactReduxContext.Consumer>
{({ store }) => ( {({ store }) => (
......
import React, { useState } from "react";
import { Input, Button, Row } from "antd";
import { SendOutlined } from "@ant-design/icons";
const SendBox = () => {
const [content, setContent] = useState("");
return (
<>
<Row>
<Input.TextArea
placeholder="Message to sent..."
autoSize
value={content}
onChange={(e) => {
setContent(e.target.value);
}}
/>
</Row>
<Row>
<Button
icon={<SendOutlined />}
onClick={() => {}}
disabled={!content}
/>
</Row>
</>
);
};
export default SendBox;
...@@ -2,21 +2,25 @@ import React from "react"; ...@@ -2,21 +2,25 @@ import React from "react";
import { Timeline } from "antd"; import { Timeline } from "antd";
import { UserOutlined, SettingOutlined } from "@ant-design/icons"; import { UserOutlined, SettingOutlined } from "@ant-design/icons";
const DuelTimeLine = () => <Timeline items={[ const DuelTimeLine = () => (
<Timeline
items={[
{ {
dot: <UserOutlined />, dot: <UserOutlined />,
children: "对手消息", children: "对手消息",
color: "red" color: "red",
}, },
{ {
dot: <UserOutlined />, dot: <UserOutlined />,
children: "自己消息", children: "自己消息",
color: "green" color: "green",
}, },
{ {
dot: <SettingOutlined />, dot: <SettingOutlined />,
children: '系统消息', children: "系统消息",
}, },
]} />; ]}
/>
);
export default DuelTimeLine; export default DuelTimeLine;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment