@vixoniccom/footbal-score 1.0.1-beta.9 β†’ 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,30 @@
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
+
5
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)
6
30
 
7
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)
package/build.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/footbal-score",
3
3
  "alias": "Resultados Deportivos",
4
- "version": "1.0.1-beta.9",
4
+ "version": "1.0.1",
5
5
  "description": "Muestra resultados en vivo de fΓΊtbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
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 Results = (goals: any) => {
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,
@@ -23,17 +26,46 @@ export const Row = (item: any) => {
23
26
  rowGap,
24
27
  widthStatus,
25
28
  widthTime,
26
- goalsFormat
27
29
  } = parameters
28
- console.log("πŸš€ ~ file: Row.tsx ~ line 28 ~ Row ~ descriptionFormat", descriptionFormat)
29
- console.log("πŸš€ ~ file: Row.tsx ~ line 28 ~ Row ~ goalsFormat", goalsFormat)
30
30
 
31
31
  let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
32
32
  ` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
33
33
 
34
- let nameHome = translateTeams(teams.home.name)
34
+ let nameHome = translateTeams(teams.home.name)
35
35
  let nameAway = translateTeams(teams.away.name)
36
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
+
37
69
  return (
38
70
  <div
39
71
  style={{
@@ -41,15 +73,33 @@ export const Row = (item: any) => {
41
73
  gridTemplateColumns: `${gridColumns}`,
42
74
  columnGap: `${columnGap || "10px"}`,
43
75
  width: '100%',
76
+ height: '100%',
44
77
  alignItems: 'center',
45
78
  placeContent: 'center',
46
79
  padding: `${rowGap || "30px"} 0px`,
47
80
  justifyContent: 'center'
48
81
  }}
49
82
  >
50
- <Time time={Number(fixture.timestamp)} />
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>
51
102
 
52
- <Status status={fixture.status.short} />
53
103
 
54
104
 
55
105
  {
@@ -57,6 +107,7 @@ export const Row = (item: any) => {
57
107
  <div style={{
58
108
  display: 'flex',
59
109
  justifyContent: 'flex-end',
110
+ marginRight: '10px'
60
111
  }}>
61
112
  <FormattedText text={nameHome} format={descriptionFormat} />
62
113
  </div>
@@ -64,30 +115,46 @@ export const Row = (item: any) => {
64
115
  <div style={{
65
116
  display: 'flex',
66
117
  justifyContent: 'center',
118
+ width: '100%',
119
+ alignItems: 'center',
120
+ marginLeft: '5px'
67
121
  }}>
68
- <img src={teams.home.logo} style={{ width: `${imageSize}%` }} />
69
- </div>
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' }} />
70
126
 
71
- <div style={{
72
- display: 'flex',
73
- justifyContent: 'center',
74
- }}>
75
- <FormattedText text={goals.home ? goals.home : 0} format={goalsFormat} />
76
- <FormattedText text={"-"} format={goalsFormat} />
77
- <FormattedText text={goals.away ? goals.away : 0} format={goalsFormat} />
127
+ }
78
128
  </div>
79
129
 
130
+ <Results goals={goals} />
131
+
80
132
  <div
81
133
  style={{
82
134
  display: 'flex',
83
- justifyContent: 'center',
135
+ justifyContent: 'flex-start',
136
+ width: '100%',
137
+ alignItems: 'center',
138
+ marginRight: '5px'
84
139
  }}
85
140
  >
86
- <img src={teams.away.logo} style={{ width: `${imageSize}%` }} />
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
+ }
87
146
  </div>
88
147
  {
89
148
  descriptionEnabled &&
90
- <FormattedText text={nameAway} format={descriptionFormat} />
149
+ <div
150
+ style={{
151
+ display: 'flex',
152
+ justifyContent: 'flex-start',
153
+ marginLeft: '10px',
154
+ }}
155
+ >
156
+ <FormattedText text={nameAway} format={descriptionFormat} />
157
+ </div>
91
158
  }
92
159
  </div >
93
160
  )
@@ -1,15 +1,15 @@
1
- // import moment from 'moment';
1
+ import moment from 'moment';
2
2
  const axios = require("axios");
3
3
 
4
4
  export const getFixture = async () => {
5
5
 
6
- // const today = moment().format('YYYY-MM-DD')
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: '2022-11-21', league: '1', season: '2022' },
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'
@@ -83,6 +83,8 @@ export const translateTeams = (team: string) => {
83
83
  return 'Ghana'
84
84
  case 'South Korea':
85
85
  return 'Corea del Sur'
86
+ case 'Saudi Arabia':
87
+ return 'Arabia Saudita'
86
88
  default:
87
89
  return team
88
90
  }