projectSettingsNavigation.tsx 1.2 KB

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