Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Saddlemountain Page
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Verónica Silva
Saddlemountain Page
Commits
2d098e0d
Commit
2d098e0d
authored
Nov 26, 2021
by
Verónica Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding icons to ContactForm
parent
2d02169d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
8 deletions
+82
-8
src/components/ContactForm.jsx
src/components/ContactForm.jsx
+71
-4
src/components/ContactModal.jsx
src/components/ContactModal.jsx
+9
-4
src/components/Footer.jsx
src/components/Footer.jsx
+2
-0
No files found.
src/components/ContactForm.jsx
View file @
2d098e0d
...
...
@@ -2,12 +2,21 @@ import React from "react"
import
PropTypes
from
"
prop-types
"
import
Button
from
"
@mui/material/Button
"
import
TextField
from
"
@mui/material/TextField
"
import
InputAdornment
from
"
@mui/material/InputAdornment
"
import
PersonRoundedIcon
from
"
@mui/icons-material/PersonRounded
"
import
EmailRoundedIcon
from
"
@mui/icons-material/EmailRounded
"
import
LocalPhoneRoundedIcon
from
"
@mui/icons-material/LocalPhoneRounded
"
import
CommentRoundedIcon
from
"
@mui/icons-material/CommentRounded
"
import
ArrowForwardIosRoundedIcon
from
"
@mui/icons-material/ArrowForwardIosRounded
"
import
Box
from
"
@mui/material/Box
"
import
{
styled
}
from
"
@mui/material/styles
"
import
ContactButton
from
"
./ContactButton
"
import
theme
from
"
../assets/styles/myTheme
"
const
myPalette
=
theme
.
palette
const
CustomTextField
=
styled
(
TextField
)(({
theme
,
borderColor
,
textColor
})
=>
({
"
& label.Mui-focused
"
:
{
...
...
@@ -29,6 +38,17 @@ const CustomTextField = styled(TextField)(({ theme, borderColor, textColor }) =>
},
}))
const
CustomButton
=
styled
(
Button
)(({
theme
})
=>
({
color
:
`
${
myPalette
.
secondary
.
text
}
!important`
,
backgroundColor
:
`
${
myPalette
.
secondary
.
main
}
!important`
,
paddingTop
:
"
5px !important
"
,
paddingBottom
:
"
5px !important
"
,
borderRadius
:
"
5px !important
"
,
"
&:hover
"
:
{
backgroundColor
:
`
${
myPalette
.
secondary
.
light
}
!important`
,
},
}))
function
FormFooter
({
borderColor
,
textColor
})
{
const
handleSubmit
=
(
event
)
=>
{
event
.
preventDefault
()
...
...
@@ -52,6 +72,13 @@ function FormFooter({borderColor, textColor}) {
label=
"Nombre"
name=
"name"
autoComplete=
"name"
InputProps=
{
{
startAdornment
:
(
<
InputAdornment
position=
"start"
>
<
PersonRoundedIcon
/>
</
InputAdornment
>
),
}
}
/>
<
CustomTextField
borderColor=
{
borderColor
}
...
...
@@ -64,6 +91,13 @@ function FormFooter({borderColor, textColor}) {
type=
"email"
id=
"email"
autoComplete=
"email"
InputProps=
{
{
startAdornment
:
(
<
InputAdornment
position=
"start"
>
<
EmailRoundedIcon
/>
</
InputAdornment
>
),
}
}
/>
<
CustomTextField
borderColor=
{
borderColor
}
...
...
@@ -76,10 +110,43 @@ function FormFooter({borderColor, textColor}) {
type=
"number"
id=
"phone"
autoComplete=
"phone"
InputProps=
{
{
startAdornment
:
(
<
InputAdornment
position=
"start"
>
<
LocalPhoneRoundedIcon
/>
</
InputAdornment
>
),
}
}
/>
<
CustomTextField
multiline
borderColor=
{
borderColor
}
textColor=
{
textColor
}
margin=
"normal"
required
fullWidth
name=
"message"
label=
"Mensaje"
type=
"text"
id=
"message"
autoComplete=
"message"
InputProps=
{
{
startAdornment
:
(
<
InputAdornment
position=
"start"
>
<
CommentRoundedIcon
/>
</
InputAdornment
>
),
}
}
/>
<
ContactButton
width=
"100%"
>
Contáctanos
</
ContactButton
>
<
CustomButton
variant=
"contained"
type=
"submit"
fullWidth
sx=
{
{
mt
:
1
,
mb
:
2
}
}
endIcon=
{
<
ArrowForwardIosRoundedIcon
/>
}
>
Consultar
</
CustomButton
>
</
Box
>
)
}
...
...
src/components/ContactModal.jsx
View file @
2d098e0d
...
...
@@ -14,7 +14,7 @@ import ContactForm from "./ContactForm"
const
myPalette
=
theme
.
palette
const
style
=
{
const
style
Box
=
{
position
:
"
absolute
"
,
top
:
"
50%
"
,
left
:
"
50%
"
,
...
...
@@ -29,6 +29,11 @@ const style = {
}
}
const
styleTitle
=
{
color
:
myPalette
.
primary
.
main
,
textAlign
:
"
center
"
}
function
ContactModal
({
open
,
handleModalClose
})
{
const
handleClose
=
()
=>
{
handleModalClose
(
false
)
...
...
@@ -48,9 +53,9 @@ function ContactModal({ open, handleModalClose }) {
}
}
>
<
Fade
in=
{
open
}
>
<
Box
sx=
{
style
}
>
<
Typography
id=
"transition-modal-title"
variant=
"h
6"
component=
"h2"
>
Text in a modal
<
Box
sx=
{
style
Box
}
>
<
Typography
id=
"transition-modal-title"
variant=
"h
5"
component=
"h1"
sx=
{
styleTitle
}
>
¡Contáctanos!
</
Typography
>
<
ContactForm
borderColor=
{
myPalette
.
primary
.
main
}
textColor=
{
myPalette
.
primary
.
main
}
/>
</
Box
>
...
...
src/components/Footer.jsx
View file @
2d098e0d
...
...
@@ -11,6 +11,8 @@ import ListItem from "@mui/material/ListItem"
import
ListItemText
from
"
@mui/material/ListItemText
"
import
ContactForm
from
"
./ContactForm
"
import
ContactButton
from
"
./ContactButton
"
import
{
FooterContainer
,
NavLinkFooter
}
from
"
../assets/styles/styled
"
import
myTheme
from
"
../assets/styles/myTheme
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment