Skip to content

Commit 29543ce

Browse files
Merge pull request #4 from PapperlapappYT/styling
Styling
2 parents d19b3ea + af680eb commit 29543ce

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

src/components/bohnen/Bohnen.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,23 @@ export const Bohnen = () => {
99
const t = useTranslations("beanOverview");
1010

1111
return (
12-
<div className="tableContainer">
13-
<table className="border-separate border-spacing-2">
12+
<div>
13+
<table className="border-separate border-spacing-2 table-fixed">
1414
<thead className="text-1xl text-gray-700 font-bold mb-5">
1515
<tr>
16-
<th>{t("beanType")}</th>
17-
<th>{t("ekp")}</th>
18-
<th>{t("marge")}</th>
19-
<th>{t("discount")}</th>
20-
<th>{t("vkpWithoutDiscount")}</th>
21-
<th>{t("aiPredictedSalesPrices")}</th>
22-
<th>{t("salesPrices")}</th>
16+
<th className="w-3 text-left align-text-top">{t("beanType")}</th>
17+
<th className="text-right pr-1 align-text-top">{t("ekp")}</th>
18+
<th className="text-right pr-1 align-text-top">{t("marge")}</th>
19+
<th className="text-right pr-1 align-text-top">{t("discount")}</th>
20+
<th className="text-right pr-1 align-text-top">
21+
{t("vkpWithoutDiscount")}
22+
</th>
23+
<th className="text-right pr-1 align-text-top">
24+
{t("aiPredictedSalesPrices")}
25+
</th>
26+
<th className="text-right pr-1 align-text-top">
27+
{t("salesPrices")}
28+
</th>
2329
</tr>
2430
</thead>
2531
<tbody>

src/components/bohnen/BohnenRow.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ type BohnenRowProps = {
1010
const 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

Comments
 (0)