From 6717bda7948065905892ad02a15e514f5dde562f Mon Sep 17 00:00:00 2001 From: AldemirLucas Date: Tue, 31 Oct 2023 14:33:11 -0300 Subject: [PATCH] wip page user edit --- next/pages/api/user/registerAccount.js | 3 +- next/pages/user/[username].js | 124 +++++++++++++++++-------- 2 files changed, 86 insertions(+), 41 deletions(-) diff --git a/next/pages/api/user/registerAccount.js b/next/pages/api/user/registerAccount.js index 7ad2cc5e..0e78d73b 100644 --- a/next/pages/api/user/registerAccount.js +++ b/next/pages/api/user/registerAccount.js @@ -5,6 +5,7 @@ const API_URL= `${process.env.NEXT_PUBLIC_API_URL}/api/v1/graphql` export default async function registerAccount({ firstName, lastName = "", + username, email, password, }) { @@ -20,7 +21,7 @@ export default async function registerAccount({ mutation { CreateUpdateAccount (input: { - username : "${email}" + username : "${username}" email: "${email}" firstName: "${firstName}" lastName: "${lastName}" diff --git a/next/pages/user/[username].js b/next/pages/user/[username].js index 9d3a8c35..22bd9660 100644 --- a/next/pages/user/[username].js +++ b/next/pages/user/[username].js @@ -133,8 +133,15 @@ const ModalGeneral = ({ } const ProfileConfiguration = () => { - const [formData, setFormData] = useState({ username: "", firstName: "" , lastName: "", picture: "" }) - const [errors, setErrors] = useState({ username: "", firstName: "" , lastName: "" }) + const [formData, setFormData] = useState({ firstName: "" , lastName: "", picture: "" }) + const [errors, setErrors] = useState({ firstName: "" , lastName: "" }) + + const handleInputChange = (e) => { + setFormData((prevState) => ({ + ...prevState, + [e.target.name]: e.target.value, + })) + } return ( { gap={isMobileMod() ? "40px" : "80px"} > - - - - - {errors.username} - - - { id="lastName" name="lastName" value={formData.lastName} + onChange={handleInputChange} placeholder="Insira seu sobrenome" fontFamily="ubuntu" height="40px" @@ -221,6 +211,7 @@ const ProfileConfiguration = () => { id="website" name="website" value={formData.website} + onChange={handleInputChange} placeholder="Insira seu endereço URL" fontFamily="ubuntu" height="40px" @@ -243,6 +234,7 @@ const ProfileConfiguration = () => { id="github" name="github" value={formData.github} + onChange={handleInputChange} placeholder="Link para o perfil no GitHub" fontFamily="ubuntu" height="40px" @@ -258,6 +250,7 @@ const ProfileConfiguration = () => { id="twitter" name="twitter" value={formData.twitter} + onChange={handleInputChange} placeholder="Link para o perfil no Twitter" fontFamily="ubuntu" height="40px" @@ -273,6 +266,7 @@ const ProfileConfiguration = () => { id="linkedin" name="linkedin" value={formData.linkedin} + onChange={handleInputChange} placeholder="Link para o perfil no LinkedIn" fontFamily="ubuntu" height="40px" @@ -297,7 +291,10 @@ const ProfileConfiguration = () => { Atualizar perfil @@ -330,13 +327,15 @@ const ProfileConfiguration = () => { alignItems="center" justifyContent="center" position="absolute" - cursor="pointer" + // cursor="pointer" + cursor="default" bottom="10px" left="10px" width="32px" height="32px" borderRadius="50%" - backgroundColor="#2B8C4D" + backgroundColor="#C4C4C4" + // backgroundColor="#2B8C4D" > { const [formData, setFormData] = useState({ email: "", password: "" }) const [errors, setErrors] = useState({ email: "", password: ""}) + const handleInputChange = (e) => { + setFormData((prevState) => ({ + ...prevState, + [e.target.name]: e.target.value, + })) + } + return ( {errors.email} - + Deletar @@ -620,6 +627,27 @@ instruções enviadas no e-mail para completar a alteração.Alterar e-mail + {/* + Nome de usuário + dadinho + emailModal.onOpen()} + >Alterar nome de usuário + */} + Exportar dados da conta Saiba como seus dados são armazenados em nossos Termos de Uso e Políticas de Privacidade.{!isMobileMod() &&
} Para exportar os dados da sua conta, entre em contato conosco.
@@ -665,6 +693,13 @@ const NewPassword = () => { const [showNewPassword, setShowNewPassword] = useState(true) const [showConfirmPassword, setShowConfirmPassword] = useState(true) + const handleInputChange = (e) => { + setFormData((prevState) => ({ + ...prevState, + [e.target.name]: e.target.value, + })) + } + return ( { + { id="password" name="password" value={formData.password} - // onChange={handleInputChange} + onChange={handleInputChange} placeholder="Insira a senha atual" fontFamily="ubuntu" height="40px" @@ -794,10 +830,10 @@ const NewPassword = () => { { id="confirmPassword" name="confirmPassword" value={formData.confirmPassword} - // onChange={handleInputChange} + onChange={handleInputChange} placeholder="Insira a senha novamente" fontFamily="ubuntu" height="40px" @@ -922,7 +958,7 @@ const PlansAndPayment = () => { ] } - const TabContent = ({children}) => { + const TabContent = ({children, ...props}) => { return ( { borderBottom: "3px solid #2B8C4D", pointerEvents: "none" }} + {...props} > {children} @@ -1047,7 +1084,10 @@ const PlansAndPayment = () => { borderBottom= "2px solid #DEDFE0 !important" > Planos - Pagamento + Pagamento @@ -1096,7 +1136,10 @@ const PlansAndPayment = () => { Faça o upgrade
@@ -1275,6 +1318,7 @@ const Accesses = () => { borderRadius="30px" width={isMobileMod() ? "100%" : "fit-content"} _hover={{transform: "none"}} + cursor="default" backgroundColor="#C4C4C4" >Adicionar usuário