Commit 5c785489 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'optimize/duel/status' into 'main'

Optimize/duel/status

See merge request !114
parents 561af3a7 8cd0e90d
Pipeline #20444 passed with stages
in 5 minutes and 20 seconds
......@@ -47,7 +47,7 @@
"height": 800
},
"sider": {
"width": 400
"width": 300
},
"footer": {
"height": 80
......
......@@ -7,10 +7,9 @@ const { Header, Footer, Sider, Content } = Layout;
const headerStyle: React.CSSProperties = {
textAlign: "center",
alignContent: "center",
color: "#fff",
height: layoutConfig.header.height,
paddingInline: 50,
lineHeight: "64px",
};
const contentStyle: React.CSSProperties = {
......@@ -18,6 +17,7 @@ const contentStyle: React.CSSProperties = {
minHeight: 120,
height: layoutConfig.content.height,
lineHeight: "120px",
paddingLeft: `${layoutConfig.sider.width}px`,
};
const siderStyle: React.CSSProperties = {
......@@ -42,7 +42,7 @@ const NeosLayout = (props: {
footer: React.ReactNode;
}) => {
return (
<Layout>
<Layout hasSider>
<Sider style={siderStyle} width={layoutConfig.sider.width}>
{props.sider}
</Sider>
......
......@@ -25,6 +25,7 @@ import NeosConfig from "../../../neos.config.json";
import DuelTimeLine from "./timeLine";
import { Row } from "antd";
import SendBox from "./sendBox";
import PlayerStatus from "./status";
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => {
......@@ -47,9 +48,9 @@ const NeosDuel = () => {
<>
<NeosLayout
sider={<NeosSider />}
header={<div>header</div>}
header={<PlayerStatus />}
content={<NeosCanvas />}
footer={<div>footer</div>}
footer={<PlayerStatus />}
/>
<CardModal />
<CardListModal />
......
import React from "react";
import { UserOutlined, BackwardOutlined } from "@ant-design/icons";
import { Avatar, Space, Statistic } from "antd";
const spaceSize = 20;
const avatarSize = 40;
const PlayerStatus = () => (
<Space size={spaceSize} direction="horizontal">
<Space wrap size={spaceSize}>
<Avatar size={avatarSize} icon={<UserOutlined />} />
</Space>
<Space wrap size={spaceSize}>
UserName
</Space>
<Space wrap size={spaceSize}>
<Statistic title="Hp" value={4000} />
</Space>
<Space wrap size={spaceSize}>
<Avatar
size={avatarSize}
style={{ color: "red" }}
icon={<BackwardOutlined />}
/>
</Space>
</Space>
);
export default PlayerStatus;
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