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 @@ ...@@ -47,7 +47,7 @@
"height": 800 "height": 800
}, },
"sider": { "sider": {
"width": 400 "width": 300
}, },
"footer": { "footer": {
"height": 80 "height": 80
......
...@@ -7,10 +7,9 @@ const { Header, Footer, Sider, Content } = Layout; ...@@ -7,10 +7,9 @@ const { Header, Footer, Sider, Content } = Layout;
const headerStyle: React.CSSProperties = { const headerStyle: React.CSSProperties = {
textAlign: "center", textAlign: "center",
alignContent: "center",
color: "#fff", color: "#fff",
height: layoutConfig.header.height, height: layoutConfig.header.height,
paddingInline: 50,
lineHeight: "64px",
}; };
const contentStyle: React.CSSProperties = { const contentStyle: React.CSSProperties = {
...@@ -18,6 +17,7 @@ const contentStyle: React.CSSProperties = { ...@@ -18,6 +17,7 @@ const contentStyle: React.CSSProperties = {
minHeight: 120, minHeight: 120,
height: layoutConfig.content.height, height: layoutConfig.content.height,
lineHeight: "120px", lineHeight: "120px",
paddingLeft: `${layoutConfig.sider.width}px`,
}; };
const siderStyle: React.CSSProperties = { const siderStyle: React.CSSProperties = {
...@@ -42,7 +42,7 @@ const NeosLayout = (props: { ...@@ -42,7 +42,7 @@ const NeosLayout = (props: {
footer: React.ReactNode; footer: React.ReactNode;
}) => { }) => {
return ( return (
<Layout> <Layout hasSider>
<Sider style={siderStyle} width={layoutConfig.sider.width}> <Sider style={siderStyle} width={layoutConfig.sider.width}>
{props.sider} {props.sider}
</Sider> </Sider>
......
...@@ -25,6 +25,7 @@ import NeosConfig from "../../../neos.config.json"; ...@@ -25,6 +25,7 @@ import NeosConfig from "../../../neos.config.json";
import DuelTimeLine from "./timeLine"; import DuelTimeLine from "./timeLine";
import { Row } from "antd"; import { Row } from "antd";
import SendBox from "./sendBox"; import SendBox from "./sendBox";
import PlayerStatus from "./status";
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126 // Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => { const NeosDuel = () => {
...@@ -47,9 +48,9 @@ const NeosDuel = () => { ...@@ -47,9 +48,9 @@ const NeosDuel = () => {
<> <>
<NeosLayout <NeosLayout
sider={<NeosSider />} sider={<NeosSider />}
header={<div>header</div>} header={<PlayerStatus />}
content={<NeosCanvas />} content={<NeosCanvas />}
footer={<div>footer</div>} footer={<PlayerStatus />}
/> />
<CardModal /> <CardModal />
<CardListModal /> <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