@designcrowd/fe-shared-lib 1.2.0-ml-jj-6 → 1.2.0-ml-jj-7

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
@@ -19,8 +19,7 @@ export { default as SellDomainNameWidget } from './src/experiences/components/Se
19
19
  export { default as PublishBrandPageModal } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue';
20
20
  export { default as PublishBrandPageCard } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageCard.vue';
21
21
 
22
- export { default as useSellDomainNameSearchContent } from './src/experiences/components/SellDomainNameSearch/UseSellDomainNameSearchContent';
23
- export { default as useSellDomainNameListSearchResultContent } from './src/experiences/components/SellDomainNameSearchResult/UseSellDomainNameListSearchResultContent';
22
+ export { default as useSellDomainContent } from './src/experiences/components/SellDomainNameSearch/useSellDomainContent';
24
23
 
25
24
  export { default as Button } from './src/atoms/components/Button/Button.vue';
26
25
  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-6",
3
+ "version": "1.2.0-ml-jj-7",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -7,7 +7,7 @@ export default {
7
7
  component: PublishBrandPageModal,
8
8
  };
9
9
 
10
- const locale = 'en-test';
10
+ const locale = 'en-US';
11
11
 
12
12
  const localePublishBrandPageModalContent = {
13
13
  'en-US': {
@@ -32,28 +32,6 @@ const localePublishBrandPageModalContent = {
32
32
  hasAlreadyPurchasedDomainCloseButtonLabel: 'No thanks, maybe later',
33
33
  },
34
34
  },
35
- 'en-test': {
36
- searchButtonLabel: '++Search',
37
- publishBrandPageModalContent: {
38
- firstTimePublishHeaderLabel: `++Set the URL for your Website`,
39
- sitePublishedLabel: `++Site published!`,
40
- publishSuccessLabel: `++Your Website is live! Start using your link:`,
41
- freePublishCardTitleLabel: `++Free Address`,
42
- freePublishCardDescriptionLabel: `++Choose a free address to publish now. You can always edit the URL later`,
43
- slugInputPlaceholderYourNameLabel: '++your-name',
44
- slugInputPlaceholderYourBusinessNameLabel: '++your-business-name',
45
- freeDomainLabel: `++Free domain`,
46
- purchasedDomainLabel: `++Purchased domain`,
47
- setUrlLabel: '++Set URL',
48
- publishLabel: '++Publish',
49
- viewMoreDomainLabel: '++VIEW MORE DOMAINS',
50
- viewMyWebsiteLabel: '++View Website',
51
- copyLabel: '++Copy',
52
- copySuccessLabel: '++Copied!',
53
- publishedSuccessDescriptionLabel: '++Buy matching domain name for your brand',
54
- hasAlreadyPurchasedDomainCloseButtonLabel: '++No thanks, maybe later',
55
- },
56
- },
57
35
  };
58
36
 
