Skip to content

Commit 4431f07

Browse files
committed
Fix when to show text about code access
1 parent ab84931 commit 4431f07

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/components/src/containers/EventCardsContainer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import React, { useCallback } from 'react'
88
import { View } from 'react-native'
99
import { useDispatch } from 'react-redux'
1010

11+
import { constants } from '@devhub/core'
12+
1113
import { CardsSearchHeader } from '../components/cards/CardsSearchHeader'
1214
import { EmptyCards } from '../components/cards/EmptyCards'
1315
import { EventCards, EventCardsProps } from '../components/cards/EventCards'
@@ -249,7 +251,10 @@ export const EventCardsContainer = React.memo(
249251
['USER_ORG_EVENTS'].includes(s.subtype || ''),
250252
)
251253
? 'Create a token with this permission:'
252-
: 'Install the GitHub App to unlock private access. No code permission required.'
254+
: 'Install the GitHub App to unlock private access.' +
255+
(!constants.GITHUB_APP_HAS_CODE_ACCESS
256+
? ' No code permission required.'
257+
: '')
253258
}
254259
title="Private repository?"
255260
/>

packages/components/src/containers/IssueOrPullRequestCardsContainer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import React, { useCallback } from 'react'
88
import { View } from 'react-native'
99
import { useDispatch } from 'react-redux'
1010

11+
import { constants } from '@devhub/core'
12+
1113
import { CardsSearchHeader } from '../components/cards/CardsSearchHeader'
1214
import { EmptyCards } from '../components/cards/EmptyCards'
1315
import { GenericMessageWithButtonView } from '../components/cards/GenericMessageWithButtonView'
@@ -223,7 +225,12 @@ export const IssueOrPullRequestCardsContainer = React.memo(
223225
</>
224226
}
225227
emoji="lock"
226-
subtitle="Install the GitHub App to unlock private access. No code permission required."
228+
subtitle={
229+
'Install the GitHub App to unlock private access.' +
230+
(!constants.GITHUB_APP_HAS_CODE_ACCESS
231+
? ' No code permission required.'
232+
: '')
233+
}
227234
title="Private repository?"
228235
/>
229236
</View>

0 commit comments

Comments
 (0)