Skip to content

Commit

Permalink
fix: search tweaks, prelaunch cleanup (#629)
Browse files Browse the repository at this point in the history
* ensuring edu search form goes to edu search

* removing placeholder related content on PageEduNewsDetail

* dynamic underline in NavDesktopTopHat
  • Loading branch information
stephiescastle committed Sep 20, 2024
1 parent f548250 commit a090b2d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
14 changes: 12 additions & 2 deletions packages/vue/src/components/NavDesktop/NavDesktopTopHat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
:class="{ '-ml-3': index === 0 }"
>
<span
class="can-hover:group-hover:border-jpl-red-light inline-block py-2 border-b-2"
:class="index === 0 ? 'border-jpl-red-light' : 'border-transparent'"
class="can-hover:group-hover:border-jpl-red inline-block py-2 border-b-2"
:class="
(getLinkText(item) === 'JPL' && !themeStore.isEdu) ||
(getLinkText(item) === 'Education' && themeStore.isEdu)
? 'border-jpl-red'
: 'border-transparent'
"
>
{{ getLinkText(item) }}
</span>
Expand All @@ -29,6 +34,8 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { mixinGetRouterLink, mixinGetLinkText } from './../../utils/mixins'
import { mapStores } from 'pinia'
import { useThemeStore } from './../../store/theme'
import BaseLink from './../BaseLink/BaseLink.vue'
import type { LinkObject } from './../../utils/mixins'
import type { PropType } from 'vue'
Expand All @@ -51,6 +58,9 @@ export default defineComponent({
getLinkText(link: LinkObject): string | undefined {
return mixinGetLinkText(link)
}
},
computed: {
...mapStores(useThemeStore)
}
})
</script>
7 changes: 6 additions & 1 deletion packages/vue/src/components/NavSearchForm/NavSearchForm.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useThemeStore } from '../../store/theme'
import SearchInput from './../SearchInput/SearchInput.vue'
const router = useRouter()
const themeStore = useThemeStore()
interface NavSearchFormProps {
mobile?: boolean
Expand All @@ -20,7 +22,10 @@ const clearSearch = () => {
}
const submitSearch = () => {
emit('submitForm')
router.push({ path: '/search', query: { query: searchQuery.value } })
router.push({
path: themeStore.isEdu ? '/edu/search/' : '/search',
query: { query: searchQuery.value }
})
}
</script>
<template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,5 @@ defineExpose({
>
<AboutTheAuthor :authors="data.authors" />
</LayoutHelper>
<div class="bg-stars bg-primary-darker">
<div class="py-10 text-center text-white">
<strong>Related News goes here</strong>
</div>
<!-- extras -->
<!-- <BlockLinkCarousel
item-type="cards"
class="mt-24"
heading="Explore more"
:items="data.getRelatedOrLatestNews"
/> -->
</div>
</div>
</template>

0 comments on commit a090b2d

Please sign in to comment.