-
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.
feat: Componente do menu funcionando
- Loading branch information
Showing
15 changed files
with
195 additions
and
15 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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import { RouterProvider } from "react-router-dom"; | ||
import routes from "./routes"; | ||
import { useSharedWindowHeight } from "./hooks"; | ||
|
||
export default function App() { | ||
//======================================================= | ||
// Estado para observar o tamanho da janela | ||
const { setWindowHeight } = useSharedWindowHeight(); | ||
window.addEventListener("resize", function () { | ||
setWindowHeight(this.window.innerHeight); | ||
}); | ||
|
||
//======================================================= | ||
return <RouterProvider router={routes} />; | ||
} |
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
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 |
---|---|---|
@@ -1,18 +1,56 @@ | ||
import React from "react"; | ||
import Colors from "../../styles/Colors"; | ||
|
||
export default function Menu() { | ||
return ( | ||
<div | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
// position: "relative", | ||
overflowX: "auto", | ||
background: Colors.white, | ||
}} | ||
> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
<h1>Menu</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.logo1 { | ||
text-align: center; | ||
display: flex; | ||
z-index: 0; | ||
} | ||
|
||
.logo1 > .p-chart { | ||
|
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
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,25 @@ | ||
import { useRef, useState, useEffect } from "react"; | ||
import { useBetween } from "use-between"; | ||
import { useSharedWindowHeight } from "../../../hooks"; | ||
|
||
const useLogicState = () => { | ||
const ref = useRef(); | ||
const [height, setHeight] = useState(0); | ||
|
||
return { | ||
ref, | ||
height, | ||
setHeight, | ||
}; | ||
}; | ||
export const useSharedLogicState = () => useBetween(useLogicState); | ||
|
||
export function useOnInit() { | ||
const { setHeight, ref } = useSharedLogicState(); | ||
const { windowHeight } = useSharedWindowHeight(); | ||
|
||
useEffect(() => { | ||
const currentHeight = ref.current ? ref.current.offsetHeight : 0; | ||
setHeight((100 * currentHeight) / window.innerHeight); | ||
}, [ref.offsetHeight, windowHeight]); | ||
} |
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