Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev --> Main #435

Merged
merged 35 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4733d77
add portable consent
Jan 12, 2024
aad2bae
updated initial sort
Jan 12, 2024
e29fe0c
updated dependencies
Jan 13, 2024
49803b2
fixed type
Jan 13, 2024
f867ef3
memoized messages to pass
Jan 16, 2024
4328abd
Merge pull request #419 from xmtp-labs/dj/portable-consent
daria-github Jan 16, 2024
2762aea
test wip, updated tab switching logic
Jan 16, 2024
b52acd9
remove consent tests
Jan 16, 2024
14a1bc8
fix lint error
Jan 16, 2024
9d4a732
Merge branch 'dev' into dj/portable-consent
daria-github Jan 16, 2024
497e306
Merge pull request #420 from xmtp-labs/dj/portable-consent
daria-github Jan 17, 2024
82eccaa
updated port
Jan 17, 2024
af40140
consent test boilerplate
Jan 17, 2024
8d5c0e7
updated tab flow and tests
Jan 17, 2024
c026dfa
Merge branch 'dev' into dj/portable-consent
daria-github Jan 17, 2024
a02edc8
Merge pull request #421 from xmtp-labs/dj/portable-consent
daria-github Jan 17, 2024
6ec441f
convo list wip
Jan 19, 2024
cbc60c3
updated consent flow
Jan 22, 2024
53b294a
revert package json changes
Jan 22, 2024
a338e39
comment out code for sent messages
Jan 23, 2024
7f6d424
added db hook
Jan 23, 2024
f35b2a3
Merge branch 'dev' into dj/portable-consent-changes
daria-github Jan 23, 2024
e57d4ab
Merge pull request #422 from xmtp-labs/dj/portable-consent-changes
daria-github Jan 23, 2024
c5c2f81
updated frames get/post logic
Feb 3, 2024
ff18531
Merge pull request #431 from xmtp-labs/dj/frames
daria-github Feb 5, 2024
0dddce1
bumped sdk version
Feb 6, 2024
3bad2d4
bumped db version
Feb 6, 2024
31e01bc
flattened props
Feb 6, 2024
ab98764
Merge branch 'dev' into dj/frames
daria-github Feb 6, 2024
e7ababe
Merge pull request #432 from xmtp-labs/dj/frames
daria-github Feb 6, 2024
cdfec08
updated to latest frames spec
Feb 6, 2024
3ec07e7
Merge branch 'dev' into dj/frames
daria-github Feb 6, 2024
a545dd2
Merge pull request #433 from xmtp-labs/dj/frames
daria-github Feb 6, 2024
38071d9
Merge branch 'main' into dj/fix-conflicts
Feb 7, 2024
cc8962c
Merge pull request #434 from xmtp-labs/dj/fix-conflicts
daria-github Feb 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 123 additions & 50 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@xmtp/content-type-remote-attachment": "^1.1.4",
"@xmtp/content-type-reply": "^1.1.5",
"@xmtp/experimental-content-type-screen-effect": "^1.0.2",
"@xmtp/frames-client": "0.2.0",
"@xmtp/react-sdk": "^5.0.1",
"buffer": "^6.0.3",
"date-fns": "^2.29.3",
Expand All @@ -63,6 +64,7 @@
"react-infinite-scroll-component": "^6.1.0",
"react-media-recorder-2": "^1.6.23",
"react-medium-image-zoom": "^5.1.6",
"react-modal": "^3.16.1",
"react-qrcode-logo": "^2.9.0",
"react-router-dom": "^6.12.0",
"react-timer-hook": "^3.0.6",
Expand Down
23 changes: 12 additions & 11 deletions src/component-library/components/AddressInput/AddressInput.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ChevronLeftIcon,
InformationCircleIcon,
} from "@heroicons/react/outline";
import { ChevronLeftIcon, XCircleIcon } from "@heroicons/react/outline";
import { useTranslation } from "react-i18next";
import { Avatar } from "../Avatar/Avatar";
import { classNames } from "../../../helpers";
Expand Down Expand Up @@ -41,10 +38,6 @@ interface AddressInputProps {
* Upon submit, is something loading?
*/
isLoading?: boolean;
/**
* Is there a tooltip click event that needs to be handled?
*/
onTooltipClick?: () => void;
/**
* Input Value
*/
Expand All @@ -53,6 +46,10 @@ interface AddressInputProps {
* Is there a left icon click event that needs to be handled?
*/
onLeftIconClick?: () => void;
/**
* Is there a right icon click event that needs to be handled?
*/
onRightIconClick?: () => void;
}

export const AddressInput = ({
Expand All @@ -61,9 +58,9 @@ export const AddressInput = ({
avatarUrlProps,
onChange,
isError,
onTooltipClick,
value,
onLeftIconClick,
onRightIconClick,
}: AddressInputProps) => {
const { t } = useTranslation();
const subtextColor = isError ? "text-red-600" : "text-gray-500";
Expand Down Expand Up @@ -127,8 +124,12 @@ export const AddressInput = ({
</div>
</div>
</form>
{onTooltipClick && (
<InformationCircleIcon onClick={onTooltipClick} height="24" />
{onRightIconClick && (
<XCircleIcon
onClick={onRightIconClick}
height="24"
className="text-red-600 cursor-pointer"
/>
)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Virtuoso } from "react-virtuoso";
import { EmptyMessage } from "../EmptyMessage/EmptyMessage";
import { MessagePreviewCard } from "../MessagePreviewCard/MessagePreviewCard";
import type { ActiveTab } from "../../../store/xmtp";

interface ConversationListProps {
/**
Expand All @@ -20,23 +21,30 @@
* Has a value been entered for the recipient?
*/
hasRecipientEnteredValue?: boolean;
/**
* Which tab are we on?
*/
activeTab: ActiveTab;
}

export const ConversationList = ({
messages = [],
isLoading,
setStartedFirstMessage,
hasRecipientEnteredValue,
activeTab,
}: ConversationListProps) =>
!messages?.length && isLoading ? (
<div className="w-full overflow-hidden h-full flex flex-col justify-start sm:w-full bg-gray-100">
{Array.from({ length: 12 }).map((_, idx) => (
<MessagePreviewCard key={idx} isLoading />
<MessagePreviewCard key={idx} isLoading activeTab={activeTab} />

Check warning on line 40 in src/component-library/components/ConversationList/ConversationList.tsx

View workflow job for this annotation

GitHub Actions / eslint

Do not use Array index in keys
))}
</div>
) : !messages.length && !isLoading && !hasRecipientEnteredValue ? (
<div className="w-full overflow-hidden sm:w-full sm:p-4 md:p-8 border border-gray-100 h-full">
<EmptyMessage setStartedFirstMessage={setStartedFirstMessage} />
{activeTab === "messages" ? (
<EmptyMessage setStartedFirstMessage={setStartedFirstMessage} />
) : null}
</div>
) : (
<Virtuoso
Expand Down
40 changes: 40 additions & 0 deletions src/component-library/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { GhostButton } from "../GhostButton/GhostButton";

type FrameProps = {
image: string;
title: string;
buttons: string[];
handleClick: (buttonNumber: number) => Promise<void>;
frameButtonUpdating: number;
};

export const Frame = ({
image,
title,
buttons,
handleClick,
frameButtonUpdating,
}: FrameProps) => (
<div className="px-4 md:px-8">
<img src={image} className="max-h-80 rounded-lg" alt={title} />
<div className="flex flex-col items-center">
{buttons?.map((button, index) => {
if (!button) {
return null;
}
const handlePress = () => {
void handleClick(index + 1);
};
return (
<GhostButton
key={button}
label={button}
onClick={handlePress}
isLoading={frameButtonUpdating === index + 1}
isDisabled={frameButtonUpdating > 0}
/>
);
})}
</div>
</div>
);
Loading
Loading