refactor(fairshare): move ResourceTiles need-form inline styles to CSS module tokens
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
This commit is contained in:
1 parent
adb3bde4ee
commit
913b4e03da
2 files changed
+37
-16
No files matched your search
@@ -143,3 +143,35 @@
|
||||
gap: 0.75rem;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.needForm {
|
||||
margin: var(--space-3) 2px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.needFormLabel {
|
||||
width: 100%;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.needInput {
|
||||
padding: var(--space-2);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.needAmountInput {
|
||||
flex: 1;
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.needStatus {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
}
|
||||
@@ -139,13 +139,6 @@ export function ResourceTiles() {
|
||||
}
|
||||
}
|
||||
|
||||
const needInputStyle = {
|
||||
padding: 8,
|
||||
border: "1px solid #d0d5dd",
|
||||
borderRadius: 8,
|
||||
fontSize: 14,
|
||||
} as const;
|
||||
|
||||
return (
|
||||
<section className={styles.screen} aria-label="Fair Share">
|
||||
<div className={styles.balanceCard}>
|
||||
@@ -202,18 +195,14 @@ export function ResourceTiles() {
|
||||
</div>
|
||||
|
||||
{accountId !== undefined && (
|
||||
<form
|
||||
onSubmit={handleSubmitNeed}
|
||||
aria-label="Report your need"
|
||||
style={{ margin: "12px 2px", display: "flex", flexWrap: "wrap", gap: 8, alignItems: "center" }}
|
||||
>
|
||||
<span style={{ fontWeight: 600, fontSize: 14, width: "100%" }}>Report your need</span>
|
||||
<form onSubmit={handleSubmitNeed} aria-label="Report your need" className={styles.needForm}>
|
||||
<span className={styles.needFormLabel}>Report your need</span>
|
||||
<select
|
||||
data-testid="fairshare-need-resource"
|
||||
aria-label="resource"
|
||||
value={needResource}
|
||||
onChange={(e) => setNeedResource(e.target.value as FairshareResource)}
|
||||
style={needInputStyle}
|
||||
className={styles.needInput}
|
||||
>
|
||||
{FAIRSHARE_RESOURCES.map((r) => (
|
||||
<option key={r} value={r}>
|
||||
@@ -229,13 +218,13 @@ export function ResourceTiles() {
|
||||
placeholder="how much you need"
|
||||
value={needAmount}
|
||||
onChange={(e) => setNeedAmount(e.target.value)}
|
||||
style={{ ...needInputStyle, flex: 1, minWidth: 140 }}
|
||||
className={`${styles.needInput} ${styles.needAmountInput}`}
|
||||
/>
|
||||
<button type="submit" data-testid="fairshare-need-submit">
|
||||
Report need
|
||||
</button>
|
||||
{needStatus && (
|
||||
<p data-testid="fairshare-need-status" role="status" style={{ fontSize: 13, margin: 0, width: "100%" }}>
|
||||
<p data-testid="fairshare-need-status" role="status" className={styles.needStatus}>
|
||||
{needStatus}
|
||||
</p>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user