@vixoniccom/footbal-score 1.0.1-beta.2 → 1.0.1-beta.20
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 +38 -0
- package/build.zip +0 -0
- package/configuration.json +52 -5
- package/package.json +1 -1
- package/src/App.tsx +13 -10
- package/src/components/table-fixture/Results.tsx +2 -2
- package/src/components/table-fixture/Row.tsx +93 -13
- package/src/components/table-fixture/Status.tsx +13 -1
- package/src/contex/configureContext/ConfigureProvider.tsx +4 -4
- package/src/contex/configureContext/configureReducer.ts +1 -1
- package/src/helpers/getFixture.ts +11 -5
- package/src/helpers/translateTeams.ts +91 -0
- package/src/parameters.d.ts +1 -0
- package/src/test/parameters.json +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
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.20](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.19...v1.0.1-beta.20) (2022-11-24)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
9
|
+
### [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)
|
|
10
|
+
|
|
11
|
+
### [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)
|
|
12
|
+
|
|
13
|
+
### [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)
|
|
14
|
+
|
|
15
|
+
### [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)
|
|
16
|
+
|
|
17
|
+
### [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)
|
|
18
|
+
|
|
19
|
+
### [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)
|
|
20
|
+
|
|
21
|
+
### [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)
|
|
22
|
+
|
|
23
|
+
### [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)
|
|
24
|
+
|
|
25
|
+
### [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)
|
|
26
|
+
|
|
27
|
+
### [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)
|
|
28
|
+
|
|
29
|
+
### [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)
|
|
30
|
+
|
|
31
|
+
### [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)
|
|
32
|
+
|
|
33
|
+
### [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)
|
|
34
|
+
|
|
35
|
+
### [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)
|
|
36
|
+
|
|
37
|
+
### [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)
|
|
38
|
+
|
|
39
|
+
### [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)
|
|
40
|
+
|
|
41
|
+
### [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)
|
|
42
|
+
|
|
5
43
|
### [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)
|
|
6
44
|
|
|
7
45
|
### [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
|
package/configuration.json
CHANGED
|
@@ -10,6 +10,43 @@
|
|
|
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
|
+
},
|
|
13
50
|
{
|
|
14
51
|
"type": "switch",
|
|
15
52
|
"id": "titleEnabled",
|
|
@@ -96,14 +133,21 @@
|
|
|
96
133
|
"type": "text-input",
|
|
97
134
|
"required": false,
|
|
98
135
|
"label": "Ancho columna fecha partido",
|
|
99
|
-
"description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
|
|
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"
|
|
100
143
|
},
|
|
101
144
|
{
|
|
102
145
|
"id": "widthStatus",
|
|
103
146
|
"type": "text-input",
|
|
104
147
|
"required": false,
|
|
105
148
|
"label": "Ancho columna Status Partido",
|
|
106
|
-
"description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
|
|
149
|
+
"description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)",
|
|
150
|
+
"defaultValue":"200px"
|
|
107
151
|
},
|
|
108
152
|
{
|
|
109
153
|
"type": "text-format",
|
|
@@ -115,7 +159,8 @@
|
|
|
115
159
|
"type": "text-input",
|
|
116
160
|
"required": false,
|
|
117
161
|
"label": "Ancho columna Goles",
|
|
118
|
-
"description": "Agregar en px, ejemplo 100px. (Por defecto son 100px)"
|
|
162
|
+
"description": "Agregar en px, ejemplo 100px. (Por defecto son 100px)",
|
|
163
|
+
"defaultValue":"200px"
|
|
119
164
|
},
|
|
120
165
|
{
|
|
121
166
|
"type": "switch",
|
|
@@ -135,7 +180,8 @@
|
|
|
135
180
|
"required": false,
|
|
136
181
|
"label": "Ancho columna Nombre Equipo",
|
|
137
182
|
"show": "{{descriptionEnabled}} === true",
|
|
138
|
-
"description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)"
|
|
183
|
+
"description": "Agregar en px, ejemplo 100px. (Por defecto son 200px)",
|
|
184
|
+
"defaultValue":"200px"
|
|
139
185
|
},
|
|
140
186
|
{
|
|
141
187
|
"type": "label",
|
|
@@ -153,7 +199,8 @@
|
|
|
153
199
|
"type": "text-input",
|
|
154
200
|
"required": false,
|
|
155
201
|
"label": "Ancho columna Bandera",
|
|
156
|
-
"description": "Agregar en px, ejemplo 100px. (Por defecto son 300px)"
|
|
202
|
+
"description": "Agregar en px, ejemplo 100px. (Por defecto son 300px)",
|
|
203
|
+
"defaultValue":"300px"
|
|
157
204
|
}
|
|
158
205
|
]
|
|
159
206
|
}
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -10,7 +10,7 @@ type Props = {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const App = ({ data, start }: Props) => {
|
|
13
|
-
|
|
13
|
+
const [dataFixture, setDataFixture] = useState([]);
|
|
14
14
|
|
|
15
15
|
const { configureState, addConfiguration } = useContext(ConfigureContext)
|
|
16
16
|
|
|
@@ -19,8 +19,10 @@ export const App = ({ data, start }: Props) => {
|
|
|
19
19
|
const { backgroundImage,
|
|
20
20
|
padding,
|
|
21
21
|
msj0 = '',
|
|
22
|
+
updateTime
|
|
22
23
|
} = parameters
|
|
23
|
-
|
|
24
|
+
console.log("🚀 ~ file: App.tsx ~ line 24 ~ App ~ updateTime", updateTime)
|
|
25
|
+
|
|
24
26
|
let backgroundImageState = backgroundImage && backgroundImage.filename
|
|
25
27
|
? `url("${downloadsPath}/${backgroundImage.filename}")`
|
|
26
28
|
: ''
|
|
@@ -30,19 +32,20 @@ export const App = ({ data, start }: Props) => {
|
|
|
30
32
|
setDataFixture(data);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
//Request data every 5 minutes
|
|
34
|
-
// useEffect(() => {
|
|
35
|
-
// const interval = setInterval(() => {
|
|
36
|
-
// if (start) getData()
|
|
37
|
-
// }, 300000)
|
|
38
|
-
// return () => clearInterval(interval)
|
|
39
|
-
// }, [])
|
|
40
35
|
|
|
41
36
|
useEffect(() => {
|
|
37
|
+
console.log('entro aquí')
|
|
42
38
|
if (start) getData()
|
|
43
39
|
addConfiguration(data)
|
|
44
40
|
}, [data])
|
|
45
41
|
|
|
42
|
+
//Request data every 5 minutes
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const interval = setInterval(() => {
|
|
45
|
+
getData()
|
|
46
|
+
}, updateTime || 300000)
|
|
47
|
+
return () => clearInterval(interval)
|
|
48
|
+
}, [updateTime])
|
|
46
49
|
|
|
47
50
|
|
|
48
51
|
|
|
@@ -60,7 +63,7 @@ export const App = ({ data, start }: Props) => {
|
|
|
60
63
|
padding: padding
|
|
61
64
|
}}
|
|
62
65
|
>
|
|
63
|
-
<FontLoader paths={['nameFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
|
|
66
|
+
<FontLoader paths={['nameFormat.font','statusFormat.font', 'timeFormat.font','titleFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'goalsFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
|
|
64
67
|
{
|
|
65
68
|
parameters.titleEnabled &&
|
|
66
69
|
<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
|
|
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,16 +1,19 @@
|
|
|
1
|
-
import React, { useContext } from 'react'
|
|
1
|
+
import React, { useContext, useEffect, useState } from 'react'
|
|
2
2
|
// import { TeamItems } from './TeamItems'
|
|
3
|
-
import { Results } from './Results';
|
|
4
3
|
import { Time } from './Time';
|
|
5
4
|
import { FormattedText } from '../FormattedText';
|
|
6
5
|
import { ConfigureContext } from '../../contex/configureContext/ConfigureContext';
|
|
7
6
|
import { Status } from './Status';
|
|
7
|
+
import { translateTeams } from '../../helpers/translateTeams';
|
|
8
|
+
import { Results } from './Results';
|
|
8
9
|
|
|
9
10
|
export const Row = (item: any) => {
|
|
10
11
|
|
|
11
12
|
const { fixture, teams, goals } = item.item;
|
|
12
13
|
const { configureState } = useContext(ConfigureContext)
|
|
13
14
|
const { parameters } = configureState
|
|
15
|
+
const [homeTeam, setHomeTeam] = useState(false);
|
|
16
|
+
const [awayTeam, setAwayTeam] = useState(false);
|
|
14
17
|
|
|
15
18
|
const {
|
|
16
19
|
descriptionEnabled,
|
|
@@ -25,8 +28,42 @@ export const Row = (item: any) => {
|
|
|
25
28
|
widthTime,
|
|
26
29
|
} = parameters
|
|
27
30
|
|
|
28
|
-
let gridColumns = descriptionEnabled ? `${widthTime} ${widthStatus} ${widthDescription} ${widthImage} ${widthScore} ${widthImage} ${widthDescription}` :
|
|
29
|
-
` ${widthTime} ${widthStatus} ${widthImage} ${widthScore} ${widthImage}`
|
|
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
|
+
}, [])
|
|
30
67
|
|
|
31
68
|
|
|
32
69
|
return (
|
|
@@ -34,17 +71,35 @@ export const Row = (item: any) => {
|
|
|
34
71
|
style={{
|
|
35
72
|
display: 'grid',
|
|
36
73
|
gridTemplateColumns: `${gridColumns}`,
|
|
37
|
-
columnGap: `${columnGap}`,
|
|
74
|
+
columnGap: `${columnGap || "10px"}`,
|
|
38
75
|
width: '100%',
|
|
76
|
+
height: '100%',
|
|
39
77
|
alignItems: 'center',
|
|
40
78
|
placeContent: 'center',
|
|
41
|
-
padding: `${rowGap} 0px`,
|
|
79
|
+
padding: `${rowGap || "30px"} 0px`,
|
|
42
80
|
justifyContent: 'center'
|
|
43
81
|
}}
|
|
44
82
|
>
|
|
45
|
-
<
|
|
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>
|
|
46
102
|
|
|
47
|
-
<Status status={fixture.status.short} />
|
|
48
103
|
|
|
49
104
|
|
|
50
105
|
{
|
|
@@ -52,29 +107,54 @@ export const Row = (item: any) => {
|
|
|
52
107
|
<div style={{
|
|
53
108
|
display: 'flex',
|
|
54
109
|
justifyContent: 'flex-end',
|
|
110
|
+
marginRight: '10px'
|
|
55
111
|
}}>
|
|
56
|
-
<FormattedText text={
|
|
112
|
+
<FormattedText text={nameHome} format={descriptionFormat} />
|
|
57
113
|
</div>
|
|
58
114
|
}
|
|
59
115
|
<div style={{
|
|
60
116
|
display: 'flex',
|
|
61
117
|
justifyContent: 'center',
|
|
118
|
+
width: '100%',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
marginLeft: '5px'
|
|
62
121
|
}}>
|
|
63
|
-
|
|
122
|
+
{
|
|
123
|
+
homeTeam ?
|
|
124
|
+
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.home.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} /> :
|
|
125
|
+
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
126
|
+
|
|
127
|
+
}
|
|
64
128
|
</div>
|
|
65
129
|
|
|
66
130
|
<Results goals={goals} />
|
|
131
|
+
|
|
67
132
|
<div
|
|
68
133
|
style={{
|
|
69
134
|
display: 'flex',
|
|
70
|
-
justifyContent: '
|
|
135
|
+
justifyContent: 'flex-start',
|
|
136
|
+
width: '100%',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
marginRight: '5px'
|
|
71
139
|
}}
|
|
72
140
|
>
|
|
73
|
-
|
|
141
|
+
{
|
|
142
|
+
awayTeam ?
|
|
143
|
+
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.away.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
144
|
+
: <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
145
|
+
}
|
|
74
146
|
</div>
|
|
75
147
|
{
|
|
76
148
|
descriptionEnabled &&
|
|
77
|
-
<
|
|
149
|
+
<div
|
|
150
|
+
style={{
|
|
151
|
+
display: 'flex',
|
|
152
|
+
justifyContent: 'flex-start',
|
|
153
|
+
marginLeft: '10px',
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<FormattedText text={nameAway} format={descriptionFormat} />
|
|
157
|
+
</div>
|
|
78
158
|
}
|
|
79
159
|
</div >
|
|
80
160
|
)
|
|
@@ -9,14 +9,26 @@ 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
|
|
17
26
|
case 'FT':
|
|
18
27
|
translateStatus = 'Finalizado'
|
|
19
28
|
break
|
|
29
|
+
case 'P':
|
|
30
|
+
translateStatus = 'Penales'
|
|
31
|
+
break
|
|
20
32
|
case 'LIVE':
|
|
21
33
|
translateStatus = 'En vivo'
|
|
22
34
|
break
|
|
@@ -50,20 +50,20 @@ const INITIAL_STATE: VixonicData = {
|
|
|
50
50
|
template: "",
|
|
51
51
|
textAlignment: "center",
|
|
52
52
|
textPosition: 0,
|
|
53
|
-
updateTime:
|
|
53
|
+
updateTime: 300000,
|
|
54
54
|
urlBaseApi: "",
|
|
55
55
|
imageMargin: "",
|
|
56
56
|
textMargin: "",
|
|
57
57
|
dateMargin: "",
|
|
58
58
|
separator: false,
|
|
59
59
|
widthDescription: "200px",
|
|
60
|
-
widthImage: "
|
|
60
|
+
widthImage: "300px",
|
|
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 {
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import moment from 'moment';
|
|
2
2
|
const axios = require("axios");
|
|
3
3
|
|
|
4
4
|
export const getFixture = async () => {
|
|
5
5
|
|
|
6
|
-
|
|
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:
|
|
12
|
+
params: { date: `${today}`, 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
|
-
|
|
19
|
-
|
|
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
|
+
|
|
20
26
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
}
|
package/src/parameters.d.ts
CHANGED
package/src/test/parameters.json
CHANGED
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
"urlBaseApi": "mandomedio",
|
|
4
4
|
"msj0": "No hay partidos",
|
|
5
5
|
"statusEnabled": true,
|
|
6
|
-
"
|
|
7
|
-
"widthImage": "300px",
|
|
8
|
-
"widthScore": "100px",
|
|
6
|
+
"timeRequest":60000,
|
|
9
7
|
"rowGap":"30px",
|
|
10
8
|
"columnGap":"10px",
|
|
11
|
-
"widthStatus": "200px",
|
|
12
|
-
"widthTime": "200px",
|
|
13
9
|
"padding": "30px 25px 80px 40px",
|
|
14
10
|
"dataMode": "monthly",
|
|
15
11
|
"template": "standard",
|