Skip to content

Commit e791741

Browse files
committed
fix: merge browselayout in serachpage
1 parent de76886 commit e791741

File tree

4 files changed

+75
-101
lines changed

4 files changed

+75
-101
lines changed

src/components/project/ProjectListSearch.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,13 @@ export default {
124124
},
125125
},
126126
127-
// inject: {
128-
// browseLayoutUpdateProjectQuantity: {
129-
// from: 'browseLayoutUpdateProjectQuantity',
130-
// default: () => {},
131-
// },
132-
// },
133-
134127
methods: {
135128
onClickPagination(requestedPage) {
136129
this.loadProjects(requestedPage)
137130
this.$el.scrollIntoView({ behavior: 'smooth' })
138131
},
139132
140133
initProjectLoading() {
141-
// this.projects = []
142-
// this.groups = []
143-
// this.peoples = []
144134
this.items = []
145135
this.isLoading = true
146136
this.$emit('loading', true)

src/components/search/BrowseLayout/BrowseLayout.vue

Lines changed: 0 additions & 81 deletions
This file was deleted.
Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,81 @@
11
<template>
2-
<BrowseLayout :key="$route.name"></BrowseLayout>
2+
<div class="page-section-extra-wide browse-layout" :key="$route.name">
3+
<div class="browse-header">
4+
<SearchOptions :limit="30" show-section-filter />
5+
</div>
6+
7+
<GlobalSearchTab :search="searchFromQuery" />
8+
</div>
39
</template>
410

511
<script>
6-
import BrowseLayout from '@/components/search/BrowseLayout/BrowseLayout.vue'
7-
/**
8-
* WARNING: do not remove ":key="$route.name"" on line 2
9-
* or it will break BrowseLayout initialization
10-
* since the component is reused on many routes
11-
*/
12+
import SearchOptions from '@/components/search/SearchOptions/SearchOptions.vue'
13+
import onboardingStatusMixin from '@/mixins/onboardingStatusMixin.ts'
14+
import GlobalSearchTab from '@/pages/SearchPage/Tabs/GlobalSearchTab.vue'
15+
import useSearch from '@/composables/useSearch.js'
16+
1217
export default {
1318
name: 'SearchPage',
14-
components: { BrowseLayout },
19+
20+
mixins: [onboardingStatusMixin],
21+
22+
components: {
23+
SearchOptions,
24+
GlobalSearchTab,
25+
},
26+
27+
setup() {
28+
const { searchFromQuery } = useSearch(null)
29+
return { searchFromQuery }
30+
},
31+
32+
async mounted() {
33+
this.onboardingTrap('explore_projects', false)
34+
},
1535
}
1636
</script>
37+
38+
<style lang="scss" scoped>
39+
.browse-layout {
40+
padding-top: pxToRem(74px);
41+
42+
.tab {
43+
margin-top: $space-l;
44+
}
45+
}
46+
47+
.browse-header {
48+
display: block;
49+
background-color: $primary-lighter;
50+
padding: $space-xl 0;
51+
padding: 1rem;
52+
}
53+
54+
.project-list__header {
55+
display: flex;
56+
flex-direction: column;
57+
margin-bottom: $space-l;
58+
59+
.header__title {
60+
grid-column: 2 / 3;
61+
place-self: center center;
62+
font-size: $font-size-3xl;
63+
font-weight: 700;
64+
margin: $space-m 0 $space-m 0;
65+
text-transform: uppercase;
66+
color: $almost-black;
67+
}
68+
}
69+
70+
@media only screen and (width >= 1000px) {
71+
.project-list__header {
72+
display: grid;
73+
grid-template-columns: 1fr 1fr 1fr;
74+
margin-bottom: 0;
75+
}
76+
77+
.header__title {
78+
margin: 0;
79+
}
80+
}
81+
</style>

tests/unit/components/search/BrowseLayout/BrowserLayout.spec.ts renamed to tests/unit/pages/SearchPage/SearchPage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BrowseLayout from '@/components/search/BrowseLayout/BrowseLayout.vue'
1+
import SearchPage from '@/pages/SearchPage/SearchPage.vue'
22
import { lpiShallowMount } from '@/../tests/helpers/LpiMount'
33
import english from '@/locales/en.json'
44
import { beforeEach, describe, expect, it, vi } from 'vitest'
@@ -44,7 +44,7 @@ describe('BrowseLayout', () => {
4444
})
4545

4646
it('should render BrowseLayout component', () => {
47-
wrapper = lpiShallowMount(BrowseLayout, defaultParams)
47+
wrapper = lpiShallowMount(SearchPage, defaultParams)
4848

4949
expect(wrapper.exists()).toBeTruthy()
5050
})

0 commit comments

Comments
 (0)