Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Refactor Setting component to include additional address field
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloento committed Mar 4, 2024
1 parent ef3683b commit d927a64
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Components/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ const useStyles = makeStyles({
},
fill: {
flexGrow: 1
},
small: {
width: "100%"
}
});

Expand All @@ -55,7 +52,7 @@ export function Setting({ Open, Toggle, New }: ISetting) {
const [forename, setForename] = useState<string>();

const [phone, setPhone] = useState<string>();
const [address, setAddress] = useState(Array<string>(4).fill(""));
const [address, setAddress] = useState(Array<string>(5).fill(""));

const { data, mutate } = Hub.User.Get.useMe(log);

Expand Down Expand Up @@ -218,10 +215,11 @@ export function Setting({ Open, Toggle, New }: ISetting) {
minLength={2}
/>
</Field>
</div>

<Field hint="Postal / Zip Code">
<div className={style.one}>
<Field hint="Country">
<Input
input={{ className: style.small }}
value={address[3]}
onChange={(_, v) => {
address[3] = v.value;
Expand All @@ -231,6 +229,18 @@ export function Setting({ Open, Toggle, New }: ISetting) {
minLength={2}
/>
</Field>

<Field hint="Postal / Zip Code">
<Input
value={address[4]}
onChange={(_, v) => {
address[3] = v.value;
setAddress([...address]);
}}
maxLength={10}
minLength={2}
/>
</Field>
</div>
</DialogContent>

Expand Down

0 comments on commit d927a64

Please sign in to comment.