@vixoniccom/footbal-score 1.0.1-beta.19 → 1.0.1-beta.2

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/CHANGELOG.md CHANGED
@@ -2,42 +2,6 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.0.1-beta.19](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.18...v1.0.1-beta.19) (2022-11-23)
6
-
7
- ### [1.0.1-beta.18](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.17...v1.0.1-beta.18) (2022-11-23)
8
-
9
- ### [1.0.1-beta.17](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.16...v1.0.1-beta.17) (2022-11-23)
10
-
11
- ### [1.0.1-beta.16](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.15...v1.0.1-beta.16) (2022-11-23)
12
-
13
- ### [1.0.1-beta.15](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.14...v1.0.1-beta.15) (2022-11-22)
14
-
15
- ### [1.0.1-beta.14](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.13...v1.0.1-beta.14) (2022-11-22)
16
-
17
- ### [1.0.1-beta.13](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.12...v1.0.1-beta.13) (2022-11-22)
18
-
19
- ### [1.0.1-beta.12](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.11...v1.0.1-beta.12) (2022-11-22)
20
-
21
- ### [1.0.1-beta.11](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.10...v1.0.1-beta.11) (2022-11-22)
22
-
23
- ### [1.0.1-beta.10](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.9...v1.0.1-beta.10) (2022-11-21)
24
-
25
- ### [1.0.1-beta.9](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.8...v1.0.1-beta.9) (2022-11-21)
26
-
27
- ### [1.0.1-beta.8](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.7...v1.0.1-beta.8) (2022-11-21)
28
-
29
- ### [1.0.1-beta.6](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.7...v1.0.1-beta.6) (2022-11-21)
30
-
31
- ### [1.0.1-beta.7](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.6...v1.0.1-beta.7) (2022-11-21)
32
-
33
- ### [1.0.1-beta.6](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.5...v1.0.1-beta.6) (2022-11-21)
34
-
35
- ### [1.0.1-beta.5](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.4...v1.0.1-beta.5) (2022-11-21)
36
-
37
- ### [1.0.1-beta.4](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.3...v1.0.1-beta.4) (2022-11-16)
38
-
39
- ### [1.0.1-beta.3](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.2...v1.0.1-beta.3) (2022-11-16)
40
-
41
5
  ### [1.0.1-beta.2](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.1...v1.0.1-beta.2) (2022-11-16)
42
6
 
43
7
  ### [1.0.1-beta.1](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.0...v1.0.1-beta.1) (2022-11-15)
package/build.zip CHANGED
Binary file
@@ -10,43 +10,6 @@
10
10
  "type": "label",
11
11
  "label": "Datos"
12
12
  },
13
- {
14
- "id": "updateTime",
15
- "type": "select-input",
16
- "required": true,
17
- "label": "Actualización",
18
- "defaultValue": 300000,
19
- "items": [
20
- {
21
- "label": "5 minutos",
22
- "value": 300000
23
- },
24
- {
25
- "label": "10 minutos",
26
- "value": 600000
27
- },
28
- {
29
- "label": "30 minutos",
30
- "value": 1800000
31
- },
32
- {
33
- "label": "1 hora",
34
- "value": 3600000
35
- },
36
- {
37
- "label": "6 horas",
38
- "value": 21600000
39
- },
40
- {
41
- "label": "12 horas",
42
- "value": 43200000
43
- },
44
- {
45
- "label": "Diario",
46
- "value": 86400000
47
- }
48
- ]
49
- },
50
13
  {
51
14
  "type": "switch",
52
15
  "id": "titleEnabled",
@@ -133,21 +96,14 @@
133
96
  "type": "text-input",
134
97
  "required": false,
135
98
  "label": "Ancho columna fecha partido",
136
- "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)",
137
- "defaultValue":"200px"
138
- },
139
- {
140
- "type": "text-format",
141
- "id": "statusFormat",
142
- "label": "Formato Status"
99
+ "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
143
100
  },
144
101
  {
145
102
  "id": "widthStatus",
146
103
  "type": "text-input",
147
104
  "required": false,
148
105
  "label": "Ancho columna Status Partido",
149
- "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)",
150
- "defaultValue":"200px"
106
+ "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
151
107
  },
152
108
  {
153
109
  "type": "text-format",
@@ -159,8 +115,7 @@
159
115
  "type": "text-input",
160
116
  "required": false,
161
117
  "label": "Ancho columna Goles",
162
- "description": "Agregar en px, ejemplo 100px. (Por defecto son 100px)",
163
- "defaultValue":"200px"
118
+ "description": "Agregar en px, ejemplo 100px. (Por defecto son 100px)"
164
119
  },
165
120
  {
166
121
  "type": "switch",
@@ -180,8 +135,7 @@
180
135
  "required": false,
181
136
  "label": "Ancho columna Nombre Equipo",
182
137
  "show": "{{descriptionEnabled}} === true",
183
- "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)",
184
- "defaultValue":"200px"
138
+ "description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
185
139
  },
186
140
  {
187
141
  "type": "label",
@@ -199,8 +153,7 @@
199
153
  "type": "text-input",
200
154
  "required": false,
201
155
  "label": "Ancho columna Bandera",
202
- "description": "Agregar en px, ejemplo 100px. (Por defecto son 300px)",
203
- "defaultValue":"300px"
156
+ "description": "Agregar en px, ejemplo 100px. (Por defecto son 300px)"
204
157
  }
205
158
  ]
206
159
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/footbal-score",
3
3
  "alias": "Resultados Deportivos",
4
- "version": "1.0.1-beta.19",
4
+ "version": "1.0.1-beta.2",
5
5
  "description": "Muestra resultados en vivo de fútbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
package/src/App.tsx CHANGED
@@ -10,7 +10,7 @@ type Props = {
10
10
  }
11
11
 
