Skip to content

Commit

Permalink
Merge pull request #411 from xmtp-labs/dj/custom-content-type
Browse files Browse the repository at this point in the history
Pull screen effect from package
  • Loading branch information
daria-github authored Dec 19, 2023
2 parents 46f65aa + 94dcfe2 commit 9e0e8ea
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 66 deletions.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +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/react-sdk": "^3.0.0",
"@xmtp/xmtp-js": "^11.2.1",
"buffer": "^6.0.3",
Expand Down
59 changes: 0 additions & 59 deletions screenEffect.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { EffectType } from "../../../../screenEffect";
// To-do: pull from package once exported
enum EffectType {
SNOW = "SNOW",
RAIN = "RAIN",
}

export const EffectDialog = ({
handleSendEffect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
useSendMessage as _useSendMessage,
useConversation,
} from "@xmtp/react-sdk";
import { ContentTypeScreenEffect } from "@xmtp/experimental-content-type-screen-effect";
import { IconButton } from "../IconButton/IconButton";
import { useAttachmentChange } from "../../../hooks/useAttachmentChange";
import { typeLookup, type contentTypes } from "../../../helpers/attachments";
Expand All @@ -36,7 +37,6 @@ import { useXmtpStore } from "../../../store/xmtp";
import { useVoiceRecording } from "../../../hooks/useVoiceRecording";
import { useRecordingTimer } from "../../../hooks/useRecordingTimer";
import "react-tooltip/dist/react-tooltip.css";
import { ContentTypeScreenEffect } from "../../../../screenEffect";
import { useLongPress } from "../../../hooks/useLongPress";
import { EffectDialog } from "../EffectDialog/EffectDialog";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { useEffect, useState } from "react";
import "./RainEffect.css";
import { EffectType } from "../../../../screenEffect";

// To-do: pull from package once exported
enum EffectType {
SNOW = "SNOW",
RAIN = "RAIN",
}

interface logoStyles {
left: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { useState, useEffect } from "react";
import "./SnowEffect.css";
import { EffectType } from "../../../../screenEffect";

// To-do: pull from package once exported
enum EffectType {
SNOW = "SNOW",
RAIN = "RAIN",
}

interface snowflakeStyles {
left: string;
Expand Down
7 changes: 6 additions & 1 deletion src/controllers/FullConversationController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import { isMessageSupported } from "../helpers/isMessagerSupported";
import { updateConversationIdentity } from "../helpers/conversation";
import SnowEffect from "../component-library/components/ScreenEffects/SnowEffect";
import RainEffect from "../component-library/components/ScreenEffects/RainEffect";
import { EffectType } from "../../screenEffect";

// To-do: pull from package once exported
enum EffectType {
SNOW = "SNOW",
RAIN = "RAIN",
}

type FullConversationControllerProps = {
conversation: CachedConversation;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/isMessagerSupported.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ContentTypeRemoteAttachment } from "@xmtp/content-type-remote-attachment";
import type { CachedMessageWithId } from "@xmtp/react-sdk";
import { ContentTypeId, ContentTypeText } from "@xmtp/react-sdk";
import { ContentTypeScreenEffect } from "../../screenEffect";
import { ContentTypeScreenEffect } from "@xmtp/experimental-content-type-screen-effect";

/**
* Determines if a message is supported by the app
Expand Down
5 changes: 4 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ import {
} from "@xmtp/react-sdk";
import { mainnet } from "wagmi/chains";
import { infuraProvider } from "wagmi/providers/infura";
import {
ContentTypeScreenEffect,
ScreenEffectCodec,
} from "@xmtp/experimental-content-type-screen-effect";
import App from "./controllers/AppController";
import { isAppEnvDemo } from "./helpers";
import { mockConnector } from "./helpers/mockConnector";
import { ContentTypeScreenEffect, ScreenEffectCodec } from "../screenEffect";

// Increment with any schema change; e.g. adding support for a new content type
const DB_VERSION = 5;
Expand Down

1 comment on commit 9e0e8ea

@vercel
Copy link

@vercel vercel bot commented on 9e0e8ea Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.