projectSettingsNavigation.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import {useContext} from 'react';
  2. import AppStoreConnectContext from 'sentry/components/projects/appStoreConnectContext';
  3. import type {Organization, Project} from 'sentry/types';
  4. import withProject from 'sentry/utils/withProject';
  5. import SettingsNavigation from 'sentry/views/settings/components/settingsNavigation';
  6. import getConfiguration from 'sentry/views/settings/project/navigationConfiguration';
  7. type Props = {
  8. organization: Organization;
  9. project?: Project;
  10. };
  11. function ProjectSettingsNavigation({organization, project}: Props) {
  12. const appStoreConnectContext = useContext(AppStoreConnectContext);
  13. const debugFilesNeedsReview = appStoreConnectContext
  14. ? Object.keys(appStoreConnectContext).some(
  15. key => appStoreConnectContext[key].credentials.status === 'invalid'
  16. )
  17. : false;
  18. return (
  19. <SettingsNavigation
  20. navigationObjects={getConfiguration({project, organization, debugFilesNeedsReview})}
  21. access={new Set(organization.access)}
  22. features={new Set(organization.features)}
  23. organization={organization}
  24. project={project}
  25. />
  26. );
  27. }
  28. export default withProject(ProjectSettingsNavigation);