-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: improved results api * spike: virtualize/windowing * fix: keyboard handling adjusted for virtualized * poc for tom * alternative virtualization solution * cleanup, no need for exposing handlers * cleanup * cleanup old apis, KBarResults by default virtualized
- Loading branch information
Showing
10 changed files
with
289 additions
and
455 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,23 +1,46 @@ | ||
import * as React from "react"; | ||
import useRegisterActions from "../../src/useRegisterActions"; | ||
import { createAction } from "../../src/utils"; | ||
|
||
export default function Blog() { | ||
useRegisterActions([ | ||
{ | ||
id: "dynamicAction1", | ||
name: "Action only visible in Blog", | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => window.alert("dynamic action"), | ||
}, | ||
{ | ||
id: "dynamicAction2", | ||
name: "Another action only visible in Blog", | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => window.alert("dynamic action"), | ||
}, | ||
]); | ||
const [actions, setActions] = React.useState( | ||
Array.from(Array(4)).map((_, i) => | ||
createAction({ | ||
name: i.toString(), | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => alert(i), | ||
}) | ||
) | ||
); | ||
|
||
React.useEffect(() => { | ||
setTimeout(() => { | ||
setActions((actions) => [ | ||
...actions, | ||
createAction({ | ||
name: "Surprise", | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => alert("Surprise"), | ||
}), | ||
createAction({ | ||
name: "Surprise 2", | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => alert("Surprise 2"), | ||
}), | ||
createAction({ | ||
name: "Surprise 3", | ||
shortcut: [], | ||
keywords: "", | ||
perform: () => alert("Surprise 3"), | ||
}), | ||
]); | ||
}, 2000); | ||
}, []); | ||
|
||
useRegisterActions(actions, [actions]); | ||
|
||
return <div>Blog</div>; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
a9d9aa5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: