using Bridge.Html5;
using FrontendRouting;
using LearnBridgeNet.Views.Basic;
namespace LearnBridgeNet.Views
{
[FeRoute("/")]
internal class HomeView : AuthRequiredView
{
private readonly HTMLElement _root;
public HomeView()
{
_root = new HTMLDivElement();
_root.AppendChild(new HTMLHeadingElement(HeadingType.H1)
{
TextContent = "Home Page",
});
_root.AppendChild(new HTMLInputElement
{
Type = InputType.Button,
Value = "Demo",
OnClick = evt => FeRoutingManager.Go("/demo.html")
});
}
public override void Enter(Node parent)
{
parent.AppendChild(_root);
}
public override void Leave()
{
_root.Remove();
}
}
}