diff --git a/api/src/types/fragments.js b/api/src/types/fragments.js index 45f9afc2..b5aab488 100644 --- a/api/src/types/fragments.js +++ b/api/src/types/fragments.js @@ -15,6 +15,7 @@ export const didIndexFragment = ` export const profileFragment = ` ... on Profile { id + bio name avatar createdAt @@ -116,7 +117,7 @@ export const teamFragment = ` updatedAt } } -` +`; export const modelBundleFragment = ` id @@ -208,7 +209,6 @@ export const modelBundleFragment = ` } `; - export const indexItemFragment = ` ... on IndexItem { id @@ -232,4 +232,4 @@ export const indexItemFragment = ` deletedAt } } -` +`; diff --git a/web-app/package.json b/web-app/package.json index 61a62c02..e74bd283 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -35,6 +35,7 @@ "@reduxjs/toolkit": "^1.8.2", "@self.id/web": "^0.5.0", "@stablelib/random": "^1.0.1", + "@types/react-infinite-scroll-component": "^5.0.0", "add": "^2.0.6", "ai": "^2.1.19", "axios": "^1.6.2", @@ -65,7 +66,7 @@ "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", "react-images-uploading": "^3.1.7", - "react-infinite-scroller": "^1.2.6", + "react-infinite-scroll-component": "^6.1.0", "react-intersection-observer": "^9.5.2", "react-lazyload": "^3.2.0", "react-lottie-player": "^1.4.3", diff --git a/web-app/src/app/[id]/page.tsx b/web-app/src/app/[id]/page.tsx index 86b71409..39eaea1d 100644 --- a/web-app/src/app/[id]/page.tsx +++ b/web-app/src/app/[id]/page.tsx @@ -8,17 +8,12 @@ import UserConversationSection from "components/sections/UserConversation"; import { useRouteParams } from "hooks/useRouteParams"; import { useEffect } from "react"; import "../../styles/main.scss"; -import { useRouter } from "next/navigation"; const Discovery = () => { const { discoveryType, indexes } = useApp(); const { id } = useRouteParams(); - const router = useRouter(); useEffect(() => { - console.log("discoveryType in page.tsx:", discoveryType, id); - console.log("indexes in page.tsx:", indexes); - // if (typeof window !== "undefined") { // window.ethereum.on("message", (message: any) => { // console.log("eth: ", message); diff --git a/web-app/src/components/ai/no-indexes.tsx b/web-app/src/components/ai/no-indexes.tsx index 353a9e01..6ff6724b 100644 --- a/web-app/src/components/ai/no-indexes.tsx +++ b/web-app/src/components/ai/no-indexes.tsx @@ -14,7 +14,7 @@ export default function NoIndexesChat({ isSelfDid }: { isSelfDid?: boolean }) { textAlign: "center", flexDirection: "column", alignItems: "center", - padding: "4rem 0", + padding: "8rem 0 0 0", }} > } + addOnBefore={ + + + + } addOnAfter={ loading ? ( diff --git a/web-app/src/components/sections/IndexConversation/IndexConversationContext.tsx b/web-app/src/components/sections/IndexConversation/IndexConversationContext.tsx index 75d3def1..5b9f3ef9 100644 --- a/web-app/src/components/sections/IndexConversation/IndexConversationContext.tsx +++ b/web-app/src/components/sections/IndexConversation/IndexConversationContext.tsx @@ -74,7 +74,7 @@ export const IndexConversationProvider = ({ children }: { children: any }) => { } const response = await api!.getItems(viewedIndex.id, itemParams); - + console.log(response.endCursor, "endCursor"); if (response) { setItemsState((prevState) => ({ items: @@ -98,7 +98,7 @@ export const IndexConversationProvider = ({ children }: { children: any }) => { const fetchInitial = useCallback(async () => { await fetchIndex(); fetchIndexItems(true); - }, [viewedIndex, fetchIndex, fetchIndexItems]); + }, [fetchIndex]); useEffect(() => { fetchInitial(); diff --git a/web-app/src/components/sections/IndexConversation/TabContainer/IndexItemsTab.tsx b/web-app/src/components/sections/IndexConversation/TabContainer/IndexItemsTab.tsx index d3642ee3..5ebe49e2 100644 --- a/web-app/src/components/sections/IndexConversation/TabContainer/IndexItemsTab.tsx +++ b/web-app/src/components/sections/IndexConversation/TabContainer/IndexItemsTab.tsx @@ -34,7 +34,6 @@ export default function IndexItemsTabSection() { useEffect(() => { if (addedItem) { - console.log("addedItem", addedItem, progress); setItemsState({ items: [addedItem, ...itemsState.items], cursor: itemsState.cursor, @@ -174,23 +173,13 @@ export default function IndexItemsTabSection() { )} -
+
{}} + loadMore={() => fetchIndexItems(false)} />
diff --git a/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/SettingsModal.tsx b/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/SettingsModal.tsx index 80338512..6b3aa94b 100644 --- a/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/SettingsModal.tsx +++ b/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/SettingsModal.tsx @@ -36,10 +36,7 @@ const SettingsModal: FC = ({ header = (

Waiting for transaction

-

- Please wait while the transaction is being processed. This may take a - few minutes. -

+

Please wait while the transaction is being processed.

); } else if (step === "done") { diff --git a/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/WaitingForTransaction.tsx b/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/WaitingForTransaction.tsx index 5af4336c..2fcdd869 100644 --- a/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/WaitingForTransaction.tsx +++ b/web-app/src/components/sections/IndexConversation/TabContainer/SettingsTab/WaitingForTransaction.tsx @@ -1,4 +1,3 @@ -import Button from "@/components/base/Button"; import { FC } from "react"; interface WaitingForTransactionProps { @@ -41,7 +40,7 @@ const WaitingForTransaction: FC = ({
-
= ({ > Loading -
+ */} ); diff --git a/web-app/src/components/site/index-details/IndexItemList/index.tsx b/web-app/src/components/site/index-details/IndexItemList/index.tsx index b362676c..5267dccb 100644 --- a/web-app/src/components/site/index-details/IndexItemList/index.tsx +++ b/web-app/src/components/site/index-details/IndexItemList/index.tsx @@ -1,10 +1,11 @@ -import React from "react"; import List from "components/base/List"; -import InfiniteScroll from "react-infinite-scroller"; -import { IndexItem } from "types/entity"; +import { FC, memo } from "react"; import { useRole } from "hooks/useRole"; -import LinkItem from "../LinkItem"; +import InfiniteScroll from "react-infinite-scroll-component"; +import { IndexItem } from "types/entity"; + import NoLinks from "../../indexes/NoLinks"; +import LinkItem from "../LinkItem"; export interface IndexItemListProps { search: string; @@ -14,9 +15,9 @@ export interface IndexItemListProps { loadMore: () => void; } -const MemoLinkItem = React.memo(LinkItem); +const MemoLinkItem = memo(LinkItem); -const IndexItemList: React.VFC = ({ +const IndexItemList: FC = ({ search, items, hasMore, @@ -31,18 +32,20 @@ const IndexItemList: React.VFC = ({ ) : ( } > ( removeItem(item)} - search={!!search} item={item} /> + search={!!search} + item={item} + /> )} divided data={items} diff --git a/web-app/src/components/site/indexes/AskIndexes/index.tsx b/web-app/src/components/site/indexes/AskIndexes/index.tsx index 58f5cd71..a5715b4e 100644 --- a/web-app/src/components/site/indexes/AskIndexes/index.tsx +++ b/web-app/src/components/site/indexes/AskIndexes/index.tsx @@ -163,7 +163,7 @@ const AskIndexes: FC = ({ chatID, did, indexIds }) => { useEffect(() => { scrollToBottom(); - }, [messages, isLoading]); + }, [messages, isLoading, scrollToBottom]); if (leftSectionIndexes.length === 0) { return ; @@ -192,6 +192,7 @@ const AskIndexes: FC = ({ chatID, did, indexIds }) => { height: "100%", justifyContent: "stretch", width: "100%", + flexDirection: "column", }} > {messages.length ? ( diff --git a/web-app/src/components/site/input/LinkInput/index.tsx b/web-app/src/components/site/input/LinkInput/index.tsx index 008890f6..cdb28cf0 100644 --- a/web-app/src/components/site/input/LinkInput/index.tsx +++ b/web-app/src/components/site/input/LinkInput/index.tsx @@ -61,7 +61,7 @@ const LinkInput: React.FC = ({ className={cc(["link-input__input", `link-input-${size}`])} disabled={disabled} addOnBefore={ - + } addOnAfter={ loading ? ( diff --git a/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx b/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx index 5c54e217..4a5570c8 100644 --- a/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx +++ b/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx @@ -1,8 +1,5 @@ -import React from "react"; import Text from "components/base/Text"; -import Col from "components/layout/base/Grid/Col"; import Modal from "components/base/Modal"; -import Button from "components/base/Button"; import Row from "components/layout/base/Grid/Row"; import Header from "components/base/Header"; import Flex from "components/layout/base/Grid/Flex"; @@ -19,7 +16,12 @@ const ConfirmTransaction = ({ handleCancel, ...modalProps }: any) => { body={ <> - +