@designcrowd/fe-shared-lib 1.2.0-ml-jj-3 → 1.2.0-ml-jj-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as PublishBrandPageModal } from './src/experiences/components/P
20
20
  export { default as PublishBrandPageCard } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageCard.vue';
21
21
 
22
22
  export { default as useSellDomainNameSearchContent } from './src/experiences/components/SellDomainNameSearch/UseSellDomainNameSearchContent';
23
+ export { default as useSellDomainNameListSearchResultContent } from './src/experiences/components/SellDomainNameSearchResult/UseSellDomainNameListSearchResultContent';
23
24
 
24
25
  export { default as Button } from './src/atoms/components/Button/Button.vue';
25
26
  export { default as ButtonGroup } from './src/atoms/components/ButtonGroup/ButtonGroup.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.2.0-ml-jj-3",
3
+ "version": "1.2.0-ml-jj-5",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -12,10 +12,10 @@
12
12
  {{ title }}
13
13
  </p>
14
14
  <span
15
- v-if="showLabel"
15
+ v-if="pillLabel"
16
16
  class="tw-text-xs tw-h-4 tw-w-fit tw-text-primary-500 tw-border tw-border-solid tw-border-primary-500 tw-rounded-full tw-px-2 tw-font-sans tw-uppercase"
17
17
  >
18
- Recommended
18
+ {{ pillLabel }}
19
19
  </span>
20
20
  </div>
21
21
  <p class="tw-mt-2 md:tw-mt-0 tw-text-grayscale-600 tw-text-sm">
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 desktop-cta">
29
29
  <Button
30
- label="Search"
30
+ :label="searchButtonLabel"
31
31
  class="tw-flex tw-items-center tw-justify-center md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24"
32
32
  data-test-brand-page-search-button
33
33
  variant="primary"
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
  <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 mobile-cta tw-mt-2">
49
49
  <Button
50
- label="Search"
50
+ :label="searchButtonLabel"
51
51
  class="tw-flex tw-items-center tw-justify-center md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24"
52
52
  data-test-brand-page-search-button
53
53
  variant="primary"
@@ -86,9 +86,13 @@ const props = defineProps({
86
86
  type: Boolean,
87
87
  default: true,
88
88
  },
89
- showLabel: {
90
- type: Boolean,
91
- default: false,
89
+ searchButtonLabel: {
90
+ type: String,
91
+ default: () => 'Search',
92
+ },
93
+ pillLabel: {
94
+ type: String,
95
+ default: null,
92
96
  },
93
97
  });
94
98
 
@@ -34,7 +34,7 @@
34
34
  </Modal>
35
35
  </template>
36
36
  <script>
37
- import Modal from '../../../../src/atoms/components/Modal/Modal.vue';
37
+ import Modal from '../../../atoms/components/Modal/Modal.vue';
38
38
 
39
39
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
40
40
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <template v-if="!!this.$slots['header']">
2
+ <template v-if="!!$slots.header">
3
3
  <Modal
4
4
  classes="sell-domain-name-list-modal--modal tw-text-black"
5
5
  close-on-esc
@@ -71,7 +71,7 @@
71
71
  </template>
72
72
  </template>
73
73
  <script>
74
- import Modal from '../../../../src/atoms/components/Modal/Modal.vue';
74
+ import Modal from '../../../atoms/components/Modal/Modal.vue';
75
75
  import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
76
76
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
77
77
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
@@ -7,7 +7,7 @@ import {
7
7
  let globalContentProvider = null;
8
8
 
9
9
  const defaultContent = {
10
- searchButtonLabel: 'Search---',
10
+ searchButtonLabel: 'Search',
11
11
  searchBarLabel: sellDomainNameSearchBarLabel,
12
12
  searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
13
13
  searchBarPreText: sellDomainNameSearchBarPreText,
@@ -41,6 +41,7 @@ import Picture from '../../../atoms/components/Picture/Picture.vue';
41
41
 
42
42
  import SellDomainNameList from '../SellDomainNameList/SellDomainNameList.vue';
43
43
  import Events from '../../constants/event-constants';
44
+ import useSellDomainNameListSearchResultContent from './UseSellDomainNameListSearchResultContent';
44
45
 
45
46
  export default {
46
47
  components: {
@@ -99,15 +100,18 @@ export default {
99
100
  type: String,
100
101
  default: undefined,
101
102
  },
102
- content: {
103
- type: Object,
104
- required: true,
105
- },
103
+ },
104
+ setup(props) {
105
+ const contentProvider = useSellDomainNameListSearchResultContent(props.contentOverride);
106
+ const content = contentProvider.getContent();
107
+
108
+ return {
109
+ domainSearchEmptyMessage: content.domainSearchEmptyMessage,
110
+ searchAnotherDomainMessage: content.searchAnotherDomainMessage,
111
+ };
106
112
  },
107
113
  data() {
108
114
  return {
109
- domainSearchEmptyMessage: this.content.sellDomainNameListSearchResult.domainSearchEmptyMessage,
110
- searchAnotherDomainMessage: this.content.sellDomainNameListSearchResult.searchAnotherDomainMessage,
111
115
  domainNameItemsInView: undefined,
112
116
  };
113
117
  },
@@ -0,0 +1,25 @@
1
+ let globalContentProvider = null;
2
+
3
+ const defaultContent = {
4
+ domainSearchEmptyMessage: `Sorry, we couldn't find any domain for "{domainNameSearchTerm}".`,
5
+ searchAnotherDomainMessage: `Try searching with another domain name.`,
6
+ };
7
+
8
+ const useSellDomainNameListSearchResultContent = (overrides = {}) => {
9
+ const setGlobalContentHandler = (handler) => {
10
+ globalContentProvider = handler;
11
+ };
12
+
13
+ return {
14
+ setGlobalContentHandler,
15
+ getContent: () => {
16
+ return {
17
+ ...defaultContent,
18
+ ...(globalContentProvider ? globalContentProvider() : {}), // provide global content through global injection
19
+ ...overrides, // can override specific contents on demand
20
+ };
21
+ },
22
+ };
23
+ };
24
+
25
+ export default useSellDomainNameListSearchResultContent;
@@ -21,7 +21,6 @@
21
21
  :domain-name-items-per-page="domainNameItemsPerPage"
22
22
  :load-more-domains-button-text="loadMoreDomainsButtonText"
23
23
  :domain-search-location="domainSearchLocation"
24
- :content="content"
25
24
  />
26
25
  </div>
27
26
  </template>