Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cf2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vojtech.pikal
cf2021
Commits
6b0b29f1
Commit
6b0b29f1
authored
4 years ago
by
xaralis
Browse files
Options
Downloads
Patches
Plain Diff
feat: toggle open/close footer menu sections
parent
3f17c283
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Footer.jsx
+28
-5
28 additions, 5 deletions
src/components/Footer.jsx
with
28 additions
and
5 deletions
src/components/Footer.jsx
+
28
−
5
View file @
6b0b29f1
import
React
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
NavLink
}
from
"
react-router-dom
"
;
import
useWindowSize
from
"
@rooks/use-window-size
"
;
import
classNames
from
"
classnames
"
;
const
Footer
=
()
=>
{
const
{
innerWidth
}
=
useWindowSize
();
const
[
showCfMenu
,
setShowCfMenu
]
=
useState
(
false
);
const
[
showOtherMenu
,
setShowOtherMenu
]
=
useState
(
false
);
const
isLg
=
innerWidth
>=
1024
;
return
(
<
footer
className
=
"footer bg-grey-700 text-white"
>
<
div
className
=
"footer__main py-4 lg:py-16 container container--default"
>
...
...
@@ -19,10 +26,18 @@ const Footer = () => {
<
section
className
=
"footer__main-links bg-grey-700 text-white lg:grid grid-cols-2 gap-4"
>
<
div
className
=
"pt-8 pb-4 lg:py-0"
>
<
div
className
=
"footer-collapsible"
>
<
span
className
=
"text-xl uppercase text-white footer-collapsible__toggle"
>
<
span
className
=
{
classNames
(
"
text-xl uppercase text-white footer-collapsible__toggle
"
,
{
"
footer-collapsible__toggle--open
"
:
showCfMenu
,
}
)
}
onClick
=
{
()
=>
setShowCfMenu
(
!
showCfMenu
)
}
>
CF 2021
</
span
>
{
"
"
}
<
div
className
=
""
>
<
div
className
=
{
showCfMenu
||
isLg
?
""
:
"
hidden
"
}
>
<
ul
className
=
"mt-6 space-y-2 text-grey-200"
>
<
li
>
<
NavLink
to
=
"/"
>
Přímý přenos
</
NavLink
>
...
...
@@ -42,10 +57,18 @@ const Footer = () => {
</
div
>
<
div
className
=
"py-4 lg:py-0 border-t border-grey-400 lg:border-t-0"
>
<
div
className
=
"footer-collapsible"
>
<
span
className
=
"text-xl uppercase text-white footer-collapsible__toggle"
>
<
span
className
=
{
classNames
(
"
text-xl uppercase text-white footer-collapsible__toggle
"
,
{
"
footer-collapsible__toggle--open
"
:
showOtherMenu
,
}
)
}
onClick
=
{
()
=>
setShowOtherMenu
(
!
showOtherMenu
)
}
>
Otevřenost
</
span
>
{
"
"
}
<
div
className
=
""
>
<
div
className
=
{
showOtherMenu
||
isLg
?
""
:
"
hidden
"
}
>
<
ul
className
=
"mt-6 space-y-2 text-grey-200"
>
<
li
>
<
a
href
=
"https://ucet.pirati.cz"
>
Transparentní účet
</
a
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment