From 3a4f354a6cb58f05514bb06f1ffa37665225e9d9 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 4 Dec 2023 21:59:30 +0700 Subject: [PATCH] Add reccommended tag --- web/screens/ExploreModels/ExploreModelItem/index.tsx | 4 ++-- web/screens/ExploreModels/ExploreModelItemHeader/index.tsx | 3 +-- web/screens/ExploreModels/index.tsx | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web/screens/ExploreModels/ExploreModelItem/index.tsx b/web/screens/ExploreModels/ExploreModelItem/index.tsx index 1ca539a7d4..7d115e34fb 100644 --- a/web/screens/ExploreModels/ExploreModelItem/index.tsx +++ b/web/screens/ExploreModels/ExploreModelItem/index.tsx @@ -75,12 +75,12 @@ const ExploreModelItem = forwardRef(({ model }, ref) => {

{model.format}

-
+ {/*
Compatibility

-

-
+
*/} )} diff --git a/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx b/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx index 34d0033639..d152d9b66d 100644 --- a/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx +++ b/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx @@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react' import { Model } from '@janhq/core' -import { Badge, Button } from '@janhq/uikit' +import { Button } from '@janhq/uikit' import { atom, useAtomValue } from 'jotai' @@ -101,7 +101,6 @@ const ExploreModelItemHeader: React.FC = ({ model, onClick, open }) => { >
{model.name} - {model.metadata.tags[0]}
diff --git a/web/screens/ExploreModels/index.tsx b/web/screens/ExploreModels/index.tsx index 01497d8e64..de7569212d 100644 --- a/web/screens/ExploreModels/index.tsx +++ b/web/screens/ExploreModels/index.tsx @@ -35,7 +35,7 @@ const ExploreModelsScreen = () => { const [tabActive, setTabActive] = useState('Model') const { downloadedModels } = useGetDownloadedModels() const [sortSelected, setSortSelected] = useState('All Model') - const sortMenu = ['All Model', 'Downloaded'] + const sortMenu = ['All Model', 'Recommended', 'Downloaded'] const filteredModels = models.filter((x) => { if (sortSelected === 'Downloaded') { @@ -43,6 +43,8 @@ const ExploreModelsScreen = () => { x.name.toLowerCase().includes(searchValue.toLowerCase()) && downloadedModels.some((y) => y.id === x.id) ) + } else if (sortSelected === 'Recommended') { + return x.metadata.tags.includes('Recommended') } else { return x.name.toLowerCase().includes(searchValue.toLowerCase()) }