-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid hardcoding entry when initially selecting entry id (#20)
* fix: avoid hardcoding entry when initially selecting entry id * fix: avoid flickering when loading initial entry * fix: add back animation to enetry selection * fix: avoid resize-flicker in graph
- Loading branch information
Showing
6 changed files
with
88 additions
and
30 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
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,21 @@ | ||
import { useColorScheme } from 'nativewind'; | ||
import { useEffect, type PropsWithChildren } from 'react'; | ||
|
||
export function ThemeProvider({ children }: PropsWithChildren) { | ||
useWorkaroundForThemeClass(); | ||
|
||
return children; | ||
} | ||
|
||
function useWorkaroundForThemeClass() { | ||
const { colorScheme } = useColorScheme(); | ||
|
||
useEffect(() => { | ||
if (document.body) { | ||
document.body.classList.remove('light-theme', 'dark-theme'); | ||
if (colorScheme) { | ||
document.body.className = `${colorScheme}-theme`; | ||
} | ||
} | ||
}, [colorScheme]); | ||
} |
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,8 @@ | ||
import cn from 'classnames'; | ||
// @ts-expect-error | ||
import LoaderIcon from 'lucide-react/dist/esm/icons/loader-2'; | ||
import { type ComponentProps } from 'react'; | ||
|
||
export function Spinner({ className, ...props }: ComponentProps<typeof LoaderIcon>) { | ||
return <LoaderIcon className={cn('animate-spin', className)} {...props} />; | ||
} |