Use callback in the FileTree component to generate links for files. #71
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
In the FileTree component, clicking on a file works like clicking on a link.
We want to be able to use this component in multiple places. For that reason, we need to have some way for it to translate a path into a link. Currently, this translation is hard-coded. But ideally, it should accept some kind of a
Callback
that is aFn(Utf8PathBuf) -> Route
so that we can use it in arbitrary places.Example use-case of this is to use this component in the view where you can see a diff between a crate and what is in the repository. In that case, the links need to be
Route::RepoFile
rather thanRoute::Diff
.The text was updated successfully, but these errors were encountered: