Compare commits

...

2 commits

Author SHA1 Message Date
Dariusz Niemczyk 69402fd4c6
oops
Some checks failed
/ deploy (push) Failing after 2s
2025-02-13 00:48:40 +01:00
Dariusz Niemczyk 3c5a17d086
test1 2025-02-13 00:46:44 +01:00

View file

@ -25,7 +25,7 @@ export function Nav({
t: typeof translations.pl t: typeof translations.pl
}) { }) {
const { theme, setTheme } = useTheme() const { theme, setTheme } = useTheme()
const [activeSection, setActiveSection] = useState<Sections>("about") const [activeSection] = useState<Sections>("about")
useEffect(() => { useEffect(() => {
@ -44,8 +44,8 @@ export function Nav({
entries.forEach(entry => { entries.forEach(entry => {
const target = entry.target.id as keyof (typeof translations.pl)["nav"] const target = entry.target.id as keyof (typeof translations.pl)["nav"]
if (entry.isIntersecting) { if (entry.isIntersecting) {
setActiveSection(target); // setActiveSection(target);
if (window.location.hash !== `#${target}` && history.replaceState) { if (history.replaceState) {
timeout = setTimeout(() => { timeout = setTimeout(() => {
history.replaceState(null, "", `#${target}`) history.replaceState(null, "", `#${target}`)
}, 150) }, 150)