react app in first component call github via api using oktokit and lists all repo inside…
- User
react app in first component call github via api using oktokit and lists all repo inside org (org name is hardcoded), result of call is passed to second component which displays repo names with radio buttons. depending on search input repo names list is dynamically changed, then result is passeed to third component that calls github again and search for code string via input form, but only in repos passed from component 2, please write example for all 3 components
- Assistant
First Component (GitHubRepoFetcher.js)
code - User
write again Third Component (CodeSearcher.js)
- Assistant
Third Component (CodeSearcher.js)
code - User
please include this in create react app
- Assistant
To include the above components in a Create React App project, you would need to do the following:
- Create a new Create React App project by running
npx create-react-app my-appin your terminal. - In the
srcdirectory, create a new folder calledcomponents. Inside thecomponentsfolder, create three new files calledRepoList.js,RepoSelector.js, andCodeSearcher.js - Copy the code for each of the components that I provided earlier into their respective files.
- In the
src/App.jsfile, import the three components at the top of the file:
codeimport RepoList from './components/RepoList'; import RepoSelector from './components/RepoSelector'; import CodeSearcher from './components/CodeSearcher';- In the
src/App.jsfile, replace the defaultreturnstatement with the following:
- Create a new Create React App project by running
- User
write jira task list for everything including create react app part
- Assistant
Here is a sample Jira task list for creating a React app that calls GitHub's API using Oktokit, lists all repos in an organization, allows for dynamic searching of repo names, and searches for code strings in selected repos:
- Task 1: Create React App
- Sub-task 1: Create a new Create React App project
- Sub-task 2: Set up the file structure for the components
- Task 2: Repo List Component
- Sub-task 1: Create a new component called
RepoList - Sub-task 2: Use Oktokit to call GitHub's API and retrieve a list of all repos in a specified organization
- Sub-task 3: Pass the list of repos to the next component