@vixoniccom/footbal-score 1.4.0-dev.2 → 1.4.0-dev.4
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/.github/workflows/npm-publish.yml +112 -0
- package/CHANGELOG.md +9 -0
- package/build/main.js +1 -1
- package/build/test/parameters.json +2 -1
- package/build.zip +0 -0
- package/package.json +2 -3
- package/src/App.tsx +8 -8
- package/src/components/Table/components/Time.tsx +1 -1
- package/src/style.css +1 -1
- package/src/test/parameters.json +2 -1
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixoniccom/footbal-score",
|
|
3
3
|
"alias": "Resultados Deportivos",
|
|
4
|
-
"version": "1.4.0-dev.
|
|
4
|
+
"version": "1.4.0-dev.4",
|
|
5
5
|
"description": "Muestra resultados en vivo de fútbol.",
|
|
6
6
|
"main": "main.js",
|
|
7
7
|
"author": "",
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
10
|
+
"prepublish": "vixonic-module-packager --mode=build",
|
|
11
11
|
"watch": "vixonic-module-packager --mode=watch",
|
|
12
12
|
"run": "vixonic-module-packager --mode=run",
|
|
13
13
|
"configuration": "vixonic-module-packager --mode generate-configuration",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"react-dom": "^18.3.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "^12.20.37",
|
|
28
27
|
"@types/react": "^18.3.23",
|
|
29
28
|
"@types/react-dom": "^18.3.7",
|
|
30
29
|
"@vixoniccom/module-packager": "^2.13.0-dev.1",
|
package/src/App.tsx
CHANGED
|
@@ -11,9 +11,9 @@ export type Props = {
|
|
|
11
11
|
|
|
12
12
|
export const App: React.FunctionComponent<Props> = ({ data, start }) => {
|
|
13
13
|
const [dataFixture, setDataFixture] = useState<any[]>([])
|
|
14
|
-
const [
|
|
14
|
+
const [leagueState, setLeagueState] = useState<string>('')
|
|
15
15
|
const { parameters, downloadsPath } = data
|
|
16
|
-
const { backgroundImage, padding, msj0 = '', updateTime } = parameters
|
|
16
|
+
const { backgroundImage, padding, msj0 = '', updateTime = 300000, league = '9' } = parameters
|
|
17
17
|
const backgroundImageState = backgroundImage?.filename
|
|
18
18
|
? `url("${downloadsPath}/${backgroundImage.filename}")`
|
|
19
19
|
: ''
|
|
@@ -27,7 +27,7 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
|
|
|
27
27
|
const endTime = moment(parameters.timeEnd, 'h:mma')
|
|
28
28
|
|
|
29
29
|
if (momentLocalStorage == undefined || (timeNow.isBetween(startTime, endTime) && momentLocalStorage > updateTime!)) {
|
|
30
|
-
const dataRequest = await getFixture(
|
|
30
|
+
const dataRequest = await getFixture(league, parameters.matchesYesterday, parameters.matchesTomorrow)
|
|
31
31
|
setDataLocal(dataRequest)
|
|
32
32
|
setDataFixture(dataRequest)
|
|
33
33
|
} else {
|
|
@@ -37,24 +37,24 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
|
|
|
37
37
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
if (start) {
|
|
40
|
-
|
|
40
|
+
setLeagueState(league)
|
|
41
41
|
getData()
|
|
42
42
|
}
|
|
43
43
|
}, [data])
|
|
44
44
|
|
|
45
45
|
useEffect(() => {
|
|
46
|
-
if (
|
|
47
|
-
|
|
46
|
+
if (leagueState !== league) {
|
|
47
|
+
setLeagueState(league)
|
|
48
48
|
localforage.clear()
|
|
49
49
|
getData()
|
|
50
50
|
}
|
|
51
|
-
}, [
|
|
51
|
+
}, [league])
|
|
52
52
|
|
|
53
53
|
//Request data every 5 minutes
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
const interval = setInterval(() => {
|
|
56
56
|
getData()
|
|
57
|
-
}, updateTime
|
|
57
|
+
}, updateTime)
|
|
58
58
|
return () => clearInterval(interval)
|
|
59
59
|
}, [updateTime, data])
|
|
60
60
|
|
|
@@ -9,7 +9,7 @@ interface Props {
|
|
|
9
9
|
|
|
10
10
|
export const Time: React.FunctionComponent<Props> = ({ time, parameters }) => {
|
|
11
11
|
return (
|
|
12
|
-
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center'
|
|
12
|
+
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
|
|
13
13
|
<FormattedText text={moment.unix(time).format('DD-MM')} format={parameters.timeFormat} />
|
|
14
14
|
<FormattedText text={moment.unix(time).format('h:mm a')} format={parameters.timeFormat} />
|
|
15
15
|
</div>
|
package/src/style.css
CHANGED