summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/_app.tsx5
-rw-r--r--pages/index.tsx6
2 files changed, 6 insertions, 5 deletions
diff --git a/pages/_app.tsx b/pages/_app.tsx
index e6332de..c9dc93f 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -44,7 +44,7 @@ function MyApp({ Component, pageProps }: AppProps) {
const theme = useMemo(() => {
const borderColor = emacsTheme.violet + 'aa'
const bgfgInterpolate = d3int.interpolate(emacsTheme.bg, emacsTheme.fg)
- return extendTheme({
+ const themeColors = {
colors: {
white: emacsTheme.bg,
black: emacsTheme.fg,
@@ -98,7 +98,8 @@ function MyApp({ Component, pageProps }: AppProps) {
shadows: {
outline: '0 0 0 3px ' + borderColor,
},
- })
+ }
+ return extendTheme(themeColors)
}, [JSON.stringify(emacsTheme)])
return (
diff --git a/pages/index.tsx b/pages/index.tsx
index 98ab795..59a15f2 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -420,10 +420,10 @@ export const Graph = function (props: GraphProps) {
// otherwise links with parents get shown as having one note
const linklen = linksByNodeId[node.id!]?.length ?? 0
const parentCiteNeighbors = linklen
- ? linksByNodeId[node.id]?.filter((link) => link.type === 'parent' || link.type === 'cite')
+ ? linksByNodeId[node.id!]?.filter((link) => link.type === 'parent' || link.type === 'cite')
.length
: 0
- const neighbors = filter.parents ? linklen : linklen - parentCiteNeighbors
+ const neighbors = filter.parents ? linklen : linklen - parentCiteNeighbors!
return theme.colors[palette[numbereWithinRange(neighbors, 0, palette.length - 1)]][500]
},
@@ -435,7 +435,7 @@ export const Graph = function (props: GraphProps) {
: 0
const basicSize = 3 + links.length - (!filter.parents ? parentNeighbors : 0)
if (physics.highlightAnim) {
- const wasNeighbor = (link) =>
+ const wasNeighbor = (link: OrgRoamLink) =>
link.source === lastHoverNode.current?.id! || link.target === lastHoverNode.current?.id!
const wasHighlightedNode = links.some(wasNeighbor)
const highlightSize = highlightedNodes[node.id!]