Skip to content

Commit

Permalink
Merge branch 'dev' into mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jul 1, 2024
2 parents 08d764a + 84818a6 commit bbd4586
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 49 deletions.
23 changes: 23 additions & 0 deletions web-app/src/app/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@
7. Disable tap highlights on iOS
*/

.no-scrollbar {
/* For Firefox */
scrollbar-color: #666 transparent; /* Thumb color #666 and track color transparent */
scrollbar-width: auto; /* Default scrollbar width */
}

/* For WebKit browsers */
.no-scrollbar::-webkit-scrollbar {
width: 12px; /* Default width */
height: 12px; /* Default height for horizontal scrollbars */
}

.no-scrollbar::-webkit-scrollbar-track {
background: transparent; /* Transparent track */
}

.no-scrollbar::-webkit-scrollbar-thumb {
background-color: #666; /* Thumb color */
border-radius: 10px; /* Roundness of scrollbar thumb */
border: 3px solid transparent; /* Space around thumb */
background-clip: padding-box; /* Ensures the thumb's color doesn't extend into the border */
}

html#landing {
line-height: 1.5; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,13 @@ import { useIndexConversation } from "../IndexConversationContext";
const CONCURRENCY_LIMIT = 10;

export default function IndexItemsTabSection() {
const {
setItemsState,
loading,
setLoading,
searchLoading,
fetchIndexItems,
fetchMoreIndexItems,
} = useIndexConversation();
const { setItemsState, searchLoading, fetchIndexItems, fetchMoreIndexItems } =
useIndexConversation();
const { isCreator } = useRole();
const {
data: viewedIndex,
items,
loading,
addItemLoading,
} = useAppSelector(selectIndex);
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -191,46 +186,48 @@ export default function IndexItemsTabSection() {
// );

return (
<Flex flexdirection="column" className="idxflex-grow-1">
{items.data && items.data.length > 0 && (
<FlexRow className={"mt-6"}>
<Col className="idxflex-grow-1">
<SearchInput
// onSearch={handleSearch}
debounceTime={300}
showClear
defaultValue={search}
loading={searchLoading}
placeholder="Search in this index"
/>
</Col>
</FlexRow>
)}

{isCreator && (
<FlexRow>
<Col className="idxflex-grow-1 mt-6 pb-0">
<LinkInput
loading={addItemLoading}
onItemAdd={handleAddItem}
progress={progress}
/>
</Col>
</FlexRow>
)}

<div key={viewedIndex?.id} className={"mb-4 mt-6"}>
<IndexItemList
items={items.data}
search={search}
hasMore={!!items.cursor}
removeItem={handleRemoveItem}
loadMore={() =>
viewedIndex &&
fetchMoreIndexItems(viewedIndex?.id, { resetCursor: false })
}
/>
</div>
</Flex>
!loading && (
<Flex flexdirection="column" className="idxflex-grow-1">
{items.data && items.data.length > 0 && (
<FlexRow className={"mt-6"}>
<Col className="idxflex-grow-1">
<SearchInput
// onSearch={handleSearch}
debounceTime={300}
showClear
defaultValue={search}
loading={searchLoading}
placeholder="Search in this index"
/>
</Col>
</FlexRow>
)}

{isCreator && (
<FlexRow>
<Col className="idxflex-grow-1 mt-6 pb-0">
<LinkInput
loading={addItemLoading}
onItemAdd={handleAddItem}
progress={progress}
/>
</Col>
</FlexRow>
)}

<div key={viewedIndex?.id} className={"mb-4 mt-6"}>
<IndexItemList
items={items.data}
search={search}
hasMore={!!items.cursor}
removeItem={handleRemoveItem}
loadMore={() =>
viewedIndex &&
fetchMoreIndexItems(viewedIndex?.id, { resetCursor: false })
}
/>
</div>
</Flex>
)
);
}
17 changes: 17 additions & 0 deletions web-app/src/components/sections/IndexList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,30 @@ const IndexListSection: FC = () => {
const router = useRouter();
const query = useSearchParams();
const indexes = useAppSelector(selectIndexes);
const scrollPosition = useRef(0);

const { setLeftTabKey, leftTabKey } = useApp();

const { data: did } = useAppSelector(selectDID);
const { data: viewedConversation } = useAppSelector(selectConversation);

const prevProfileID = useRef(did?.id);
useEffect(() => {
const container = document.querySelector(".index-list");
const pos = localStorage.getItem("indexListScrollPosition");
container?.scrollTo(0, JSON.parse(pos || "0"));
}, [id]);

useEffect(() => {
const container = document.querySelector(".index-list");
container?.addEventListener("scroll", () => {
scrollPosition.current = container?.scrollTop || 0;
localStorage.setItem(
"indexListScrollPosition",
(container?.scrollTop || 0).toString(),
);
});
}, []);

const leftSectionIndexes = useMemo(
() =>
Expand Down

0 comments on commit bbd4586

Please sign in to comment.