1- import React from 'react' ;
2- import { Alert } from 'react-native' ;
1+ // import React from 'react';
2+ // import { Alert } from 'react-native';
33import { LocalMessage , StreamChat } from 'stream-chat' ;
44import {
55 Colors ,
66 messageActions ,
77 MessageActionsParams ,
88 TranslationContextValue ,
9- Bell ,
9+ // Bell,
1010} from 'stream-chat-react-native' ;
1111import { Theme } from 'stream-chat-react-native' ;
1212
1313export function channelMessageActions ( {
1414 params,
15- chatClient,
16- t,
17- // handleMessageInfo,
18- semantics,
15+ // chatClient,
16+ // t,
17+ // // handleMessageInfo,
18+ // semantics,
1919} : {
2020 params : MessageActionsParams ;
2121 chatClient : StreamChat ;
@@ -24,11 +24,11 @@ export function channelMessageActions({
2424 handleMessageInfo : ( message : LocalMessage ) => void ;
2525 semantics : Theme [ 'semantics' ] ;
2626} ) {
27- const { dismissOverlay, error /*deleteForMeMessage*/ } = params ;
27+ // const { dismissOverlay, error /*deleteForMeMessage*/ } = params;
2828 const actions = messageActions ( params ) ;
2929
3030 // We cannot use the useMessageReminder hook here because it is a hook.
31- const reminder = chatClient . reminders . getFromState ( params . message . id ) ;
31+ // const reminder = chatClient.reminders.getFromState(params.message.id);
3232
3333 // actions.push({
3434 // action: async () => {
@@ -48,54 +48,54 @@ export function channelMessageActions({
4848 // icon: <Time width={20} height={20} stroke={semantics.textSecondary} />,
4949 // type: 'standard',
5050 // });
51- if ( ! error ) {
52- actions . push ( {
53- action : ( ) => {
54- if ( reminder ) {
55- Alert . alert ( 'Remove Reminder' , 'Are you sure you want to remove this reminder?' , [
56- {
57- text : 'Cancel' ,
58- style : 'cancel' ,
59- } ,
60- {
61- text : 'Remove' ,
62- onPress : ( ) => {
63- chatClient . reminders . deleteReminder ( reminder . id ) . catch ( ( err ) => {
64- console . error ( 'Error deleting reminder:' , err ) ;
65- } ) ;
66- } ,
67- style : 'destructive' ,
68- } ,
69- ] ) ;
70- } else {
71- Alert . alert (
72- 'Select Reminder Time' ,
73- 'When would you like to be reminded?' ,
74- chatClient . reminders . scheduledOffsetsMs . map ( ( offsetMs ) => ( {
75- text : t ( 'duration/Remind Me' , { milliseconds : offsetMs } ) ,
76- onPress : ( ) => {
77- chatClient . reminders
78- . upsertReminder ( {
79- messageId : params . message . id ,
80- remind_at : new Date ( new Date ( ) . getTime ( ) + offsetMs ) . toISOString ( ) ,
81- } )
82- . catch ( ( _error ) => {
83- console . error ( 'Error creating reminder:' , _error ) ;
84- } ) ;
85- } ,
86- style : 'default' ,
87- } ) ) ,
88- ) ;
89- }
90-
91- dismissOverlay ( ) ;
92- } ,
93- actionType : reminder ? 'remove-reminder' : 'remind-me' ,
94- title : reminder ? 'Remove Reminder' : 'Remind Me' ,
95- icon : < Bell height = { 20 } width = { 20 } stroke = { semantics . textSecondary } /> ,
96- type : 'standard' ,
97- } ) ;
98- }
51+ // if (!error) {
52+ // actions.push({
53+ // action: () => {
54+ // if (reminder) {
55+ // Alert.alert('Remove Reminder', 'Are you sure you want to remove this reminder?', [
56+ // {
57+ // text: 'Cancel',
58+ // style: 'cancel',
59+ // },
60+ // {
61+ // text: 'Remove',
62+ // onPress: () => {
63+ // chatClient.reminders.deleteReminder(reminder.id).catch((err) => {
64+ // console.error('Error deleting reminder:', err);
65+ // });
66+ // },
67+ // style: 'destructive',
68+ // },
69+ // ]);
70+ // } else {
71+ // Alert.alert(
72+ // 'Select Reminder Time',
73+ // 'When would you like to be reminded?',
74+ // chatClient.reminders.scheduledOffsetsMs.map((offsetMs) => ({
75+ // text: t('duration/Remind Me', { milliseconds: offsetMs }),
76+ // onPress: () => {
77+ // chatClient.reminders
78+ // .upsertReminder({
79+ // messageId: params.message.id,
80+ // remind_at: new Date(new Date().getTime() + offsetMs).toISOString(),
81+ // })
82+ // .catch((_error) => {
83+ // console.error('Error creating reminder:', _error);
84+ // });
85+ // },
86+ // style: 'default',
87+ // })),
88+ // );
89+ // }
90+ //
91+ // dismissOverlay();
92+ // },
93+ // actionType: reminder ? 'remove-reminder' : 'remind-me',
94+ // title: reminder ? 'Remove Reminder' : 'Remind Me',
95+ // icon: <Bell height={20} width={20} stroke={semantics.textSecondary} />,
96+ // type: 'standard',
97+ // });
98+ // }
9999 // actions.push({
100100 // action: async () => {
101101 // Alert.alert('Delete for me', 'Are you sure you want to delete this message for me?', [
0 commit comments