Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use callback in the FileTree component to generate links for files. #71

Open
xfbs opened this issue Oct 20, 2024 · 0 comments
Open

Use callback in the FileTree component to generate links for files. #71

xfbs opened this issue Oct 20, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@xfbs
Copy link
Owner

xfbs commented Oct 20, 2024

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 a Fn(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 than Route::Diff.

@xfbs xfbs added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant