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

Repository File Browser Component #12

Open
LamboCreeper opened this issue Apr 29, 2024 · 0 comments
Open

Repository File Browser Component #12

LamboCreeper opened this issue Apr 29, 2024 · 0 comments
Labels
accepted The issue is accepted and PRs are welcome enhancement New feature or request
Milestone

Comments

@LamboCreeper
Copy link
Member

LamboCreeper commented Apr 29, 2024

Description

Create a new component which takes three parameters of user: string, repository: string, commit: string.
With these parameters, use the GitHub API to get the repository's contents.

Loop through each item returned:

  • If the type is file: display the name of the file WITH extension.
    • On click of this, set it to be the active file
  • If the type is dir: display the name of the folder appended with /
    • On click of this, fetch the contents of the given folder using the same API
    • Render another section for this (the UI wireframe hopefully makes this clearer)

I would recommend having a top level RepositoryFileBrowser component and then render a:

  • RepositoryFileBrowserFile component for an individual file
  • RepositoryFileBrowserFolder component for a folder, which then does the same

UI Wireframe

image

The active file is highlighted blue. On hover on a file/folder it should be highlighted (light grey in the wireframe). Clicking on a folder shows the files within the folder, indented. Keep indenting for each level deeper you go.

User Story

As a user
I want to browse the files and folders within a repository
So that I can open the selected file to review it

Notes

@LamboCreeper LamboCreeper added accepted The issue is accepted and PRs are welcome enhancement New feature or request labels Apr 29, 2024
@LamboCreeper LamboCreeper added this to the MVP milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue is accepted and PRs are welcome enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant