@vixoniccom/news-internal 0.4.21-dev.31 → 0.4.21-dev.33

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
@@ -10,8 +10,8 @@ export const newsGroup = new List({
10
10
  range: new NumberRangeValue(1, 200),
11
11
  itemDisplayClass: '2-lines',
12
12
  itemDisplayAttributes: {
13
- title: 'title',
14
- subtitle: 'description',
13
+ title: 'titleMedium',
14
+ subtitle: 'descriptionMedium',
15
15
  expirationDate: 'expirationDate',
16
16
  },
17
17
  })
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.31",
11
+ "version": "0.4.21-dev.33",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -36,7 +36,7 @@
36
36
  "@types/react-transition-group": "^4.4.12",
37
37
  "@types/uuid": "^9.0.1",
38
38
  "@vixoniccom/module-packager": "^2.13.0-dev.1",
39
- "@vixoniccom/modules": "^2.25.0-dev.13",
39
+ "@vixoniccom/modules": "^2.22.0-dev.3",
40
40
  "standard-version": "^9.5.0"
41
41
  }
42
42
  }
@@ -24,7 +24,7 @@ export const App: React.FunctionComponent<Props> = ({ data }) => {
24
24
  const parseNews = (data?: VixonicData): NewsItem[] => {
25
25
  if (!data) return []
26
26
  const { news, newsSizeSelect } = data.parameters
27
- const parsedNews = news?.map((n) => {
27
+ const parsedNews = news?.map((n, index) => {
28
28
  const { image, ...rest } = n
29
29
  let parsedImage
30
30
  const qrUrl = n.qrCodeUrl
@@ -38,7 +38,7 @@ export const App: React.FunctionComponent<Props> = ({ data }) => {
38
38
  title,
39
39
  description,
40
40
  image: parsedImage,
41
- id: uuid(),
41
+ id: n.__id ?? String(index),
42
42
  qrCodeUrl: qrUrl
43
43
  }
44
44
  }).filter((n) => {
@@ -18,6 +18,12 @@ export const NewsContainer: React.FunctionComponent<Props> = (props) => {
18
18
  const [currentIndex, setCurrentIndex] = useState(0)
19
19
  const item = props.items.length > currentIndex ? props.items[currentIndex] : undefined
20
20
 
21
+ useEffect(() => {
22
+ if (props.items.length > 0 && currentIndex >= props.items.length) {
23
+ setCurrentIndex(0)
24
+ }
25
+ }, [props.items.length])
26
+
21
27
  useEffect(() => {
22
28
  startTimeout()
23
29
  return () => {