Merge branch 'feature/user-account-page' into 'main'

Feature/user account page

See merge request vkuchenik/website-framework!48
This commit is contained in:
Dan Hansen
2025-08-04 23:03:43 +00:00
3 changed files with 87 additions and 18 deletions
+17
View File
@@ -18,6 +18,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-grid-layout": "^1.5.2",
"react-hook-form": "^7.62.0",
"react-icons": "^5.5.0",
"react-leaflet": "^5.0.0",
"react-resizable": "^3.0.5",
@@ -4302,6 +4303,22 @@
"react-dom": ">= 16.3.0"
}
},
"node_modules/react-hook-form": {
"version": "7.62.0",
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.62.0.tgz",
"integrity": "sha512-7KWFejc98xqG/F4bAxpL41NB3o1nnvQO1RWZT3TqRZYL8RryQETGfEdVnJN2fy1crCiBLLjkRBVK05j24FxJGA==",
"license": "MIT",
"engines": {
"node": ">=18.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/react-hook-form"
},
"peerDependencies": {
"react": "^16.8.0 || ^17 || ^18 || ^19"
}
},
"node_modules/react-icons": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
+1
View File
@@ -20,6 +20,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-grid-layout": "^1.5.2",
"react-hook-form": "^7.62.0",
"react-icons": "^5.5.0",
"react-leaflet": "^5.0.0",
"react-resizable": "^3.0.5",
@@ -1,24 +1,75 @@
import { Box, Text } from '@chakra-ui/react';
import { Box, Flex, Field, Input, Stack, Heading, Button } from "@chakra-ui/react"
import { useForm } from 'react-hook-form';
export default function AccountCanvas() {
const {
register,
handleSubmit,
watch,
formState: { errors },
} = useForm();
const onSubmit = (data) => {
console.log("Form submitted:", data);
}
console.log(watch("example")); // watch input value by passing the name of it
export default function AccountCanvas() {
return (
<Box p={8} mt={4} ml="auto" mr="auto" width="600px">
<Flex
height="100vh"
direction="column"
align="start"
justify="start"
bg="gray.50"
pt={6}
pl={6}
>
<Heading as="h1" mb={2}>Account</Heading>
<Box
bg="bg"
shadow="md"
as="form"
onSubmit={handleSubmit(onSubmit)}
border="1px solid"
borderColor="gray.300"
borderRadius="md"
p={8}
width="600px"
height="100px"
textAlign="center"
display="flex"
alignItems="center"
justifyContent="center"
padding={4}
bg="white"
boxShadow="md"
width="100%"
maxW="sm"
>
<Text fontsize="2xl" fontWeight="bold" color="gray.700">
Account Canvas coming soon!
</Text>
{/* <Text fontSize="xl" fontWeight="bold" mb={6}>
Account
</Text> */}
<Stack gap="6" maxW="sm" css={{ "--field-label-width": "96px" }}>
<Field.Root orientation="horizontal">
<Field.Label>User Name</Field.Label>
<Input {...register("username")} placeholder="David Johnston" flex="1" />
</Field.Root>
<Field.Root orientation="horizontal">
<Field.Label> First Name</Field.Label>
<Input {...register("firstname")} placeholder="David" flex="1" />
</Field.Root>
<Field.Root orientation="horizontal">
<Field.Label>Last Name</Field.Label>
<Input {...register("lastname")} placeholder="Johnston" flex="1" />
</Field.Root>
<Field.Root orientation="horizontal">
<Field.Label>Email</Field.Label>
<Input {...register("email")} placeholder="djohntson@usgs.gov" flex="1" />
</Field.Root>
<Button type="submit">
Save
</Button>
</Stack>
</Box>
</Box>
);
}
</Flex>
)
}