diff --git a/package-lock.json b/package-lock.json index adc2362b..4d02a0b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@xmtp/content-type-reaction": "^1.1.3", "@xmtp/content-type-remote-attachment": "^1.1.4", "@xmtp/content-type-reply": "^1.1.5", - "@xmtp/experimental-content-type-screen-effect": "^1.0.0", + "@xmtp/experimental-content-type-screen-effect": "^1.0.1", "@xmtp/react-sdk": "^3.0.0", "@xmtp/xmtp-js": "^11.2.1", "buffer": "^6.0.3", @@ -14325,9 +14325,9 @@ } }, "node_modules/@xmtp/experimental-content-type-screen-effect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@xmtp/experimental-content-type-screen-effect/-/experimental-content-type-screen-effect-1.0.0.tgz", - "integrity": "sha512-MrBCZioyCumcILdvZxuDCi1es7OLyxQ3PyH8VVGAVJortgWwzyLlrcX4UKyUXmjV2hcHDl/hD052jh+sKuxruA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@xmtp/experimental-content-type-screen-effect/-/experimental-content-type-screen-effect-1.0.1.tgz", + "integrity": "sha512-Hn39MlZU/U2kDGnKi6zB2w1kuIlW96VAZFXTc+Tl0Y5/yZbz1le6Uk9dzC+9hFRxVRDYsvBg67gaueE4hwDo1g==", "dependencies": { "@xmtp/xmtp-js": "^11.1.2" }, @@ -14336,9 +14336,9 @@ } }, "node_modules/@xmtp/proto": { - "version": "3.29.0", - "resolved": "https://registry.npmjs.org/@xmtp/proto/-/proto-3.29.0.tgz", - "integrity": "sha512-+ibo+u6NwdzfLN3QEDMiNrnXd7eT1/+F2j5WWz3b4mk91wgn8lJ66fxFPwLTQs6AbaBBUmhO2cdpgIL/g4kvZg==", + "version": "3.36.0", + "resolved": "https://registry.npmjs.org/@xmtp/proto/-/proto-3.36.0.tgz", + "integrity": "sha512-LTyoa1K5TgHv6ekGmwVTaMwfnhxZhglZLh/6zS3dgygGYgn2KvFvmkt+ssNSRdK8LAaJ2ZpqV/OTDjB/tEHjCA==", "dependencies": { "long": "^5.2.0", "protobufjs": "^7.0.0", @@ -14386,9 +14386,9 @@ } }, "node_modules/@xmtp/xmtp-js": { - "version": "11.2.1", - "resolved": "https://registry.npmjs.org/@xmtp/xmtp-js/-/xmtp-js-11.2.1.tgz", - "integrity": "sha512-LVYuJV4a/6poKDgJd4Zkt9esWPHcxxmjWSe4J6A5lNwVAgqSTjb4B0Yiw9Y3IVwynNRy6SXRttpf++mul7Zcnw==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/@xmtp/xmtp-js/-/xmtp-js-11.2.3.tgz", + "integrity": "sha512-uDZcqmOuAtSNVQ4pk7D1GvVPe12Os6oqesyPQQ5vt3tbeteMgK7lqrHZ1PKH4ZVoYuYJm4Rgaz2hKKGM9KsmQw==", "dependencies": { "@noble/secp256k1": "^1.5.2", "@xmtp/proto": "^3.29.0", @@ -42985,17 +42985,17 @@ } }, "@xmtp/experimental-content-type-screen-effect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@xmtp/experimental-content-type-screen-effect/-/experimental-content-type-screen-effect-1.0.0.tgz", - "integrity": "sha512-MrBCZioyCumcILdvZxuDCi1es7OLyxQ3PyH8VVGAVJortgWwzyLlrcX4UKyUXmjV2hcHDl/hD052jh+sKuxruA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@xmtp/experimental-content-type-screen-effect/-/experimental-content-type-screen-effect-1.0.1.tgz", + "integrity": "sha512-Hn39MlZU/U2kDGnKi6zB2w1kuIlW96VAZFXTc+Tl0Y5/yZbz1le6Uk9dzC+9hFRxVRDYsvBg67gaueE4hwDo1g==", "requires": { "@xmtp/xmtp-js": "^11.1.2" } }, "@xmtp/proto": { - "version": "3.29.0", - "resolved": "https://registry.npmjs.org/@xmtp/proto/-/proto-3.29.0.tgz", - "integrity": "sha512-+ibo+u6NwdzfLN3QEDMiNrnXd7eT1/+F2j5WWz3b4mk91wgn8lJ66fxFPwLTQs6AbaBBUmhO2cdpgIL/g4kvZg==", + "version": "3.36.0", + "resolved": "https://registry.npmjs.org/@xmtp/proto/-/proto-3.36.0.tgz", + "integrity": "sha512-LTyoa1K5TgHv6ekGmwVTaMwfnhxZhglZLh/6zS3dgygGYgn2KvFvmkt+ssNSRdK8LAaJ2ZpqV/OTDjB/tEHjCA==", "requires": { "long": "^5.2.0", "protobufjs": "^7.0.0", @@ -43031,9 +43031,9 @@ } }, "@xmtp/xmtp-js": { - "version": "11.2.1", - "resolved": "https://registry.npmjs.org/@xmtp/xmtp-js/-/xmtp-js-11.2.1.tgz", - "integrity": "sha512-LVYuJV4a/6poKDgJd4Zkt9esWPHcxxmjWSe4J6A5lNwVAgqSTjb4B0Yiw9Y3IVwynNRy6SXRttpf++mul7Zcnw==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/@xmtp/xmtp-js/-/xmtp-js-11.2.3.tgz", + "integrity": "sha512-uDZcqmOuAtSNVQ4pk7D1GvVPe12Os6oqesyPQQ5vt3tbeteMgK7lqrHZ1PKH4ZVoYuYJm4Rgaz2hKKGM9KsmQw==", "requires": { "@noble/secp256k1": "^1.5.2", "@xmtp/proto": "^3.29.0", diff --git a/package.json b/package.json index 21274228..5828ea17 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@xmtp/content-type-reaction": "^1.1.3", "@xmtp/content-type-remote-attachment": "^1.1.4", "@xmtp/content-type-reply": "^1.1.5", - "@xmtp/experimental-content-type-screen-effect": "^1.0.0", + "@xmtp/experimental-content-type-screen-effect": "^1.0.1", "@xmtp/react-sdk": "^3.0.0", "@xmtp/xmtp-js": "^11.2.1", "buffer": "^6.0.3", diff --git a/src/component-library/components/EffectDialog/EffectDialog.tsx b/src/component-library/components/EffectDialog/EffectDialog.tsx index c5c307e4..96dfb317 100644 --- a/src/component-library/components/EffectDialog/EffectDialog.tsx +++ b/src/component-library/components/EffectDialog/EffectDialog.tsx @@ -1,13 +1,9 @@ -// To-do: pull from package once exported -enum EffectType { - SNOW = "SNOW", - RAIN = "RAIN", -} +import type { EffectType } from "@xmtp/experimental-content-type-screen-effect"; export const EffectDialog = ({ handleSendEffect, }: { - handleSendEffect: (effect: string) => void; + handleSendEffect: (effect: EffectType) => void; }) => (
Send with effect: - -
diff --git a/src/component-library/components/ScreenEffects/RainEffect.tsx b/src/component-library/components/ScreenEffects/RainEffect.tsx index 99e2cc4e..bd52dd5d 100644 --- a/src/component-library/components/ScreenEffects/RainEffect.tsx +++ b/src/component-library/components/ScreenEffects/RainEffect.tsx @@ -1,12 +1,6 @@ import { useEffect, useState } from "react"; import "./RainEffect.css"; -// To-do: pull from package once exported -enum EffectType { - SNOW = "SNOW", - RAIN = "RAIN", -} - interface logoStyles { left: string; opacity: number; @@ -36,7 +30,7 @@ const RainEffect = ({ attachedMessageId }: { attachedMessageId: string }) => { const timeout = setTimeout(() => { setIsVisible(false); document.body.style.pointerEvents = "auto"; - localStorage.setItem(attachedMessageId, EffectType.RAIN); + localStorage.setItem(attachedMessageId, "RAIN"); }, 3000); // Clear the timeout if the component unmounts diff --git a/src/component-library/components/ScreenEffects/SnowEffect.tsx b/src/component-library/components/ScreenEffects/SnowEffect.tsx index ea1f9833..e7ae9199 100644 --- a/src/component-library/components/ScreenEffects/SnowEffect.tsx +++ b/src/component-library/components/ScreenEffects/SnowEffect.tsx @@ -1,12 +1,6 @@ import { useState, useEffect } from "react"; import "./SnowEffect.css"; -// To-do: pull from package once exported -enum EffectType { - SNOW = "SNOW", - RAIN = "RAIN", -} - interface snowflakeStyles { left: string; opacity: number; @@ -35,7 +29,7 @@ const SnowEffect = ({ attachedMessageId }: { attachedMessageId: string }) => { const timeout = setTimeout(() => { setIsVisible(false); document.body.style.pointerEvents = "auto"; - localStorage.setItem(attachedMessageId, EffectType.SNOW); + localStorage.setItem(attachedMessageId, "SNOW"); }, 3000); // // Clear the timeout if the component unmounts diff --git a/src/controllers/FullConversationController.tsx b/src/controllers/FullConversationController.tsx index 013117d7..20a5af7a 100644 --- a/src/controllers/FullConversationController.tsx +++ b/src/controllers/FullConversationController.tsx @@ -17,12 +17,6 @@ import { updateConversationIdentity } from "../helpers/conversation"; import SnowEffect from "../component-library/components/ScreenEffects/SnowEffect"; import RainEffect from "../component-library/components/ScreenEffects/RainEffect"; -// To-do: pull from package once exported -enum EffectType { - SNOW = "SNOW", - RAIN = "RAIN", -} - type FullConversationControllerProps = { conversation: CachedConversation; }; @@ -51,13 +45,13 @@ export const FullConversationController: React.FC< // if the message content type is not support and has no fallback, // disregard it - if (msg.content?.effectType === EffectType.SNOW) { + if (msg.content?.effectType === "SNOW") { if (!localStorage.getItem(msg.content?.messageId)) { setEffect("snow"); setAttachedMessageId(msg.content.messageId); } } - if (msg.content?.effectType === EffectType.RAIN) { + if (msg.content?.effectType === "RAIN") { if (!localStorage.getItem(msg.content?.messageId)) { setEffect("rain"); setAttachedMessageId(msg.content.messageId);