@vixoniccom/news-internal 0.4.21-dev.16 → 0.4.21-dev.18

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/build.zip CHANGED
Binary file
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.16",
11
+ "version": "0.4.21-dev.18",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -13,13 +13,59 @@ export const App: React.FunctionComponent<Props> = ({ data }) => {
13
13
 
14
14
  const parseNews = (data?: VixonicData): NewsItem[] => {
15
15
  if (!data) return []
16
- const { news } = data.parameters
16
+ const { news, newsSizeSelect } = data.parameters
17
17
  const parsedNews = news?.map((n) => {
18
18
  const { image, ...rest } = n
19
19
  let parsedImage
20
20
  const qrUrl = n.qrCodeUrl
21
21
  if (image?.filename) parsedImage = `${data.downloadsPath}/${image.filename}`
22
- return { ...rest, image: parsedImage, id: uuid(), qrCodeUrl: qrUrl }
22
+
23
+ // Mapear title según newsSizeSelect
24
+ let title = ''
25
+ switch (newsSizeSelect) {
26
+ case 'short':
27
+ title = n.titleShort || ''
28
+ break
29
+ case 'medium':
30
+ title = n.titleMedium || ''
31
+ break
32
+ case 'large':
33
+ title = n.titleLarge || ''
34
+ break
35
+ case 'extra-large':
36
+ title = n.titleExtraLarge || ''
37
+ break
38
+ default:
39
+ title = n.titleMedium || ''
40
+ }
41
+
42
+ // Mapear description según newsSizeSelect
43
+ let description = ''
44
+ switch (newsSizeSelect) {
45
+ case 'short':
46
+ description = n.descriptionShort || ''
47
+ break
48
+ case 'medium':
49
+ description = n.descriptionMedium || ''
50
+ break
51
+ case 'large':
52
+ description = n.descriptionLarge || ''
53
+ break
54
+ case 'extra-large':
55
+ description = n.descriptionExtraLarge || ''
56
+ break
57
+ default:
58
+ description = n.descriptionMedium || ''
59
+ }
60
+
61
+ return {
62
+ ...rest,
63
+ title,
64
+ description,
65
+ image: parsedImage,
66
+ id: uuid(),
67
+ qrCodeUrl: qrUrl
68
+ }
23
69
  }).filter((n) => {
24
70
  const { expirationDate } = n
25
71
  const today = dayjs()