-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se definen los componentes de las barras superior e inferior
- Loading branch information
Showing
6 changed files
with
168 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import BottomNavigation from '@mui/material/BottomNavigation'; | ||
import BottomNavigationAction from '@mui/material/BottomNavigationAction'; | ||
import Paper from '@mui/material/Paper'; | ||
import CatchingPokemonIcon from '@mui/icons-material/CatchingPokemon'; | ||
import StarIcon from '@mui/icons-material/Star'; | ||
import ExitToAppIcon from '@mui/icons-material/ExitToApp'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export default function FixedBottomNavigation() { | ||
const navigateTo = useNavigate(); | ||
return ( | ||
<Box sx={{ pb: 7, flexGrow: 1, display: { xs: 'flex', lg: 'none' }}} /* ref={ref} */> | ||
<CssBaseline /> | ||
<Paper sx={{ position: 'fixed', bottom: 0, left: 0, right: 0 }} elevation={3}> | ||
<BottomNavigation | ||
showLabels | ||
onChange={(event, newValue) => { | ||
if (newValue === '0'){ | ||
navigateTo('/'); | ||
} else if (newValue === '1') { | ||
navigateTo('/favorites'); | ||
} else if (newValue === '2') { | ||
/* navigateTo('/login') */ | ||
console.log(newValue); | ||
} | ||
}} | ||
> | ||
<BottomNavigationAction label="Pokémon" value='0' icon={<CatchingPokemonIcon />} /> | ||
<BottomNavigationAction label="Favorites" value='1' icon={<StarIcon />} /> | ||
<BottomNavigationAction label="Logout" value='2' icon={<ExitToAppIcon />} /> | ||
</BottomNavigation> | ||
</Paper> | ||
</Box> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material/Button'; | ||
import Menu from '@mui/material/Menu'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import FilterListIcon from '@mui/icons-material/FilterList'; | ||
|
||
export default function BasicMenu() { | ||
const [anchorEl, setAnchorEl] = React.useState(null); | ||
const open = Boolean(anchorEl); | ||
const handleClick = (event) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Button | ||
id="basic-button" | ||
aria-controls={open ? 'basic-menu' : undefined} | ||
aria-haspopup="true" | ||
aria-expanded={open ? 'true' : undefined} | ||
onClick={handleClick} | ||
> | ||
<FilterListIcon /> | ||
</Button> | ||
<Menu | ||
id="basic-menu" | ||
anchorEl={anchorEl} | ||
open={open} | ||
onClose={handleClose} | ||
MenuListProps={{ | ||
'aria-labelledby': 'basic-button', | ||
}} | ||
> | ||
<MenuItem onClick={handleClose}>Generation I</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation II</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation III</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation IV</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation V</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation VI</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation VII</MenuItem> | ||
<MenuItem onClick={handleClose}>Generation VIII</MenuItem> | ||
</Menu> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from 'react'; | ||
import { styled, alpha } from '@mui/material/styles'; | ||
import Box from '@mui/material/Box'; | ||
import InputBase from '@mui/material/InputBase'; | ||
import SearchIcon from '@mui/icons-material/Search'; | ||
|
||
const Search = styled('div')(({ theme }) => ({ | ||
position: 'relative', | ||
borderRadius: theme.shape.borderRadius, | ||
backgroundColor: alpha(theme.palette.common.white, 0.15), | ||
'&:hover': { | ||
backgroundColor: alpha(theme.palette.common.white, 0.25), | ||
}, | ||
marginLeft: 0, | ||
width: '100%', | ||
[theme.breakpoints.up('sm')]: { | ||
marginLeft: theme.spacing(1), | ||
width: 'auto', | ||
}, | ||
})); | ||
|
||
const SearchIconWrapper = styled('div')(({ theme }) => ({ | ||
padding: theme.spacing(0, 2), | ||
height: '100%', | ||
position: 'absolute', | ||
pointerEvents: 'none', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
})); | ||
|
||
const StyledInputBase = styled(InputBase)(({ theme }) => ({ | ||
color: 'inherit', | ||
'& .MuiInputBase-input': { | ||
padding: theme.spacing(1, 1, 1, 0), | ||
// vertical padding + font size from searchIcon | ||
paddingLeft: `calc(1em + ${theme.spacing(4)})`, | ||
transition: theme.transitions.create('width'), | ||
width: '100%', | ||
[theme.breakpoints.up('sm')]: { | ||
width: '12ch', | ||
'&:focus': { | ||
width: '20ch', | ||
}, | ||
}, | ||
}, | ||
})); | ||
|
||
export default function SearchAppBar() { | ||
return ( | ||
<Box sx={{ flexGrow: 1 }}> | ||
<Search> | ||
<SearchIconWrapper> | ||
<SearchIcon /> | ||
</SearchIconWrapper> | ||
<StyledInputBase | ||
placeholder="Search…" | ||
inputProps={{ 'aria-label': 'search' }} | ||
/> | ||
</Search> | ||
</Box> | ||
); | ||
} |