Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daria-github committed Dec 8, 2023
1 parent 8a45aae commit 4ce5750
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/component-library/components/EffectDialog/EffectDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { EffectType } from "../../../../screenEffect";

export const EffectDialog = ({ handleSendEffect }) => (
export const EffectDialog = ({
handleSendEffect,
}: {
handleSendEffect: (effect: string) => void;
}) => (
<dialog
open
style={{
Expand All @@ -16,14 +20,10 @@ export const EffectDialog = ({ handleSendEffect }) => (
}}>
<div className="w-full flex flex-col justify-around items-center text-md">
<b>Send with effect:</b>
<button
type="button"
onClick={() => void handleSendEffect(EffectType.SNOW)}>
<button type="button" onClick={() => handleSendEffect(EffectType.SNOW)}>
**Let it Snow**
</button>
<button
type="button"
onClick={() => void handleSendEffect(EffectType.RAIN)}>
<button type="button" onClick={() => handleSendEffect(EffectType.RAIN)}>
Make it Rain XMTP!
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { useXmtpStore } from "../../../store/xmtp";
import { useVoiceRecording } from "../../../hooks/useVoiceRecording";
import { useRecordingTimer } from "../../../hooks/useRecordingTimer";
import "react-tooltip/dist/react-tooltip.css";
import { ContentTypeScreenEffect, EffectType } from "../../../../screenEffect";
import { ContentTypeScreenEffect } from "../../../../screenEffect";
import { useLongPress } from "../../../hooks/useLongPress";
import { EffectDialog } from "../EffectDialog/EffectDialog";

Expand Down Expand Up @@ -251,16 +251,17 @@ export const MessageInput = ({
setOpenEffectDialog(true);
};

const handleSendEffect = async (effectType: string) => {
await _sendMessage(
const handleSendEffect = (effectType: string) => {
void _sendMessage(
conversation as CachedConversationWithId,
{ messageId: associatedMessageId, effectType },
ContentTypeScreenEffect,
);
await send();
void send();
setOpenEffectDialog(false);
};

// eslint-disable-next-line @typescript-eslint/no-misused-promises
const longPressEvents = useLongPress(handleLongPress, send);

const extension = attachment?.mimeType.split("/")?.[1] || "";
Expand Down
2 changes: 2 additions & 0 deletions src/controllers/FullConversationController.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import {
useMessages,
type CachedConversation,
Expand Down

0 comments on commit 4ce5750

Please sign in to comment.