Skip to content

Commit

Permalink
fix: ajout de condition pour afficher/cacher le bouton
Browse files Browse the repository at this point in the history
Signed-off-by: fc-santos <[email protected]>
  • Loading branch information
fc-santos committed Oct 2, 2024
1 parent bbbbf86 commit 8096c85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/components/AddCredentialButton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { testIdWithKey, Button, ButtonType } from '@hyperledger/aries-bifold-core'
import { testIdWithKey, Button, ButtonType, CredentialListFooterProps } from '@hyperledger/aries-bifold-core'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { View, DeviceEventEmitter, StyleSheet } from 'react-native'

import { BCWalletEventTypes } from '../events/eventTypes'

const AddCredentialButton = () => {
const AddCredentialButton: React.FC<CredentialListFooterProps> = ({ credentialsCount }) => {
const { t } = useTranslation()

const activateSlider = useCallback(() => {
Expand All @@ -19,7 +19,7 @@ const AddCredentialButton = () => {
},
})

return (
return credentialsCount > 0 ? (
<View style={styles.container}>
<Button
title={t('Credentials.AddCredential')}
Expand All @@ -28,7 +28,7 @@ const AddCredentialButton = () => {
onPress={activateSlider}
/>
</View>
)
) : null
}

export default AddCredentialButton

0 comments on commit 8096c85

Please sign in to comment.