diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /src/components/pages/SearchLandingPage.svelte | |
init commit
Diffstat (limited to 'src/components/pages/SearchLandingPage.svelte')
| -rw-r--r-- | src/components/pages/SearchLandingPage.svelte | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/components/pages/SearchLandingPage.svelte b/src/components/pages/SearchLandingPage.svelte new file mode 100644 index 0000000..3594ece --- /dev/null +++ b/src/components/pages/SearchLandingPage.svelte @@ -0,0 +1,33 @@ +<script lang="ts"> + import type { SearchLandingPage } from '@jet-app/app-store/api/models'; + import type { WebRenderablePage } from '@jet-app/app-store/api/models/web-renderable-page'; + import type { WebSearchFlowAction } from '@jet-app/app-store/common/search/web-search-action'; + import { unwrapOptional as unwrap } from '@jet/environment/types/optional'; + + type SearchPage = SearchLandingPage; + + import DefaultPage from './DefaultPage.svelte'; + import ShelfWrapper from '~/components/Shelf/Wrapper.svelte'; + import SearchInput from '~/components/navigation/SearchInput.svelte'; + import { getI18n } from '~/stores/i18n'; + + export let page: SearchPage; + + const i18n = getI18n(); + + $: webNavigation = unwrap((page as WebRenderablePage).webNavigation); + $: searchAction = webNavigation.searchAction as WebSearchFlowAction; + $: hasShelves = !!page.shelves.filter(({ items }) => items?.length).length; + + $: pageWithoutEmptyShelves = { + ...page, + shelves: hasShelves ? page.shelves : [], + title: $i18n.t('ASE.Web.AppStore.Meta.SearchLanding.Title'), + }; +</script> + +<DefaultPage page={pageWithoutEmptyShelves}> + <ShelfWrapper slot="before-shelves" centered> + <SearchInput {searchAction} big /> + </ShelfWrapper> +</DefaultPage> |
