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
9e7620d9
Commit
9e7620d9
authored
Nov 23, 2021
by
VeroSilva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using the new palette on Navbar
parent
eadfdcf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
src/components/Navbar.jsx
src/components/Navbar.jsx
+26
-22
No files found.
src/components/Navbar.jsx
View file @
9e7620d9
import
*
as
React
from
"
react
"
;
import
PropTypes
from
"
prop-types
"
;
import
AppBar
from
"
@mui/material/AppBar
"
;
import
Toolbar
from
"
@mui/material/Toolbar
"
;
import
Typography
from
"
@mui/material/Typography
"
;
import
useScrollTrigger
from
"
@mui/material/useScrollTrigger
"
;
import
Slide
from
"
@mui/material/Slide
"
;
import
*
as
React
from
"
react
"
import
PropTypes
from
"
prop-types
"
import
AppBar
from
"
@mui/material/AppBar
"
import
Toolbar
from
"
@mui/material/Toolbar
"
import
Typography
from
"
@mui/material/Typography
"
import
useScrollTrigger
from
"
@mui/material/useScrollTrigger
"
import
Slide
from
"
@mui/material/Slide
"
import
{
useTheme
,
useMediaQuery
,
}
from
"
@material-ui/core
"
;
}
from
"
@material-ui/core
"
import
Drawer
from
"
./Drawer
"
import
{
NavLink
}
from
"
./styled
"
import
theme
from
"
./palette
"
import
Drawer
from
"
./Drawer
"
;
import
{
NavLink
}
from
"
./styled
"
;
import
{
color
}
from
"
@mui/system
"
;
const
myPalette
=
theme
.
palette
function
HideOnScroll
(
props
)
{
const
{
children
,
window
}
=
props
;
const
{
children
,
window
}
=
props
const
trigger
=
useScrollTrigger
({
target
:
window
?
window
()
:
undefined
,
})
;
})
return
(
<
Slide
appear=
{
false
}
direction=
"down"
in=
{
!
trigger
}
>
{
children
}
</
Slide
>
)
;
)
}
HideOnScroll
.
propTypes
=
{
children
:
PropTypes
.
element
.
isRequired
,
window
:
PropTypes
.
func
,
}
;
}
function
Navbar
(
props
)
{
const
theme
=
useTheme
()
;
const
isMobile
=
useMediaQuery
(
theme
.
breakpoints
.
down
(
"
sm
"
))
;
const
theme
=
useTheme
()
const
isMobile
=
useMediaQuery
(
theme
.
breakpoints
.
down
(
"
sm
"
))
return
(
<
HideOnScroll
{
...
props
}
>
<
AppBar
sx=
{
{
backgroundColor
:
"
#074B6B !important
"
,
backgroundColor
:
`${myPalette.primary.main} !important`
,
px
:
{
lg
:
8
,
},
color
:
{
md
:
"
#ffffff !important
"
,
sm
:
"
#404040 !important
"
md
:
`${myPalette.primary.contrastText} !important`
,
sm
:
`${myPalette.primary.text} !important`
,
}
}
}
>
<
Toolbar
>
...
...
@@ -71,7 +75,7 @@ function Navbar(props) {
</
Toolbar
>
</
AppBar
>
</
HideOnScroll
>
)
;
)
};
export
default
Navbar
;
export
default
Navbar
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