@vixoniccom/footbal-score 1.0.1-beta.7 → 1.0.1-beta.9
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 +6 -0
- package/build.zip +0 -0
- package/configuration.json +36 -8
- package/package.json +1 -1
- package/src/App.tsx +12 -13
- package/src/components/table-fixture/Results.tsx +1 -2
- package/src/components/table-fixture/Row.tsx +8 -3
- package/src/contex/configureContext/ConfigureProvider.tsx +2 -3
- package/src/contex/configureContext/configureReducer.ts +1 -2
- package/src/helpers/getFixture.ts +8 -2
- package/src/helpers/translateTeams.ts +89 -0
- package/src/parameters.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.9](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.8...v1.0.1-beta.9) (2022-11-21)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
9
|
+
### [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)
|
|
10
|
+
|
|
5
11
|
### [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)
|
|
6
12
|
|
|
7
13
|
### [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)
|
package/build.zip
CHANGED
|
Binary file
|
package/configuration.json
CHANGED
|
@@ -11,14 +11,42 @@
|
|
|
11
11
|
"label": "Datos"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
},
|
|
22
50
|
{
|
|
23
51
|
"type": "switch",
|
|
24
52
|
"id": "titleEnabled",
|
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,34 +19,33 @@ export const App = ({ data, start }: Props) => {
|
|
|
19
19
|
const { backgroundImage,
|
|
20
20
|
padding,
|
|
21
21
|
msj0 = '',
|
|
22
|
-
|
|
22
|
+
updateTime
|
|
23
23
|
} = parameters
|
|
24
|
-
console.log("🚀 ~ file: App.tsx ~ line 24 ~ App ~
|
|
25
|
-
|
|
24
|
+
console.log("🚀 ~ file: App.tsx ~ line 24 ~ App ~ updateTime", updateTime)
|
|
25
|
+
|
|
26
26
|
let backgroundImageState = backgroundImage && backgroundImage.filename
|
|
27
27
|
? `url("${downloadsPath}/${backgroundImage.filename}")`
|
|
28
28
|
: ''
|
|
29
29
|
|
|
30
30
|
const getData = async () => {
|
|
31
31
|
const data = await getFixture();
|
|
32
|
-
console.log("🚀 ~ file: App.tsx ~ line 32 ~ getData ~ data", data)
|
|
33
32
|
setDataFixture(data);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
//Request data every 5 minutes
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
const interval = setInterval(() => {
|
|
39
|
-
console.log('start', start)
|
|
40
|
-
if (start) getData()
|
|
41
|
-
}, timeRequest || 60000)
|
|
42
|
-
return () => clearInterval(interval)
|
|
43
|
-
}, [timeRequest])
|
|
44
35
|
|
|
45
36
|
useEffect(() => {
|
|
37
|
+
console.log('entro aquí')
|
|
46
38
|
if (start) getData()
|
|
47
39
|
addConfiguration(data)
|
|
48
40
|
}, [data])
|
|
49
41
|
|
|
42
|
+
//Request data every 5 minutes
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const interval = setInterval(() => {
|
|
45
|
+
getData()
|
|
46
|
+
}, updateTime || 300000)
|
|
47
|
+
return () => clearInterval(interval)
|
|
48
|
+
}, [updateTime])
|
|
50
49
|
|
|
51
50
|
|
|
52
51
|
|
|
@@ -6,8 +6,7 @@ export const Results = (goals: any) => {
|
|
|
6
6
|
|
|
7
7
|
const { configureState } = useContext(ConfigureContext)
|
|
8
8
|
const { parameters } = configureState
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
|
|
11
10
|
|
|
12
11
|
return (
|
|
13
12
|
<div style={{
|
|
@@ -4,6 +4,7 @@ import { Time } from './Time';
|
|
|
4
4
|
import { FormattedText } from '../FormattedText';
|
|
5
5
|
import { ConfigureContext } from '../../contex/configureContext/ConfigureContext';
|
|
6
6
|
import { Status } from './Status';
|
|
7
|
+
import { translateTeams } from '../../helpers/translateTeams';
|
|
7
8
|
|
|
8
9
|
export const Row = (item: any) => {
|
|
9
10
|
|
|
@@ -22,12 +23,16 @@ export const Row = (item: any) => {
|
|
|
22
23
|
rowGap,
|
|
23
24
|
widthStatus,
|
|
24
25
|
widthTime,
|
|
25
|
-
goalsFormat
|
|
26
|
+
goalsFormat
|
|
26
27
|
} = parameters
|
|
28
|
+
console.log("🚀 ~ file: Row.tsx ~ line 28 ~ Row ~ descriptionFormat", descriptionFormat)
|
|
29
|
+
console.log("🚀 ~ file: Row.tsx ~ line 28 ~ Row ~ goalsFormat", goalsFormat)
|
|
27
30
|
|
|
28
31
|
let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
|
|
29
32
|
` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
|
|
30
33
|
|
|
34
|
+
let nameHome = translateTeams(teams.home.name)
|
|
35
|
+
let nameAway = translateTeams(teams.away.name)
|
|
31
36
|
|
|
32
37
|
return (
|
|
33
38
|
<div
|
|
@@ -53,7 +58,7 @@ export const Row = (item: any) => {
|
|
|
53
58
|
display: 'flex',
|
|
54
59
|
justifyContent: 'flex-end',
|
|
55
60
|
}}>
|
|
56
|
-
<FormattedText text={
|
|
61
|
+
<FormattedText text={nameHome} format={descriptionFormat} />
|
|
57
62
|
</div>
|
|
58
63
|
}
|
|
59
64
|
<div style={{
|
|
@@ -82,7 +87,7 @@ export const Row = (item: any) => {
|
|
|
82
87
|
</div>
|
|
83
88
|
{
|
|
84
89
|
descriptionEnabled &&
|
|
85
|
-
<FormattedText text={
|
|
90
|
+
<FormattedText text={nameAway} format={descriptionFormat} />
|
|
86
91
|
}
|
|
87
92
|
</div >
|
|
88
93
|
)
|
|
@@ -50,7 +50,7 @@ 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: "",
|
|
@@ -63,8 +63,7 @@ const INITIAL_STATE: VixonicData = {
|
|
|
63
63
|
rowGap: "30px",
|
|
64
64
|
widthStatus: "200px",
|
|
65
65
|
widthTime: "200px",
|
|
66
|
-
|
|
67
|
-
}
|
|
66
|
+
}
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
interface props {
|
|
@@ -51,8 +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
|
-
|
|
55
|
-
}
|
|
54
|
+
}
|
|
56
55
|
}
|
|
57
56
|
default:
|
|
58
57
|
return state;
|
|
@@ -15,6 +15,12 @@ export const getFixture = async () => {
|
|
|
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,89 @@
|
|
|
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
|
+
default:
|
|
87
|
+
return team
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/parameters.d.ts
CHANGED