diff --git a/src/scan/camera/Camera.tsx b/src/scan/camera/Camera.tsx index 711cf840..02da872c 100644 --- a/src/scan/camera/Camera.tsx +++ b/src/scan/camera/Camera.tsx @@ -16,7 +16,6 @@ import { useCheckin } from '../_queries/useCheckin'; import { isInRange } from '../_util/isInRange'; import CameraSettings from '../cameraSettings/CameraSettings'; import CameraOverlay from './CameraOverlay'; -import { useGetMe } from '../../profile/_queries/useGetMe'; const overlaySettings: TOverlayDimensions = { cornerLength: 20, diff --git a/src/shopDetail/ShopDetail.tsx b/src/shopDetail/ShopDetail.tsx index 6437c179..695cf5c2 100644 --- a/src/shopDetail/ShopDetail.tsx +++ b/src/shopDetail/ShopDetail.tsx @@ -159,7 +159,7 @@ export const ShopDetail = ({ route }: TProps) => { {hasFamilyMembers && !isRedeemStatusLoading && redeemStatus?.redeemable && !redeemStatusError && (
- +
)} diff --git a/src/shopDetail/_components/redeemFamilyMembers/RedeemFamilyMembers.tsx b/src/shopDetail/_components/redeemFamilyMembers/RedeemFamilyMembers.tsx index 0e71cac6..81cf8842 100644 --- a/src/shopDetail/_components/redeemFamilyMembers/RedeemFamilyMembers.tsx +++ b/src/shopDetail/_components/redeemFamilyMembers/RedeemFamilyMembers.tsx @@ -3,19 +3,20 @@ import { useCallback } from 'react'; import { FamilyMembersPoints } from '../../../_components/family/familyMembersPoints/FamilyMembersPoints'; import { useGetFamilyMembers } from '../../../onboarding/family/_queries'; import { TFamilyMember } from '../../../profile/_models'; +import { TReward } from '../../../shop/_models/reward'; import { RedeemButton } from './redeemButton/RedeemButton'; type TProps = { onRedeem: (member: TFamilyMember) => void; - rewardId: string; + reward: TReward; }; -export const RedeemFamilyMembers = ({ rewardId, onRedeem }: TProps) => { +export const RedeemFamilyMembers = ({ reward, onRedeem }: TProps) => { const { data: familyMembers = [] } = useGetFamilyMembers(); const RedeemButtonMemoized = useCallback( - ({ item: { member } }) => onRedeem(member)} rewardId={rewardId} />, - [onRedeem, rewardId], + ({ item: { member } }) => onRedeem(member)} reward={reward} />, + [onRedeem, reward], ); return ({ member }))} />; diff --git a/src/shopDetail/_components/redeemFamilyMembers/redeemButton/RedeemButton.tsx b/src/shopDetail/_components/redeemFamilyMembers/redeemButton/RedeemButton.tsx index 550a4664..7f5697b3 100644 --- a/src/shopDetail/_components/redeemFamilyMembers/redeemButton/RedeemButton.tsx +++ b/src/shopDetail/_components/redeemFamilyMembers/redeemButton/RedeemButton.tsx @@ -1,22 +1,23 @@ import { useTranslation } from 'react-i18next'; -import { BlurredModal, Button, Typography } from '../../../../_components'; +import { BlurredModal, Button, Icon, Typography } from '../../../../_components'; import { useToggle } from '../../../../_hooks'; import { TFamilyMember } from '../../../../profile/_models'; +import { TReward } from '../../../../shop/_models/reward'; import { useGetRedeemStatus } from '../../../_queries/useGetRedeemStatus'; import * as Styled from './style'; type TProps = { member: TFamilyMember; onPress: () => void; - rewardId: string; + reward: TReward; }; -export const RedeemButton = ({ member, onPress, rewardId }: TProps) => { +export const RedeemButton = ({ member, onPress, reward }: TProps) => { const { t } = useTranslation(); const [showUnredeemableModal, toggleUnredeemableModal] = useToggle(false); - const { error, isLoading } = useGetRedeemStatus({ passHolder: member.passholder, rewardId }); + const { error, isLoading } = useGetRedeemStatus({ passHolder: member.passholder, rewardId: reward.id }); if (isLoading) { return