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

Add repo selector #17

Open
chartgerink opened this issue Apr 24, 2024 · 0 comments
Open

Add repo selector #17

chartgerink opened this issue Apr 24, 2024 · 0 comments

Comments

@chartgerink
Copy link
Member

I want to still add a way for people to select the repository they want to contribute to. This requires loading all the repositories on which the application is installed, and providing a way to select them.

I previously implemented something that worked in the local development, but broke in the deployment because of netlify function security protocols. Old code included in the details.

  const [data, setData] = useState<any[]>([])

  useEffect(() => {
    fetch('/.netlify/functions/retrieve-installed-apps')
      .then((response) => response.json())
      .then((data) => {
        console.log(data)
        setData(data)
      })
  }, [])
....
 {!!data
             ? data.map((project) => ( 
            <li
                    key={project.repo}
                    className="col-span-1 flex rounded-md shadow-sm"
                  >
                    <div className="flex flex-1 items-center justify-between truncate rounded-r-md border-b border-r border-t border-gray-200 bg-white">
                      <img
                        className={classNames(
                          project.bgColor,
                          'contain flex w-16 flex-shrink-0 items-center justify-center rounded-l-md text-sm font-medium text-white'
                        )}
                        src={project.avatar}
                        alt={`Avatar of ${project.handle}, the group behind ${project.repo}`}
                      />
                      <div className="flex-1 truncate px-4 py-2 text-sm">
                        <a
                          href={project.href}
                          className="font-medium text-gray-900 hover:text-gray-600"
                        >
                          {project.repo}
                        </a>
                      </div>
                    </div>
                  </li>
            ))
            : ''}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant