Commit bc5a3760 authored by Chunchi Che's avatar Chunchi Che

add alert.tsx

parent 823793b9
Pipeline #20788 passed with stages
in 15 minutes and 9 seconds
import React from "react";
export const Button2D = (props: {
text: string;
left: number;
enable: boolean;
onClick: () => void;
}) => (
<adtFullscreenUi name="ui">
<rectangle
name="rect"
height="20px"
width="60px"
isEnabled={props.enable}
left={props.left}
>
<rectangle>
<babylon-button
name="close-icon"
onPointerDownObservable={props.onClick}
>
<textBlock
text={props.text}
fontFamily="FontAwesome"
fontStyle="bold"
fontSize={15}
color={props.enable ? "yellow" : "white"}
/>
</babylon-button>
</rectangle>
</rectangle>
</adtFullscreenUi>
);
import { Alert } from "antd";
import React from "react";
import { useNavigate } from "react-router-dom";
import { useAppSelector } from "../../hook";
import { selectUnimplemented } from "../../reducers/duel/mod";
const NeosAlert = () => {
const unimplemented = useAppSelector(selectUnimplemented);
const navigate = useNavigate();
return (
<>
{unimplemented ? (
<Alert
message={`Unimplemented message with code=${unimplemented}`}
description="It seems that there's something unimplemented by Neos. Sincerely apologize for that. Contact use to fix this issue: <linuxgnulover@gmail.com>"
showIcon
type="error"
closable
afterClose={() => {
navigate("/");
}}
/>
) : (
<></>
)}
</>
);
};
export default NeosAlert;
......@@ -25,6 +25,7 @@ import DuelTimeLine from "./timeLine";
import { Row } from "antd";
import SendBox from "./sendBox";
import PlayerStatus from "./status";
import Alert from "./alert";
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => {
......@@ -44,6 +45,7 @@ const NeosDuel = () => {
<PositionModal />
<OptionModal />
<CheckCardModalV2 />
<Alert />
</>
);
};
......
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