From e35c68afcd3723e0f9bc574a47a3dff26e099ba2 Mon Sep 17 00:00:00 2001 From: Shoaibdev7 Date: Fri, 16 Aug 2024 17:56:03 +0500 Subject: [PATCH 01/13] fix(show-results): show results button does not do anything --- src/components/App/SideBar/FilterSearch/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/App/SideBar/FilterSearch/index.tsx b/src/components/App/SideBar/FilterSearch/index.tsx index cac765fee..291ffdcbd 100644 --- a/src/components/App/SideBar/FilterSearch/index.tsx +++ b/src/components/App/SideBar/FilterSearch/index.tsx @@ -6,6 +6,7 @@ import PlusIcon from '~/components/Icons/PlusIcon' import { SchemaExtended } from '~/components/ModalsContainer/BlueprintModal/types' import { Flex } from '~/components/common/Flex' import { useDataStore } from '~/stores/useDataStore' +import { useUserStore } from '~/stores/useUserStore' import { colors } from '~/utils/colors' import { Hops } from './Hops' import { MaxResults } from './MaxResults' @@ -25,7 +26,8 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc ) } - const { setFilters } = useDataStore((s) => s) + const { setFilters, fetchData, setAbortRequests } = useDataStore((s) => s) + const [setBudget] = useUserStore((s) => [s.setBudget]) const [selectedTypes, setSelectedTypes] = useState([]) const [hops, setHops] = useState(1) const [sourceNodes, setSourceNodes] = useState(10) @@ -39,13 +41,15 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc setShowAllSchemas(true) } - const handleFiltersApply = () => { + const handleFiltersApply = async () => { setFilters({ node_type: selectedTypes, limit: maxResults.toString(), depth: hops.toString(), top_node_count: sourceNodes.toString(), }) + + await fetchData(setBudget, setAbortRequests) } return ( From e1ecaf07525491028679224df19220fda1f51d9c Mon Sep 17 00:00:00 2001 From: Shoaibdev7 Date: Mon, 19 Aug 2024 20:09:56 +0500 Subject: [PATCH 02/13] fix(source-table): implement tabs design according to figma --- public/svg-icons/ContentIcon.svg | 4 ++ src/components/Icons/ContentIcon.tsx | 25 +++++++++++++ .../SourcesView/Content/Table/index.tsx | 37 ++++++++++++++----- .../SourcesView/Content/index.tsx | 5 --- .../SourcesView/Sources/Table/index.tsx | 30 ++++++++++----- src/utils/colors/index.tsx | 1 + 6 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 public/svg-icons/ContentIcon.svg create mode 100644 src/components/Icons/ContentIcon.tsx diff --git a/public/svg-icons/ContentIcon.svg b/public/svg-icons/ContentIcon.svg new file mode 100644 index 000000000..1e03602c2 --- /dev/null +++ b/public/svg-icons/ContentIcon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/Icons/ContentIcon.tsx b/src/components/Icons/ContentIcon.tsx new file mode 100644 index 000000000..0b82d19dc --- /dev/null +++ b/src/components/Icons/ContentIcon.tsx @@ -0,0 +1,25 @@ +/* eslint-disable */ +import React from 'react'; + +const ContentIcon: React.FC> = (props) => ( + + + + +); + +export default ContentIcon; diff --git a/src/components/SourcesTableModal/SourcesView/Content/Table/index.tsx b/src/components/SourcesTableModal/SourcesView/Content/Table/index.tsx index ba2e3a354..efbf7f8cd 100644 --- a/src/components/SourcesTableModal/SourcesView/Content/Table/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/Content/Table/index.tsx @@ -1,13 +1,14 @@ -import { Button, styled, Table as MaterialTable, TableRow } from '@mui/material' +import { Button, Table as MaterialTable, styled, TableRow } from '@mui/material' import React from 'react' -import { StyledTableCell, StyledTableHead } from '../../common' -import { TopicRow } from './TableRow' import { Flex } from '~/components/common/Flex' -import { useModal } from '~/stores/useModalStore' +import { Text } from '~/components/common/Text' +import ContentIcon from '~/components/Icons/ContentIcon' import PlusIcon from '~/components/Icons/PlusIcon' import { Node } from '~/network/fetchSourcesData' -import { Text } from '~/components/common/Text' +import { useModal } from '~/stores/useModalStore' import { colors } from '~/utils' +import { StyledTableCell, StyledTableHead } from '../../common' +import { TopicRow } from './TableRow' interface TableProps { nodes: Node[] @@ -23,10 +24,13 @@ export const Table: React.FC = ({ nodes }) => { return !nodes || nodes?.length === 0 ? ( <> - - Contribute to the graph by adding content. + + + + + Contribute to the graph by adding your first content. - +