@vixoniccom/footbal-score 1.0.1-beta.8 → 1.0.1
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,6 +2,32 @@
|
|
|
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](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.20...v1.0.1) (2022-11-24)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
9
|
+
### [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)
|
|
10
|
+
|
|
11
|
+
### [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)
|
|
12
|
+
|
|
13
|
+
### [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)
|
|
14
|
+
|
|
15
|
+
### [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)
|
|
16
|
+
|
|
17
|
+
### [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)
|
|
18
|
+
|
|
19
|
+
### [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)
|
|
20
|
+
|
|
21
|
+
### [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)
|
|
22
|
+
|
|
23
|
+
### [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)
|
|
24
|
+
|
|
25
|
+
### [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)
|
|
26
|
+
|
|
27
|
+
### [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)
|
|
28
|
+
|
|
29
|
+
### [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)
|
|
30
|
+
|
|
5
31
|
### [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)
|
|
6
32
|
|
|
7
33
|
### [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)
|
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -63,7 +63,7 @@ export const App = ({ data, start }: Props) => {
|
|
|
63
63
|
padding: padding
|
|
64
64
|
}}
|
|
65
65
|
>
|
|
66
|
-
<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} />
|
|
67
67
|
{
|
|
68
68
|
parameters.titleEnabled &&
|
|
69
69
|
<div style={{
|
|
@@ -2,7 +2,7 @@ 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
|
|
@@ -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
3
|
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
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,
|
|
@@ -22,15 +25,47 @@ export const Row = (item: any) => {
|
|
|
22
25
|
columnGap,
|
|
23
26
|
rowGap,
|
|
24
27
|
widthStatus,
|
|
25
|
-
widthTime
|
|
28
|
+
widthTime,
|
|
26
29
|
} = parameters
|
|
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
|
|
|
31
|
-
let nameHome = translateTeams(teams.home.name)
|
|
34
|
+
let nameHome = translateTeams(teams.home.name)
|
|
32
35
|
let nameAway = translateTeams(teams.away.name)
|
|
33
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
|
+
}, [])
|
|
67
|
+
|
|
68
|
+
|
|
34
69
|
return (
|
|
35
70
|
<div
|
|
36
71
|
style={{
|
|
@@ -38,15 +73,33 @@ export const Row = (item: any) => {
|
|
|
38
73
|
gridTemplateColumns: `${gridColumns}`,
|
|
39
74
|
columnGap: `${columnGap || "10px"}`,
|
|
40
75
|
width: '100%',
|
|
76
|
+
height: '100%',
|
|
41
77
|
alignItems: 'center',
|
|
42
78
|
placeContent: 'center',
|
|
43
79
|
padding: `${rowGap || "30px"} 0px`,
|
|
44
80
|
justifyContent: 'center'
|
|
45
81
|
}}
|
|
46
82
|
>
|
|
47
|
-
<
|
|
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>
|
|
48
102
|
|
|
49
|
-
<Status status={fixture.status.short} />
|
|
50
103
|
|
|
51
104
|
|
|
52
105
|
{
|
|
@@ -54,6 +107,7 @@ export const Row = (item: any) => {
|
|
|
54
107
|
<div style={{
|
|
55
108
|
display: 'flex',
|
|
56
109
|
justifyContent: 'flex-end',
|
|
110
|
+
marginRight: '10px'
|
|
57
111
|
}}>
|
|
58
112
|
<FormattedText text={nameHome} format={descriptionFormat} />
|
|
59
113
|
</div>
|
|
@@ -61,30 +115,46 @@ export const Row = (item: any) => {
|
|
|
61
115
|
<div style={{
|
|
62
116
|
display: 'flex',
|
|
63
117
|
justifyContent: 'center',
|
|
118
|
+
width: '100%',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
marginLeft: '5px'
|
|
64
121
|
}}>
|
|
65
|
-
|
|
66
|
-
|
|
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' }} />
|
|
67
126
|
|
|
68
|
-
|
|
69
|
-
display: 'flex',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
}}>
|
|
72
|
-
<FormattedText text={goals.home ? goals.home : 0} format={descriptionFormat} />
|
|
73
|
-
<FormattedText text={"-"} format={descriptionFormat} />
|
|
74
|
-
<FormattedText text={goals.away ? goals.away : 0} format={descriptionFormat} />
|
|
127
|
+
}
|
|
75
128
|
</div>
|
|
76
129
|
|
|
130
|
+
<Results goals={goals} />
|
|
131
|
+
|
|
77
132
|
<div
|
|
78
133
|
style={{
|
|
79
134
|
display: 'flex',
|
|
80
|
-
justifyContent: '
|
|
135
|
+
justifyContent: 'flex-start',
|
|
136
|
+
width: '100%',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
marginRight: '5px'
|
|
81
139
|
}}
|
|
82
140
|
>
|
|
83
|
-
|
|
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
|
+
}
|
|
84
146
|
</div>
|
|
85
147
|
{
|
|
86
148
|
descriptionEnabled &&
|
|
87
|
-
<
|
|
149
|
+
<div
|
|
150
|
+
style={{
|
|
151
|
+
display: 'flex',
|
|
152
|
+
justifyContent: 'flex-start',
|
|
153
|
+
marginLeft: '10px',
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<FormattedText text={nameAway} format={descriptionFormat} />
|
|
157
|
+
</div>
|
|
88
158
|
}
|
|
89
159
|
</div >
|
|
90
160
|
)
|
|
@@ -1,15 +1,15 @@
|
|
|
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'
|