12
12
  export const App = ({ data, start }: Props) => {
13
- const [dataFixture, setDataFixture] = useState([]);
13
+ const [dataFixture, setDataFixture] = useState([]);
14
14
 
15
15
  const { configureState, addConfiguration } = useContext(ConfigureContext)
16
16
 
@@ -19,10 +19,8 @@ export const App = ({ data, start }: Props) => {
19
19
  const { backgroundImage,
20
20
  padding,
21
21
  msj0 = '',
22
- updateTime
23
22
  } = parameters
24
- console.log("🚀 ~ file: App.tsx ~ line 24 ~ App ~ updateTime", updateTime)
25
-
23
+
26
24
  let backgroundImageState = backgroundImage && backgroundImage.filename
27
25
  ? `url("${downloadsPath}/${backgroundImage.filename}")`
28
26
  : ''
@@ -32,20 +30,19 @@ export const App = ({ data, start }: Props) => {
32
30
  setDataFixture(data);
33
31
  }
34
32
 
33
+ //Request data every 5 minutes
34
+ // useEffect(() => {
35
+ // const interval = setInterval(() => {
36
+ // if (start) getData()
37
+ // }, 300000)
38
+ // return () => clearInterval(interval)
39
+ // }, [])
35
40
 
36
41
  useEffect(() => {
37
- console.log('entro aquí')
38
42
  if (start) getData()
39
43
  addConfiguration(data)
40
44
  }, [data])
41
45
 
42
- //Request data every 5 minutes
43
- useEffect(() => {
44
- const interval = setInterval(() => {
45
- getData()
46
- }, updateTime || 300000)
47
- return () => clearInterval(interval)
48
- }, [updateTime])
49
46
 
50
47
 
51
48
 
@@ -63,7 +60,7 @@ export const App = ({ data, start }: Props) => {
63
60
  padding: padding
64
61
  }}
65
62
  >
66
- <FontLoader paths={['nameFormat.font','statusFormat.font', 'timeFormat.font','titleFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'goalsFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
63
+ <FontLoader paths={['nameFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
67
64
  {
68
65
  parameters.titleEnabled &&
69
66
  <div style={{
@@ -2,11 +2,11 @@ import React, { useContext } from 'react'
2
2
  import { ConfigureContext } from '../../contex/configureContext/ConfigureContext'
3
3
  import { FormattedText } from '../FormattedText'
4
4
 
5
- export const Results = (goals: any) => {
5
+ export const Results = (goals: any) => {
6
6
 
7
7
  const { configureState } = useContext(ConfigureContext)
8
8
  const { parameters } = configureState
9
-
9
+
10
10
 
11
11
  return (
12
12
  <div style={{
@@ -1,19 +1,16 @@
1
- import React, { useContext, useEffect, useState } from 'react'
1
+ import React, { useContext } from 'react'
2
2
  // import { TeamItems } from './TeamItems'
3
+ import { Results } from './Results';
3
4
  import { Time } from './Time';
4
5
  import { FormattedText } from '../FormattedText';
5
6
  import { ConfigureContext } from '../../contex/configureContext/ConfigureContext';
6
7
  import { Status } from './Status';
7
- import { translateTeams } from '../../helpers/translateTeams';
8
- import { Results } from './Results';
9
8
 
10
9
  export const Row = (item: any) => {
11
10
 
12
11
  const { fixture, teams, goals } = item.item;
13
12
  const { configureState } = useContext(ConfigureContext)
14
13
  const { parameters } = configureState
15
- const [homeTeam, setHomeTeam] = useState(false);
16
- const [awayTeam, setAwayTeam] = useState(false);
17
14
 
18
15
  const {
19
16
  descriptionEnabled,
@@ -28,42 +25,8 @@ export const Row = (item: any) => {
28
25
  widthTime,
29
26
  } = parameters
30
27
 
31
- let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
32
- ` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
33
-
34
- let nameHome = translateTeams(teams.home.name)
35
- let nameAway = translateTeams(teams.away.name)
36
-
37
-
38
- const requestFlagHome = async (id: any) => {
39
- try {
40
- const resp1 = await fetch(`https://storage.googleapis.com/vixoniccom-emails/results_flags/${id}.png`)
41
- if (resp1.status === 200) {
42
- setHomeTeam(true)
43
- }
44
- } catch (error) {
45
- console.log(error)
46
- setHomeTeam(false)
47
- }
48
- }
49
-
50
- const requestFlagAway = async (id: any) => {
51
- try {
52
- const resp1 = await fetch(`https://storage.googleapis.com/vixoniccom-emails/results_flags/${id}.png`)
53
- if (resp1.status === 200) {
54
- setAwayTeam(true)
55
- }
56
- } catch (error) {
57
- console.log(error)
58
- setAwayTeam(false)
59
-
60
- }
61
- }
62
-
63
- useEffect(() => {
64
- requestFlagHome(teams.home.id)
65
- requestFlagAway(teams.away.id)
66
- }, [])
28
+ let gridColumns = descriptionEnabled ? `${widthTime} ${widthStatus} ${widthDescription} ${widthImage} ${widthScore} ${widthImage} ${widthDescription}` :
29
+ ` ${widthTime} ${widthStatus} ${widthImage} ${widthScore} ${widthImage}`
67
30
 
68
31
 
69
32
  return (
@@ -71,35 +34,17 @@ export const Row = (item: any) => {
71
34
  style={{
72
35
  display: 'grid',
73
36
  gridTemplateColumns: `${gridColumns}`,
74
- columnGap: `${columnGap || "10px"}`,
37
+ columnGap: `${columnGap}`,
75
38
  width: '100%',
76
- height: '100%',
77
39
  alignItems: 'center',
78
40
  placeContent: 'center',
79
- padding: `${rowGap || "30px"} 0px`,
41
+ padding: `${rowGap} 0px`,
80
42
  justifyContent: 'center'
81
43
  }}
82
44
  >
83
- <div
84
- style={{
85
- display: 'flex',
86
- justifyContent: 'flex-end',
87
- }}
88
- >
89
- <Time time={Number(fixture.timestamp)} />
90
-
91
- </div>
92
-
93
- <div
94
- style={{
95
- display: 'flex',
96
- justifyContent: 'flex-end',
97
- }}
98
- >
99
- <Status status={fixture.status.short} />
100
-
101
- </div>
45
+ <Time time={Number(fixture.timestamp)} />
102
46
 
47
+ <Status status={fixture.status.short} />
103
48
 
104
49
 
105
50
  {
@@ -107,56 +52,29 @@ export const Row = (item: any) => {
107
52
  <div style={{
108
53
  display: 'flex',
109
54
  justifyContent: 'flex-end',
110
- minWidth: '150px',
111
- marginRight: '5px'
112
55
  }}>
113
- <FormattedText text={nameHome} format={descriptionFormat} />
56
+ <FormattedText text={teams.home.name} format={descriptionFormat} />
114
57
  </div>
115
58
  }
116
59
  <div style={{
117
60
  display: 'flex',
118
61
  justifyContent: 'center',
119
- width: '100%',
120
- alignItems: 'center',
121
- marginLeft: '5px'
122
62
  }}>
123
- {
124
- homeTeam ?
125
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.home.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} /> :
126
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
127
-
128
- }
63
+ <img src={teams.home.logo} style={{ width: `${imageSize}%` }} />
129
64
  </div>
130
65
 
131
66
  <Results goals={goals} />
132
-
133
67
  <div
134
68
  style={{
135
69
  display: 'flex',
136
- justifyContent: 'flex-start',
137
- width: '100%',
138
- alignItems: 'center',
139
- marginRight: '5px'
70
+ justifyContent: 'center',
140
71
  }}
141
72
  >
142
- {
143
- awayTeam ?
144
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.away.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
145
- : <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
146
- }
73
+ <img src={teams.away.logo} style={{ width: `${imageSize}%` }} />
147
74
  </div>
148
75
  {
149
76
  descriptionEnabled &&
150
- <div
151
- style={{
152
- display: 'flex',
153
- justifyContent: 'flex-start',
154
- marginLeft: '10px',
155
- minWidth: '150px'
156
- }}
157
- >
158
- <FormattedText text={nameAway} format={descriptionFormat} />
159
- </div>
77
+ <FormattedText text={teams.away.name} format={descriptionFormat} />
160
78
  }
161
79
  </div >
162
80
  )
@@ -9,26 +9,14 @@ export const Status = ({
9
9
  let translateStatus: string = ''
10
10
  const { configureState } = useContext(ConfigureContext)
11
11
  const { parameters } = configureState
12
-
12
+
13
13
  switch (status) {
14
14
  case 'NS':
15
15
  translateStatus = 'Por iniciar'
16
16
  break
17
- case '1H':
18
- translateStatus = 'Primer tiempo'
19
- break
20
- case 'HT':
21
- translateStatus = 'Medio tiempo '
22
- break
23
- case '2H':
24
- translateStatus = 'Segundo tiempo'
25
- break
26
17
  case 'FT':
27
18
  translateStatus = 'Finalizado'
28
19
  break
29
- case 'P':
30
- translateStatus = 'Penales'
31
- break
32
20
  case 'LIVE':
33
21
  translateStatus = 'En vivo'
34
22
  break
@@ -50,20 +50,20 @@ const INITIAL_STATE: VixonicData = {
50
50
  template: "",
51
51
  textAlignment: "center",
52
52
  textPosition: 0,
53
- updateTime: 300000,
53
+ updateTime: 0,
54
54
  urlBaseApi: "",
55
55
  imageMargin: "",
56
56
  textMargin: "",
57
57
  dateMargin: "",
58
58
  separator: false,
59
59
  widthDescription: "200px",
60
- widthImage: "300px",
60
+ widthImage: "1000px",
61
61
  widthScore: "100px",
62
62
  columnGap: "10px",
63
63
  rowGap: "30px",
64
64
  widthStatus: "200px",
65
- widthTime: "200px",
66
- }
65
+ widthTime: "200px"
66
+ }
67
67
  }
68
68
 
69
69
  interface props {
@@ -51,7 +51,7 @@ export const parameterReducer = (state: VixonicData, action: ConfigureAction) =>
51
51
  rowGap: parameters.rowGap,
52
52
  widthTime: parameters.widthTime,
53
53
  widthStatus: parameters.widthStatus,
54
- }
54
+ }
55
55
  }
56
56
  default:
57
57
  return state;
@@ -1,26 +1,20 @@
1
- import moment from 'moment';
1
+ // import moment from 'moment';
2
2
  const axios = require("axios");
3
3
 
4
4
  export const getFixture = async () => {
5
5
 
6
- const today = moment().format('YYYY-MM-DD')
6
+ // const today = moment().format('YYYY-MM-DD')
7
7
  // console.log("🚀 ~ file: getFixture.ts ~ line 6 ~ getFixture ~ today", today)
8
8
 
9
9
  const options = {
10
10
  method: 'GET',
11
11
  url: 'https://api-football-v1.p.rapidapi.com/v3/fixtures',
12
- params: { date: `${today}`, league: '1', season: '2022' },
12
+ params: { date: '2022-11-21', league: '1', season: '2022' },
13
13
  headers: {
14
14
  'X-RapidAPI-Key': 'a7e693d4c5msh72a2ff2020fd601p12dd08jsn0f168421d7bb',
15
15
  'X-RapidAPI-Host': 'api-football-v1.p.rapidapi.com'
16
16
  }
17
17
  };
18
- try {
19
- const response = await axios.request(options)
20
- return response.data.response
21
- } catch (error) {
22
- console.error(error);
23
- return []
24
- }
25
-
18
+ const response = await axios.request(options)
19
+ return response.data.response
26
20
  }
@@ -25,7 +25,6 @@ declare type VixonicParameters = Partial<{
25
25
  dateDayFormat: DateFormat
26
26
  timeFormat: DateFormat
27
27
  goalsFormat: DateFormat
28
- updateTime: number
29
28
  dateEnabled: boolean
30
29
  title0: string
31
30
  titleEnabled: boolean
@@ -3,9 +3,13 @@
3
3
  "urlBaseApi": "mandomedio",
4
4
  "msj0": "No hay partidos",
5
5
  "statusEnabled": true,
6
- "timeRequest":60000,
6
+ "widthDescription" : "200px",
7
+ "widthImage": "300px",
8
+ "widthScore": "100px",
7
9
  "rowGap":"30px",
8
10
  "columnGap":"10px",
11
+ "widthStatus": "200px",
12
+ "widthTime": "200px",
9
13
  "padding": "30px 25px 80px 40px",
10
14
  "dataMode": "monthly",
11
15
  "template": "standard",
@@ -1,91 +0,0 @@
1
-
2
- export const translateTeams = (team: string) => {
3
- switch (team) {
4
- case 'England':
5
- return 'Inglaterra'
6
- case 'Spain':
7
- return 'España'
8
- case 'Italy':
9
- return 'Italia'
10
- case 'Germany':
11
- return 'Alemania'
12
- case 'France':
13
- return 'Francia'
14
- case 'Portugal':
15
- return 'Portugal'
16
- case 'Netherlands':
17
- return 'Holanda'
18
- case 'Belgium':
19
- return 'Bélgica'
20
- case 'Russia':
21
- return 'Rusia'
22
- case 'Turkey':
23
- return 'Turquía'
24
- case 'Ukraine':
25
- return 'Ucrania'
26
- case 'Czech Republic':
27
- return 'República Checa'
28
- case 'Sweden':
29
- return 'Suecia'
30
- case 'Poland':
31
- return 'Polonia'
32
- case 'Austria':
33
- return 'Austria'
34
- case 'Switzerland':
35
- return 'Suiza'
36
- case 'Denmark':
37
- return 'Dinamarca'
38
- case 'Hungary':
39
- return 'Hungría'
40
- case 'Romania':
41
- return 'Rumanía'
42
- case 'Croatia':
43
- return 'Croacia'
44
- case 'Scotland':
45
- return 'Escocia'
46
- case 'Wales':
47
- return 'Gales'
48
- case 'Northern Ireland':
49
- return 'Irlanda del Norte'
50
- case 'Slovakia':
51
- return 'Eslovaquia'
52
- case 'Norway':
53
- return 'Noruega'
54
- case 'Finland':
55
- return 'Finlandia'
56
- case 'Bulgaria':
57
- return 'Bulgaria'
58
- case 'North Macedonia':
59
- return 'Macedonia del Norte'
60
- case 'Iceland':
61
- return 'Islandia'
62
- case 'Iran':
63
- return 'Irán'
64
- case 'United States':
65
- return 'Estados Unidos'
66
- case 'Mexico':
67
- return 'México'
68
- case 'Tunisia':
69
- return 'Túnez'
70
- case 'Japan':
71
- return 'Japón'
72
- case 'Argentina':
73
- return 'Argentina'
74
- case 'Canada':
75
- return 'Canadá'
76
- case 'Morocco':
77
- return 'Marruecos'
78
- case 'Brazil':
79
- return 'Brasil'
80
- case 'Cameroon':
81
- return 'Camerún'
82
- case 'Ghana':
83
- return 'Ghana'
84
- case 'South Korea':
85
- return 'Corea del Sur'
86
- case 'Saudi Arabia':
87
- return 'Arabia Saudita'
88
- default:
89
- return team
90
- }
91
- }