Example #1
0
 public override ReactElement Render()
 {
     return(DOM.Div(new Attributes {
         Style = TodoStyles.Container
     },
                    DOM.H4(
                        new Attributes {
         Style = props.Task.Done ? TodoStyles.TextDone : TodoStyles.TextNotDone
     },
                        props.Task.Description
                        ),
                    DOM.Button(
                        new ButtonAttributes
     {
         Style = props.Task.Done ? TodoStyles.ToggleButtonDone : TodoStyles.ToggleButtonNotDone,
         OnClick = e => props.OnChange(props.Task.With(_ => _.Done, value => !value))
     },
                        props.Task.Done ? "Not done yet!" : "Finished!"
                        ),
                    DOM.Button(
                        new ButtonAttributes
     {
         Style = TodoStyles.RemoveButton,
         OnClick = e => props.OnRemove()
     },
                        "Remove"
                        )
                    ));
 }