this.handleDelete(index)}
+ />
+ );
+ });
+
return (
{this.state.message}
{input}
-
+
+ {charList}
);
}
diff --git a/04/src/Char.css b/04/src/Char.css
new file mode 100644
index 00000000..78f6ef3e
--- /dev/null
+++ b/04/src/Char.css
@@ -0,0 +1,7 @@
+.Char {
+ display: inline-block;
+ padding: 16px;
+ text-align: center;
+ margin: 16px;
+ border: 1px solid black;
+}
diff --git a/04/src/Char.js b/04/src/Char.js
index e69de29b..4b1278d4 100644
--- a/04/src/Char.js
+++ b/04/src/Char.js
@@ -0,0 +1,14 @@
+import React from "react";
+import "./Char.css";
+
+class Char extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ return {this.props.string}
;
+ }
+}
+
+export default Char;
diff --git a/04/src/Validation.js b/04/src/Validation.js
index 22ac4fc0..df48f6ae 100644
--- a/04/src/Validation.js
+++ b/04/src/Validation.js
@@ -4,15 +4,19 @@ class Validation extends React.Component {
constructor(props) {
super(props);
console.log("Validation:", props);
- // console.log(this.props.message.lenght);
+ }
+
+ validation() {
+ let validationMessage = good enough
;
+ if (this.props.length >= 5) {
+ validationMessage = TOO MUCH, STAHP
;
+ return validationMessage;
+ }
+ return validationMessage;
}
render() {
- return(
-
-
validation placeholder
-
- )
+ return {this.validation()}
;
}
}