Skip to content

Commit

Permalink
feat: disable slide gesture around confirm slider button (#3240)
Browse files Browse the repository at this point in the history
* feat: disable slide gesture around confirm slider button

Signed-off-by: Prakhar Agarwal <[email protected]>

* fix: add addToBulletin field to StatefulNotifications

Signed-off-by: Prakhar Agarwal <[email protected]>

---------

Signed-off-by: Prakhar Agarwal <[email protected]>
  • Loading branch information
Prakhar-Agarwal-byte authored May 1, 2024
1 parent 62c5d3d commit a289337
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/graphql/generated.gql
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ query StatefulNotifications($after: String) {
deepLink
createdAt
acknowledgedAt
addToBulletin
__typename
}
pageInfo {
Expand Down
7 changes: 6 additions & 1 deletion app/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ export type Mutation = {
readonly quizClaim: QuizClaimPayload;
readonly statefulNotificationAcknowledge: StatefulNotificationAcknowledgePayload;
readonly supportChatMessageAdd: SupportChatMessageAddPayload;
readonly supportChatReset: SuccessPayload;
/** @deprecated will be moved to AccountContact */
readonly userContactUpdateAlias: UserContactUpdateAliasPayload;
readonly userEmailDelete: UserEmailDeletePayload;
Expand Down Expand Up @@ -1814,6 +1815,7 @@ export type SettlementViaOnChain = {
export type StatefulNotification = {
readonly __typename: 'StatefulNotification';
readonly acknowledgedAt?: Maybe<Scalars['Timestamp']['output']>;
readonly addToBulletin: Scalars['Boolean']['output'];
readonly body: Scalars['String']['output'];
readonly createdAt: Scalars['Timestamp']['output'];
readonly deepLink?: Maybe<Scalars['String']['output']>;
Expand Down Expand Up @@ -2621,7 +2623,7 @@ export type StatefulNotificationsQueryVariables = Exact<{
}>;


export type StatefulNotificationsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly statefulNotifications: { readonly __typename: 'StatefulNotificationConnection', readonly nodes: ReadonlyArray<{ readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null }>, readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null } } } | null };
export type StatefulNotificationsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly statefulNotifications: { readonly __typename: 'StatefulNotificationConnection', readonly nodes: ReadonlyArray<{ readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly addToBulletin: boolean }>, readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null } } } | null };

export type StatefulNotificationAcknowledgeMutationVariables = Exact<{
input: StatefulNotificationAcknowledgeInput;
Expand Down Expand Up @@ -4821,6 +4823,7 @@ export const StatefulNotificationsDocument = gql`
deepLink
createdAt
acknowledgedAt
addToBulletin
}
pageInfo {
endCursor
Expand Down Expand Up @@ -8825,6 +8828,7 @@ export type MutationResolvers<ContextType = any, ParentType extends ResolversPar
quizClaim?: Resolver<ResolversTypes['QuizClaimPayload'], ParentType, ContextType, RequireFields<MutationQuizClaimArgs, 'input'>>;
statefulNotificationAcknowledge?: Resolver<ResolversTypes['StatefulNotificationAcknowledgePayload'], ParentType, ContextType, RequireFields<MutationStatefulNotificationAcknowledgeArgs, 'input'>>;
supportChatMessageAdd?: Resolver<ResolversTypes['SupportChatMessageAddPayload'], ParentType, ContextType, RequireFields<MutationSupportChatMessageAddArgs, 'input'>>;
supportChatReset?: Resolver<ResolversTypes['SuccessPayload'], ParentType, ContextType>;
userContactUpdateAlias?: Resolver<ResolversTypes['UserContactUpdateAliasPayload'], ParentType, ContextType, RequireFields<MutationUserContactUpdateAliasArgs, 'input'>>;
userEmailDelete?: Resolver<ResolversTypes['UserEmailDeletePayload'], ParentType, ContextType>;
userEmailRegistrationInitiate?: Resolver<ResolversTypes['UserEmailRegistrationInitiatePayload'], ParentType, ContextType, RequireFields<MutationUserEmailRegistrationInitiateArgs, 'input'>>;
Expand Down Expand Up @@ -9120,6 +9124,7 @@ export interface SignedDisplayMajorAmountScalarConfig extends GraphQLScalarTypeC

export type StatefulNotificationResolvers<ContextType = any, ParentType extends ResolversParentTypes['StatefulNotification'] = ResolversParentTypes['StatefulNotification']> = {
acknowledgedAt?: Resolver<Maybe<ResolversTypes['Timestamp']>, ParentType, ContextType>;
addToBulletin?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
body?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
createdAt?: Resolver<ResolversTypes['Timestamp'], ParentType, ContextType>;
deepLink?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gql`
deepLink
createdAt
acknowledgedAt
addToBulletin
}
pageInfo {
endCursor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from "react"
import { ActivityIndicator, TouchableOpacity, View } from "react-native"
import { PanGestureHandler } from "react-native-gesture-handler"
import ReactNativeHapticFeedback from "react-native-haptic-feedback"

import { gql } from "@apollo/client"
Expand Down Expand Up @@ -422,13 +423,18 @@ const SendBitcoinConfirmationScreen: React.FC<Props> = ({ route }) => {
</View>
) : null}
<View style={styles.buttonContainer}>
<GaloySliderButton
isLoading={sendPaymentLoading}
initialText={LL.SendBitcoinConfirmationScreen.slideToConfirm()}
loadingText={LL.SendBitcoinConfirmationScreen.slideConfirming()}
onSwipe={handleSendPayment}
disabled={!validAmount || hasAttemptedSend}
/>
{/* disable slide gestures in area around the slider button */}
<PanGestureHandler>
<View style={styles.sliderContainer}>
<GaloySliderButton
isLoading={sendPaymentLoading}
initialText={LL.SendBitcoinConfirmationScreen.slideToConfirm()}
loadingText={LL.SendBitcoinConfirmationScreen.slideConfirming()}
onSwipe={handleSendPayment}
disabled={!validAmount || hasAttemptedSend}
/>
</View>
</PanGestureHandler>
</View>
</View>
</Screen>
Expand All @@ -442,6 +448,7 @@ const useStyles = makeStyles(({ colors }) => ({
flex: 1,
},
fieldContainer: {
paddingHorizontal: 20,
marginBottom: 12,
},
noteText: {
Expand Down Expand Up @@ -537,7 +544,7 @@ const useStyles = makeStyles(({ colors }) => ({
alignItems: "center",
},
screenStyle: {
padding: 20,
paddingTop: 20,
flexGrow: 1,
},
iconContainer: {
Expand All @@ -560,4 +567,7 @@ const useStyles = makeStyles(({ colors }) => ({
justifyContent: "space-between",
alignItems: "center",
},
sliderContainer: {
padding: 20,
},
}))

0 comments on commit a289337

Please sign in to comment.