@vixoniccom/footbal-score 1.0.1-beta.16 → 1.0.1-beta.18
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 +4 -0
- package/build.zip +0 -0
- package/package.json +1 -1
- package/src/components/table-fixture/Row.tsx +56 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.18](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.1-beta.17...v1.0.1-beta.18) (2022-11-23)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
5
9
|
### [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)
|
|
6
10
|
|
|
7
11
|
### [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)
|
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
@@ -12,6 +12,8 @@ export const Row = (item: any) => {
|
|
|
12
12
|
const { fixture, teams, goals } = item.item;
|
|
13
13
|
const { configureState } = useContext(ConfigureContext)
|
|
14
14
|
const { parameters } = configureState
|
|
15
|
+
const [homeTeam, setHomeTeam] = useState(false);
|
|
16
|
+
const [awayTeam, setAwayTeam] = useState(false);
|
|
15
17
|
|
|
16
18
|
const {
|
|
17
19
|
descriptionEnabled,
|
|
@@ -25,14 +27,44 @@ export const Row = (item: any) => {
|
|
|
25
27
|
widthStatus,
|
|
26
28
|
widthTime,
|
|
27
29
|
} = parameters
|
|
28
|
-
|
|
30
|
+
|
|
29
31
|
let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
|
|
30
32
|
` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
|
|
31
33
|
|
|
32
34
|
let nameHome = translateTeams(teams.home.name)
|
|
33
35
|
let nameAway = translateTeams(teams.away.name)
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
|
|
36
68
|
|
|
37
69
|
return (
|
|
38
70
|
<div
|
|
@@ -58,6 +90,8 @@ export const Row = (item: any) => {
|
|
|
58
90
|
<div style={{
|
|
59
91
|
display: 'flex',
|
|
60
92
|
justifyContent: 'flex-end',
|
|
93
|
+
minWidth: '150px',
|
|
94
|
+
marginRight: '5px'
|
|
61
95
|
}}>
|
|
62
96
|
<FormattedText text={nameHome} format={descriptionFormat} />
|
|
63
97
|
</div>
|
|
@@ -67,10 +101,11 @@ export const Row = (item: any) => {
|
|
|
67
101
|
justifyContent: 'center',
|
|
68
102
|
width: '100%',
|
|
69
103
|
alignItems: 'center',
|
|
104
|
+
marginLeft: '5px'
|
|
70
105
|
}}>
|
|
71
106
|
{
|
|
72
|
-
|
|
73
|
-
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${
|
|
107
|
+
homeTeam ?
|
|
108
|
+
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.home.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />:
|
|
74
109
|
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
75
110
|
|
|
76
111
|
}
|
|
@@ -81,20 +116,30 @@ export const Row = (item: any) => {
|
|
|
81
116
|
<div
|
|
82
117
|
style={{
|
|
83
118
|
display: 'flex',
|
|
84
|
-
justifyContent: '
|
|
119
|
+
justifyContent: 'flex-start',
|
|
85
120
|
width: '100%',
|
|
86
|
-
alignItems: 'center'
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
marginRight: '5px'
|
|
87
123
|
}}
|
|
88
124
|
>
|
|
89
125
|
{
|
|
90
|
-
|
|
91
|
-
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${
|
|
126
|
+
awayTeam ?
|
|
127
|
+
<img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.away.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
92
128
|
: <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
|
|
93
129
|
}
|
|
94
130
|
</div>
|
|
95
131
|
{
|
|
96
132
|
descriptionEnabled &&
|
|
97
|
-
<
|
|
133
|
+
<div
|
|
134
|
+
style={{
|
|
135
|
+
display: 'flex',
|
|
136
|
+
justifyContent: 'flex-start',
|
|
137
|
+
marginLeft: '10px',
|
|
138
|
+
minWidth: '150px'
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<FormattedText text={nameAway} format={descriptionFormat} />
|
|
142
|
+
</div>
|
|
98
143
|
}
|
|
99
144
|
</div >
|
|
100
145
|
)
|