Skip to content

Commit

Permalink
fix: improve extra small screen styles
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler committed Feb 4, 2025
1 parent 82e5e19 commit fe08919
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion frontend/src/Components/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function NumberInput({
}) {
return (
<Form.Control
style={{ maxWidth: "48px", minWidth: "20px" }}
style={{ maxWidth: "42px", minWidth: "42px", textAlign: "center" }}
type="number"
id={id}
placeholder={placeholder}
Expand Down
80 changes: 45 additions & 35 deletions frontend/src/Components/Sections/RSVP/RSVPForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,47 +32,57 @@ const ChildrenInput = ({
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "start",
flexDirection: isAbove400w ? "row" : "column",
justifyContent: isAbove400w ? "space-between" : "start",
alignItems: "center",
color: "black",
}}
>
<span>Crianças acima de 12 anos:</span>
<IconButton
<span>Dependentes (12+ anos):</span>
<div
style={{
padding: isAbove400w ? "0 16px" : "0 4px",
display: "flex",
flexDirection: "row",
justifyContent: "start",
alignItems: "center",
color: "black",
}}
icon={DashCircle}
onClick={() => {
const newValue = value - 1;
if (isValidValue(newValue)) {
setValue(newValue);
}
}}
/>
<NumberInput
id="children"
placeholder="0"
value={value}
onChange={(e) => {
if (isValidValue(Number(e.target.value))) {
onChange(e);
}
}}
/>
<IconButton
style={{
padding: isAbove400w ? "0 16px" : "0 4px",
}}
icon={PlusCircle}
onClick={() => {
const newValue = value + 1;
if (isValidValue(newValue)) {
setValue(newValue);
}
}}
/>
>
<IconButton
style={{
padding: "0 8px",
}}
icon={DashCircle}
onClick={() => {
const newValue = value - 1;
if (isValidValue(newValue)) {
setValue(newValue);
}
}}
/>
<NumberInput
id="children"
placeholder="0"
value={value}
onChange={(e) => {
if (isValidValue(Number(e.target.value))) {
onChange(e);
}
}}
/>
<IconButton
style={{
padding: "0 8px",
}}
icon={PlusCircle}
onClick={() => {
const newValue = value + 1;
if (isValidValue(newValue)) {
setValue(newValue);
}
}}
/>
</div>
</div>
);
};
Expand Down

0 comments on commit fe08919

Please sign in to comment.