59
37
  export const NotPublishedWithPurchasedDomains = () => {
@@ -241,6 +241,7 @@
241
241
  :domain-name-items="domainNameItems"
242
242
  :previous-search-text="previousSearchText"
243
243
  :visible="isModalVisible"
244
+ :search-button-label="content.searchButtonLabel"
244
245
  :domain-search-location="sitePublishedModal"
245
246
  @close-modal="onSellDomainNameListCloseModal"
246
247
  @search="searchDomainName(true)"
@@ -424,8 +425,7 @@ export default {
424
425
  publishSuccessLabel: this.content.publishBrandPageModalContent.publishSuccessLabel,
425
426
  freePublishCardTitleLabel: this.content.publishBrandPageModalContent.freePublishCardTitleLabel,
426
427
  freePublishCardDescriptionLabel: this.content.publishBrandPageModalContent.freePublishCardDescriptionLabel,
427
- slugInputPlaceholderYourNameLabel:
428
- this.content.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
428
+ slugInputPlaceholderYourNameLabel: this.content.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
429
429
  slugInputPlaceholderYourBusinessNameLabel:
430
430
  this.content.publishBrandPageModalContent.slugInputPlaceholderYourBusinessNameLabel,
431
431
  freeDomainLabel: this.content.publishBrandPageModalContent.freeDomainLabel,
@@ -22,7 +22,7 @@
22
22
  {{ item.domainName }}
23
23
  </div>
24
24
  <div v-if="item.costPrice" class="tw-text-xs tw-text-grayscale-600 tw-flex tw-items-center">
25
- <span class="tw-mr-2"> Cost Price: </span>
25
+ <span class="tw-mr-2"> {{ costPriceLabel }} </span>
26
26
  <Price
27
27
  class="tw-font-bold"
28
28
  :amount="getCostPrice(item)"
@@ -30,7 +30,7 @@
30
30
  :currency="currency"
31
31
  fraction="2"
32
32
  :show-abbreviation="false"
33
- suffix="/yr"
33
+ :suffix="pricePerYearLabel"
34
34
  />
35
35
  </div>
36
36
  <div v-if="!isFree(item) || item.costPrice" class="tw-px-0 tw-mt-4 sm:tw-px-4 sm:tw-mt-0">
@@ -41,7 +41,7 @@
41
41
  :currency="currency"
42
42
  fraction="2"
43
43
  :show-abbreviation="false"
44
- suffix="/yr"
44
+ :suffix="pricePerYearLabel"
45
45
  />
46
46
  </div>
47
47
  </div>
@@ -63,8 +63,9 @@
63
63
  </div>
64
64
  </template>
65
65
  <script>
66
- import Button from '../../../../src/atoms/components/Button/Button.vue';
67
- import Price from '../../../../src/atoms/components/Price/Price.vue';
66
+ import Button from '../../../atoms/components/Button/Button.vue';
67
+ import Price from '../../../atoms/components/Price/Price.vue';
68
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
68
69
 
69
70
  import Events from '../../constants/event-constants';
70
71
 
@@ -108,6 +109,16 @@ export default {
108
109
  },
109
110
  },
110
111
  emits: ['load-more-domains'],
112
+ setup() {
113
+ const contentProvider = useSellDomainContent();
114
+ const content = contentProvider.getContent();
115
+ return {
116
+ freeDomainButtonLabel: content.freeDomainButtonLabel,
117
+ buyNowButtonLabel: content.buyNowButtonLabel,
118
+ pricePerYearLabel: content.pricePerYearLabel,
119
+ costPriceLabel: content.costPriceLabel,
120
+ };
121
+ },
111
122
  methods: {
112
123
  onBuyNowClick(domain) {
113
124
  const request = domain;
@@ -133,7 +144,7 @@ export default {
133
144
  return parseFloat(domain.price) === 0;
134
145
  },
135
146
  getPurchaseLabel(domain) {
136
- return this.isFree(domain) ? 'Free Domain' : 'Buy Now';
147
+ return this.isFree(domain) ? this.freeDomainButtonLabel : this.buyNowButtonLabel;
137
148
  },
138
149
  },
139
150
  };
@@ -13,9 +13,10 @@
13
13
  <SellDomainNameSearch
14
14
  v-if="visible"
15
15
  :is-design-com="isDesignCom"
16
- :header-title="headerTitle"
17
- :header-subtitle="headerSubtitle"
16
+ :header-title="headerTitle || domainSearchHeaderTitle"
17
+ :header-subtitle="headerSubtitle || domainSearchHeaderSubtitle"
18
18
  :initial-search-term="modelValue"
19
+ :search-button-label="searchButtonLabel"
19
20
  @onSearch="onSearch"
20
21
  @onSearchTextInputChange="onSearchTextInputChange"
21
22
  />
@@ -38,9 +39,7 @@ import Modal from '../../../atoms/components/Modal/Modal.vue';
38
39
 
39
40
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
40
41
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
41
-
42
- const headerSubtitle = 'Buy matching domain name for your brand';
43
- const headerTitle = 'Search a domain name';
42
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
44
43
 
45
44
  export default {
46
45
  components: {
@@ -60,11 +59,11 @@ export default {
60
59
  },
61
60
  headerSubtitle: {
62
61
  type: String,
63
- default: () => headerSubtitle,
62
+ default: null,
64
63
  },
65
64
  headerTitle: {
66
65
  type: String,
67
- default: () => headerTitle,
66
+ default: null,
68
67
  },
69
68
  isBusy: {
70
69
  type: Boolean,
@@ -92,8 +91,20 @@ export default {
92
91
  type: String,
93
92
  default: undefined,
94
93
  },
94
+ searchButtonLabel: {
95
+ type: String,
96
+ default: 'Search',
97
+ },
95
98
  },
96
99
  emits: ['close-modal', 'input', 'search'],
100
+ setup() {
101
+ const contentProvider = useSellDomainContent();
102
+ const content = contentProvider.getContent();
103
+ return {
104
+ domainSearchHeaderTitle: content.domainSearchHeaderTitle,
105
+ domainSearchHeaderSubtitle: content.domainSearchHeaderSubtitle,
106
+ };
107
+ },
97
108
  methods: {
98
109
  onSearch() {
99
110
  this.$emit('search');
@@ -49,8 +49,8 @@
49
49
  <SellDomainNameSearch
50
50
  v-if="visible"
51
51
  :is-design-com="isDesignCom"
52
- :header-title="headerTitle"
53
- :header-subtitle="headerSubtitle"
52
+ :header-title="headerTitle || domainSearchHeaderTitle"
53
+ :header-subtitle="headerSubtitle || domainSearchHeaderSubtitle"
54
54
  :initial-search-term="initialSearchTerm"
55
55
  @onSearch="onSearchDomainName"
56
56
  @onSearchTextInputChange="onSearchTextInputChange"
@@ -76,9 +76,7 @@ import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
76
76
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
77
77
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
78
78
  import Events from '../../constants/event-constants';
79
-
80
- const headerSubtitle = 'Buy matching domain name for your brand';
81
- const headerTitle = 'Search a domain name';
79
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
82
80
 
83
81
  export default {
84
82
  components: {
@@ -89,11 +87,11 @@ export default {
89
87
  props: {
90
88
  headerSubtitle: {
91
89
  type: String,
92
- default: () => headerSubtitle,
90
+ default: null,
93
91
  },
94
92
  headerTitle: {
95
93
  type: String,
96
- default: () => headerTitle,
94
+ default: null,
97
95
  },
98
96
  modelValue: {
99
97
  type: String,
@@ -122,6 +120,14 @@ export default {
122
120
  default: undefined,
123
121
  },
124
122
  },
123
+ setup() {
124
+ const contentProvider = useSellDomainContent();
125
+ const content = contentProvider.getContent();
126
+ return {
127
+ domainSearchHeaderTitle: content.domainSearchHeaderTitle,
128
+ domainSearchHeaderSubtitle: content.domainSearchHeaderSubtitle,
129
+ };
130
+ },
125
131
  data: () => ({
126
132
  domainNameItems: [],
127
133
  userCurrency: {},
@@ -43,7 +43,7 @@
43
43
  <script>
44
44
  import Button from '../../../atoms/components/Button/Button.vue';
45
45
  import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
46
- import useSellDomainNameSearchContent from './UseSellDomainNameSearchContent';
46
+ import useSellDomainContent from './useSellDomainContent';
47
47
 
48
48
  import { sellDomainNameMinSearchTextLength } from '../../constants/sell-domain-name-constants';
49
49
 
@@ -83,7 +83,7 @@ export default {
83
83
  },
84
84
  emits: ['onSearch', 'onSearchTextInputChange'],
85
85
  setup(props) {
86
- const contentProvider = useSellDomainNameSearchContent(props.contentOverride);
86
+ const contentProvider = useSellDomainContent(props.contentOverride);
87
87
  const content = contentProvider.getContent();
88
88
 
89
89
  return {
@@ -11,9 +11,19 @@ const defaultContent = {
11
11
  searchBarLabel: sellDomainNameSearchBarLabel,
12
12
  searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
13
13
  searchBarPreText: sellDomainNameSearchBarPreText,
14
+ domainSearchEmptyMessage: `Sorry, we couldn't find any domain for "{domainNameSearchTerm}".`,
15
+ searchAnotherDomainMessage: `Try searching with another domain name.`,
16
+
17
+ freeDomainButtonLabel: 'Free Domain',
18
+ buyNowButtonLabel: 'Buy Now',
19
+ pricePerYearLabel: '/yr',
20
+ costPriceLabel: 'Cost Price:',
21
+ domainSearchHeaderTitle: 'Search a domain name',
22
+ domainSearchHeaderSubtitle: 'Buy matching domain name for your brand',
23
+ domainSearchOrConnectHeaderSubtitle: 'Buy matching domain name for your brand or connect your existing domain',
14
24
  };
15
25
 
16
- const useSellDomainNameSearchContent = (overrides = {}) => {
26
+ const useSellDomainContent = (overrides = {}) => {
17
27
  const setGlobalContentHandler = (handler) => {
18
28
  globalContentProvider = handler;
19
29
  };
@@ -30,4 +40,4 @@ const useSellDomainNameSearchContent = (overrides = {}) => {
30
40
  };
31
41
  };
32
42
 
33
- export default useSellDomainNameSearchContent;
43
+ export default useSellDomainContent;
@@ -41,7 +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
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
45
45
 
46
46
  export default {
47
47
  components: {
@@ -102,7 +102,7 @@ export default {
102
102
  },
103
103
  },
104
104
  setup(props) {
105
- const contentProvider = useSellDomainNameListSearchResultContent(props.contentOverride);
105
+ const contentProvider = useSellDomainContent(props.contentOverride);
106
106
  const content = contentProvider.getContent();
107
107
 
108
108
  return {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- Buy matching domain name for your brand or connect your existing domain
3
+ {{ domainSearchOrConnectHeaderSubtitle }}
4
4
  <div class="tw-flex tw-flex-col md:tw-flex-row tw-mt-4 tw-mb-4">
5
5
  <TextInput
6
6
  v-model="searchText"
@@ -18,7 +18,7 @@
18
18
  <Button
19
19
  classes="tw-w-full tw-mt-2 md:tw-rounded-l-none md:tw-mt-0"
20
20
  variant="primary"
21
- label="Search"
21
+ :label="searchButtonLabel"
22
22
  :disabled="false"
23
23
  @on-click="onSearchBarClick"
24
24
  />
@@ -31,23 +31,21 @@
31
31
  :domain-name-items="domainNameItems"
32
32
  :previous-search-text="previousSearchText"
33
33
  :visible="isSearchDomainListModalVisible"
34
+ :search-button-label="searchButtonLabel"
34
35
  @close-modal="onSellDomainNameListCloseModal"
35
36
  @search="onSearchDomainName(true)"
36
37
  />
37
38
  </div>
38
39
  </template>
39
40
  <script>
40
- import Button from '../../../../src/atoms/components/Button/Button.vue';
41
- import TextInput from '../../../../src/atoms/components/TextInput/TextInput.vue';
41
+ import Button from '../../../atoms/components/Button/Button.vue';
42
+ import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
42
43
 
43
44
  import SellDomainNameListModal from '../SellDomainNameListModal/SellDomainNameListModal.vue';
44
- import {
45
- sellDomainNameMinSearchTextLength,
46
- sellDomainNameSearchBarLabel,
47
- sellDomainNameSearchBarPlaceholder,
48
- } from '../../constants/sell-domain-name-constants';
45
+ import { sellDomainNameMinSearchTextLength } from '../../constants/sell-domain-name-constants';
49
46
  import Events from '../../constants/event-constants';
50
47
  import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
48
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
51
49
 
52
50
  export default {
53
51
  components: {
@@ -76,13 +74,21 @@ export default {
76
74
  default: false,
77
75
  },
78
76
  },
77
+ setup() {
78
+ const contentProvider = useSellDomainContent();
79
+ const content = contentProvider.getContent();
80
+ return {
81
+ searchButtonLabel: content.searchButtonLabel,
82
+ searchBarLabel: content.searchBarLabel,
83
+ searchBarPlaceholder: content.searchBarPlaceholder,
84
+ domainSearchOrConnectHeaderSubtitle: content.domainSearchOrConnectHeaderSubtitle,
85
+ };
86
+ },
79
87
  data: () => ({
80
88
  domainNameItems: undefined,
81
89
  userCurrency: undefined,
82
90
  isBusy: false,
83
91
  isSearchDomainListModalVisible: false,
84
- searchBarLabel: sellDomainNameSearchBarLabel,
85
- searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
86
92
  searchText: '',
87
93
  previousSearchText: '',
88
94
  }),
@@ -1,25 +0,0 @@
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;