@@ -10,14 +10,19 @@ type BohnenRowProps = {
1010const BohnenRow = ( { bohne } : BohnenRowProps ) => {
1111 const dispatch = useContext ( BohnenDispatchContext ) ;
1212
13+ const inputClasses =
14+ "w-full border-1 border-slate-400 p-1 outline-1 outline-transparent focus:border-cyan-600 focus:outline-1 focus:outline-cyan-600 disabled:bg-slate-200" ;
15+
16+ const numberInputClasses = `${ inputClasses } text-right font-mono` ;
17+
1318 return (
1419 < tr key = { bohne . id } >
1520 < td >
1621 < input
1722 type = "text"
1823 data-testid = "art"
1924 aria-label = "Bohnenart"
20- className = "border-2 border-slate-400"
25+ className = { inputClasses }
2126 onChange = { ( event ) => {
2227 console . log ( "event.target.value" , event . target . value ) ;
2328 dispatch ( {
@@ -32,7 +37,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
3237 < input
3338 type = "number"
3439 data-testid = "ekp"
35- className = "border-2 border-slate-400"
40+ className = { numberInputClasses }
3641 onChange = { ( event ) =>
3742 dispatch ( {
3843 type : BohnenActionTypes . UPDATE ,
@@ -49,7 +54,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
4954 < input
5055 type = "number"
5156 data-testid = "marge"
52- className = "border-2 border-slate-400 disabled:bg-slate-200"
57+ className = { numberInputClasses }
5358 disabled = { true }
5459 onChange = { ( event ) =>
5560 dispatch ( {
@@ -67,7 +72,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
6772 < input
6873 type = "number"
6974 data-testid = "rabatt"
70- className = "border-2 border-slate-400"
75+ className = { numberInputClasses }
7176 onChange = { ( event ) =>
7277 dispatch ( {
7378 type : BohnenActionTypes . UPDATE ,
@@ -85,7 +90,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
8590 type = "number"
8691 id = "vkp"
8792 data-testid = "vkp"
88- className = "border-2 border-slate-400"
93+ className = { numberInputClasses }
8994 onChange = { ( event ) =>
9095 dispatch ( {
9196 type : BohnenActionTypes . UPDATE ,
@@ -104,7 +109,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
104109 disabled = { true }
105110 id = "precictedVKP"
106111 data-testid = "precictedVKP"
107- className = "border-2 border-slate-400 disabled:bg-slate-200"
112+ className = { numberInputClasses }
108113 value = { bohne . predictedVKP || "0.0" }
109114 />
110115 </ td >
@@ -114,7 +119,7 @@ const BohnenRow = ({ bohne }: BohnenRowProps) => {
114119 id = "vkpRabatt"
115120 data-testid = "vkpRabatt"
116121 disabled = { true }
117- className = "border-2 border-slate-400 disabled:bg-slate-200"
122+ className = { numberInputClasses }
118123 onChange = { ( event ) =>
119124 dispatch ( {
120125 type : BohnenActionTypes . UPDATE ,
0 commit comments