@vixoniccom/footbal-score 1.0.2-beta.4 → 1.0.3-beta.0

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,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.3-beta.0](https://bitbucket.org/vixonic_dev/football-score/compare/v1.0.2...v1.0.3-beta.0) (2024-04-30)
6
+
7
+ ### [1.0.2](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.2-beta.4...v1.0.2) (2022-12-07)
8
+
5
9
  ### [1.0.2-beta.4](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.2-beta.3...v1.0.2-beta.4) (2022-12-07)
6
10
 
7
11
  ### [1.0.2-beta.3](https://gitlab.com/mandomedio/vixonic/football-score/compare/v1.0.2-beta.2...v1.0.2-beta.3) (2022-12-06)
package/build.zip CHANGED
Binary file
@@ -10,6 +10,23 @@
10
10
  "type": "label",
11
11
  "label": "Datos"
12
12
  },
13
+ {
14
+ "id": "league",
15
+ "type": "select-input",
16
+ "required": true,
17
+ "label": "Competencia",
18
+ "defaultValue": "9",
19
+ "items": [
20
+ {
21
+ "label": "Mundial",
22
+ "value": "1"
23
+ },
24
+ {
25
+ "label": "Copa América",
26
+ "value": "9"
27
+ }
28
+ ]
29
+ },
13
30
  {
14
31
  "id": "timeStart",
15
32
  "type": "select-input",
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.2-beta.4",
4
+ "version": "1.0.3-beta.0",
5
5
  "description": "Muestra resultados en vivo de fútbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
package/src/App.tsx CHANGED
@@ -16,6 +16,7 @@ export const App = ({ data, start }: Props) => {
16
16
 
17
17
 
18
18
  const [dataFixture, setDataFixture] = useState([]);
19
+ const [league, setLeague] = useState('');
19
20
 
20
21
  const { configureState, addConfiguration } = useContext(ConfigureContext)
21
22
 
@@ -39,9 +40,9 @@ export const App = ({ data, start }: Props) => {
39
40
  let horaInicio = moment(data.parameters.timeStart, 'h:mma');
40
41
  let horaFin = moment(data.parameters.timeEnd, 'h:mma');
41
42
  if (momentLocalStorage == undefined || (timeNow.isBetween(horaInicio, horaFin) && momentLocalStorage > updateTime!)) {
42
- const data = await getFixture();
43
- setDataLocal(data)
44
- setDataFixture(data);
43
+ const dataRequest = await getFixture(data.parameters.league!);
44
+ setDataLocal(dataRequest)
45
+ setDataFixture(dataRequest);
45
46
  } else {
46
47
  setDataFixture(dataLocal.data)
47
48
  }
@@ -49,11 +50,21 @@ export const App = ({ data, start }: Props) => {
49
50
 
50
51
  useEffect(() => {
51
52
  if (start) {
53
+ setLeague(data.parameters.league!)
52
54
  getData()
53
55
  }
54
56
  addConfiguration(data)
55
57
  }, [data])
56
58
 
59
+ useEffect(() =>{
60
+ if (league !== data.parameters.league) {
61
+ console.log('league', league)
62
+ setLeague(data.parameters.league!)
63
+ localforage.clear()
64
+ getData()
65
+ }
66
+ }, [data.parameters.league])
67
+
57
68
  //Request data every 5 minutes
58
69
  useEffect(() => {
59
70
  let interval = setInterval(() => {
@@ -9,151 +9,151 @@ import { Results } from './Results';
9
9
 
10
10
  export const Row = (item: any) => {
11
11
 
12
- const { fixture, teams, goals, score } = item.item;
13
- const { configureState } = useContext(ConfigureContext)
14
- const { parameters } = configureState
15
- const [homeTeam, setHomeTeam] = useState(false);
16
- const [awayTeam, setAwayTeam] = useState(false);
17
-
18
- const {
19
- descriptionEnabled,
20
- widthDescription,
21
- descriptionFormat,
22
- imageSize,
23
- widthImage,
24
- widthScore,
25
- columnGap,
26
- rowGap,
27
- widthStatus,
28
- widthTime,
29
- } = parameters
30
-
31
- let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
32
- ` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
33
-
34
- let nameHome = translateTeams(teams.home.name)
35
- let nameAway = translateTeams(teams.away.name)
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
- }
12
+ const { fixture, teams, goals, score } = item.item;
13
+ const { configureState } = useContext(ConfigureContext)
14
+ const { parameters } = configureState
15
+ const [homeTeam, setHomeTeam] = useState(false);
16
+ const [awayTeam, setAwayTeam] = useState(false);
17
+
18
+ const {
19
+ descriptionEnabled,
20
+ widthDescription,
21
+ descriptionFormat,
22
+ imageSize,
23
+ widthImage,
24
+ widthScore,
25
+ columnGap,
26
+ rowGap,
27
+ widthStatus,
28
+ widthTime,
29
+ } = parameters
30
+
31
+ let gridColumns = descriptionEnabled ? `${widthTime || "200px"} ${widthStatus || "200px"} ${widthDescription || "200px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"} ${widthDescription || "200px"}` :
32
+ ` ${widthTime || "100px"} ${widthStatus || "100px"} ${widthImage || "300px"} ${widthScore || "100px"} ${widthImage || "300px"}`
33
+
34
+ let nameHome = translateTeams(teams.home.name)
35
+ let nameAway = translateTeams(teams.away.name)
36
+
37
+
38
+ const requestFlagHome = async (urlLogo: string) => {
39
+ try {
40
+ const resp1 = await fetch(urlLogo)
41
+ if (resp1.status === 200) {
42
+ setHomeTeam(true)
43
+ }
44
+ } catch (error) {
45
+ console.log(error)
46
+ setHomeTeam(false)
48
47
  }
48
+ }
49
+
50
+ const requestFlagAway = async (urlLogo: any) => {
51
+ try {
52
+ const resp1 = await fetch(urlLogo)
53
+ if (resp1.status === 200) {
54
+ setAwayTeam(true)
55
+ }
56
+ } catch (error) {
57
+ console.log(error)
58
+ setAwayTeam(false)
49
59
 
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
60
  }
61
+ }
62
+
63
+ useEffect(() => {
64
+ requestFlagHome(teams.home.logo)
65
+ requestFlagAway(teams.away.logo)
66
+ }, [])
67
+
68
+
69
+ return (
70
+ <div
71
+ style={{
72
+ display: 'grid',
73
+ gridTemplateColumns: `${gridColumns}`,
74
+ columnGap: `${columnGap || "10px"}`,
75
+ width: '100%',
76
+ height: '100%',
77
+ alignItems: 'center',
78
+ placeContent: 'center',
79
+ padding: `${rowGap || "30px"} 0px`,
80
+ justifyContent: 'center'
81
+ }}
82
+ >
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>
102
+
103
+ {
104
+ descriptionEnabled &&
105
+ <div style={{
106
+ display: 'flex',
107
+ justifyContent: 'flex-end',
108
+ marginRight: '10px'
109
+ }}>
110
+ <FormattedText text={nameHome} format={descriptionFormat} />
111
+ </div>
112
+ }
113
+ <div style={{
114
+ display: 'flex',
115
+ justifyContent: 'center',
116
+ width: '100%',
117
+ alignItems: 'center',
118
+ marginLeft: '5px'
119
+ }}>
120
+ {
121
+ homeTeam ?
122
+ <img src={`${teams.home.logo}`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} /> :
123
+ <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
62
124
 
63
- useEffect(() => {
64
- requestFlagHome(teams.home.id)
65
- requestFlagAway(teams.away.id)
66
- }, [])
67
-
68
-
69
- return (
125
+ }
126
+ </div>
127
+
128
+ <Results goals={goals} score={score} />
129
+
130
+ <div
131
+ style={{
132
+ display: 'flex',
133
+ justifyContent: 'flex-start',
134
+ width: '100%',
135
+ alignItems: 'center',
136
+ marginRight: '5px'
137
+ }}
138
+ >
139
+ {
140
+ awayTeam ?
141
+ <img src={`${teams.away.logo}`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
142
+ : <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
143
+ }
144
+ </div>
145
+ {
146
+ descriptionEnabled &&
70
147
  <div
71
- style={{
72
- display: 'grid',
73
- gridTemplateColumns: `${gridColumns}`,
74
- columnGap: `${columnGap || "10px"}`,
75
- width: '100%',
76
- height: '100%',
77
- alignItems: 'center',
78
- placeContent: 'center',
79
- padding: `${rowGap || "30px"} 0px`,
80
- justifyContent: 'center'
81
- }}
148
+ style={{
149
+ display: 'flex',
150
+ justifyContent: 'flex-start',
151
+ marginLeft: '10px',
152
+ }}
82
153
  >
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>
102
-
103
- {
104
- descriptionEnabled &&
105
- <div style={{
106
- display: 'flex',
107
- justifyContent: 'flex-end',
108
- marginRight: '10px'
109
- }}>
110
- <FormattedText text={nameHome} format={descriptionFormat} />
111
- </div>
112
- }
113
- <div style={{
114
- display: 'flex',
115
- justifyContent: 'center',
116
- width: '100%',
117
- alignItems: 'center',
118
- marginLeft: '5px'
119
- }}>
120
- {
121
- homeTeam ?
122
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.home.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} /> :
123
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
124
-
125
- }
126
- </div>
127
-
128
- <Results goals={goals} score={score} />
129
-
130
- <div
131
- style={{
132
- display: 'flex',
133
- justifyContent: 'flex-start',
134
- width: '100%',
135
- alignItems: 'center',
136
- marginRight: '5px'
137
- }}
138
- >
139
- {
140
- awayTeam ?
141
- <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/${teams.away.id}.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
142
- : <img src={`https://storage.googleapis.com/vixoniccom-emails/results_flags/0000.png`} style={{ width: `${imageSize ? imageSize : 100}%`, objectFit: 'contain' }} />
143
- }
144
- </div>
145
- {
146
- descriptionEnabled &&
147
- <div
148
- style={{
149
- display: 'flex',
150
- justifyContent: 'flex-start',
151
- marginLeft: '10px',
152
- }}
153
- >
154
- <FormattedText text={nameAway} format={descriptionFormat} />
155
- </div>
156
- }
157
- </div >
158
- )
154
+ <FormattedText text={nameAway} format={descriptionFormat} />
155
+ </div>
156
+ }
157
+ </div >
158
+ )
159
159
  }
@@ -5,88 +5,89 @@ import { parameterReducer } from "./configureReducer";
5
5
 
6
6
 
7
7
  const INITIAL_STATE: VixonicData = {
8
- downloadsPath: '',
9
- parameters: {
10
- abbreviatedMonths: false,
11
- animationMode: "",
12
- animationOrder: false,
13
- animationSpeed: 1.5,
14
- animationTime: "",
15
- backgroundImage: { id: "", filename: "", _isAsset: true },
16
- apiDomain: "",
17
- containerColumns: "",
18
- statusFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
19
- containerColumnsGap: "",
20
- containerRows: "",
21
- containerRowsGap: "",
22
- dataMode: "",
23
- title0: 'App Mundial',
24
- titleEnabled: false,
25
- titleFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
26
- goalsFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
27
- timeFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
28
- dateAlignment: "center",
29
- dateDayFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
30
- dateEnabled: true,
31
- dateMonthFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 20, alignment: { horizontal: "center" }, fontColor: "" },
32
- datePosition: 1,
33
- datePrimaryColor: "",
34
- dateStyle: "circle",
35
- descriptionEnabled: true,
36
- descriptionFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
37
- excludePast: false,
38
- imageAlignment: "center",
39
- imageEnabled: true,
40
- imagePosition: 0,
41
- imageStyle: "normal",
42
- imageSize: 50,
43
- itemMargins: "",
44
- msj0: "No hay partidos hoy",
45
- nameFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
46
- orientation: "",
47
- padding: "",
48
- photosMode: "",
49
- photosZip: { id: "0fb559ec-5da3-4b2d-95c4-d9623754c841", filename: "0fb559ec-5da3-4b2d-95c4-d9623754c841.zip", extension: "zip", _isAsset: true },
50
- template: "",
51
- textAlignment: "center",
52
- textPosition: 0,
53
- updateTime: 300000,
54
- urlBaseApi: "",
55
- imageMargin: "",
56
- textMargin: "",
57
- dateMargin: "",
58
- separator: false,
59
- widthDescription: "200px",
60
- widthImage: "300px",
61
- widthScore: "100px",
62
- columnGap: "10px",
63
- rowGap: "30px",
64
- widthStatus: "200px",
65
- widthTime: "200px",
66
- timeEnd: "7pm",
67
- timeStart: "6am",
68
- formatMjs: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
69
- alignVerticalMsj: "center",
70
- }
8
+ downloadsPath: '',
9
+ parameters: {
10
+ abbreviatedMonths: false,
11
+ animationMode: "",
12
+ animationOrder: false,
13
+ animationSpeed: 1.5,
14
+ animationTime: "",
15
+ backgroundImage: { id: "", filename: "", _isAsset: true },
16
+ apiDomain: "",
17
+ containerColumns: "",
18
+ statusFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
19
+ containerColumnsGap: "",
20
+ containerRows: "",
21
+ containerRowsGap: "",
22
+ dataMode: "",
23
+ title0: 'App Mundial',
24
+ titleEnabled: false,
25
+ titleFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
26
+ goalsFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
27
+ timeFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
28
+ dateAlignment: "center",
29
+ dateDayFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "", },
30
+ dateEnabled: true,
31
+ dateMonthFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 20, alignment: { horizontal: "center" }, fontColor: "" },
32
+ datePosition: 1,
33
+ datePrimaryColor: "",
34
+ dateStyle: "circle",
35
+ descriptionEnabled: true,
36
+ descriptionFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
37
+ excludePast: false,
38
+ imageAlignment: "center",
39
+ imageEnabled: true,
40
+ imagePosition: 0,
41
+ imageStyle: "normal",
42
+ imageSize: 50,
43
+ itemMargins: "",
44
+ msj0: "No hay partidos hoy",
45
+ nameFormat: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
46
+ orientation: "",
47
+ padding: "",
48
+ photosMode: "",
49
+ photosZip: { id: "0fb559ec-5da3-4b2d-95c4-d9623754c841", filename: "0fb559ec-5da3-4b2d-95c4-d9623754c841.zip", extension: "zip", _isAsset: true },
50
+ template: "",
51
+ textAlignment: "center",
52
+ textPosition: 0,
53
+ updateTime: 300000,
54
+ urlBaseApi: "",
55
+ imageMargin: "",
56
+ textMargin: "",
57
+ dateMargin: "",
58
+ separator: false,
59
+ widthDescription: "200px",
60
+ widthImage: "300px",
61
+ widthScore: "100px",
62
+ columnGap: "10px",
63
+ rowGap: "30px",
64
+ widthStatus: "200px",
65
+ widthTime: "200px",
66
+ timeEnd: "7pm",
67
+ timeStart: "6am",
68
+ formatMjs: { font: { filename: '', id: '', _isAsset: true }, fontSize: 3.8, alignment: { horizontal: "center" }, fontColor: "" },
69
+ alignVerticalMsj: "center",
70
+ league: "9"
71
+ }
71
72
  }
72
73
 
73
74
  interface props {
74
- children: JSX.Element | JSX.Element[]
75
+ children: JSX.Element | JSX.Element[]
75
76
  }
76
77
 
77
78
  export const ParameterProvider = ({ children }: props) => {
78
79
 
79
- const [configureState, dispatch] = useReducer(parameterReducer, INITIAL_STATE)
80
+ const [configureState, dispatch] = useReducer(parameterReducer, INITIAL_STATE)
80
81
 
81
82
 
82
- const addConfiguration = (configure: VixonicData) => {
83
- dispatch({ type: "addConfigure", payload: configure })
84
- }
83
+ const addConfiguration = (configure: VixonicData) => {
84
+ dispatch({ type: "addConfigure", payload: configure })
85
+ }
85
86
 
86
- return (
87
- <ConfigureContext.Provider value={{ configureState, addConfiguration }}>
88
- {children}
89
- </ConfigureContext.Provider>
90
- )
87
+ return (
88
+ <ConfigureContext.Provider value={{ configureState, addConfiguration }}>
89
+ {children}
90
+ </ConfigureContext.Provider>
91
+ )
91
92
  }
92
93
 
@@ -1,63 +1,64 @@
1
1
 
2
2
  type ConfigureAction =
3
- | { type: 'addConfigure', payload: VixonicData }
3
+ | { type: 'addConfigure', payload: VixonicData }
4
4
 
5
5
 
6
6
  export const parameterReducer = (state: VixonicData, action: ConfigureAction) => {
7
7
 
8
- const { downloadsPath, parameters } = action.payload
9
- switch (action.type) {
10
- case 'addConfigure':
11
- return {
12
- downloadsPath: downloadsPath,
13
- parameters: {
14
- backgroundImage: parameters.backgroundImage,
15
- descriptionEnabled: parameters.descriptionEnabled,
16
- descriptionFormat: parameters.descriptionFormat,
17
- imageAlignment: parameters.imageAlignment,
18
- imageEnabled: parameters.imageEnabled,
19
- imagePosition: parameters.imagePosition,
20
- imageSize: parameters.imageSize,
21
- imageStyle: parameters.imageStyle,
22
- itemMargins: parameters.itemMargins,
23
- msj0: parameters.msj0,
24
- nameFormat: parameters.nameFormat,
25
- orientation: parameters.orientation,
26
- padding: parameters.padding,
27
- photosMode: parameters.photosMode,
28
- photosZip: parameters.photosZip,
29
- template: parameters.template,
30
- textAlignment: parameters.textAlignment,
31
- textPosition: parameters.textPosition,
32
- updateTime: parameters.updateTime,
33
- urlBaseApi: parameters.urlBaseApi,
34
- imageMargin: parameters.imageMargin,
35
- textMargin: parameters.textMargin,
36
- dateMargin: parameters.dateMargin,
37
- separator: parameters.separator,
38
- descriptionMaxChar: parameters.descriptionMaxChar,
39
- nameMaxChar: parameters.nameMaxChar,
40
- timeFormat: parameters.timeFormat,
41
- goalsFormat: parameters.goalsFormat,
42
- title0: parameters.title0,
43
- titleEnabled: parameters.titleEnabled,
44
- titleFormat: parameters.titleFormat,
45
- statusFormat: parameters.statusFormat,
46
- widthDescription: parameters.widthDescription,
47
- widthImage: parameters.widthImage,
48
- widthScore: parameters.widthScore,
49
- columnGap: parameters.columnGap,
50
- rowGap: parameters.rowGap,
51
- widthTime: parameters.widthTime,
52
- widthStatus: parameters.widthStatus,
53
- timeStart: parameters.timeStart,
54
- timeEnd: parameters.timeEnd,
55
- formatMjs: parameters.formatMjs,
56
- alignVerticalMsj: parameters.alignVerticalMsj
57
- }
58
- }
59
- default:
60
- return state;
61
- }
8
+ const { downloadsPath, parameters } = action.payload
9
+ switch (action.type) {
10
+ case 'addConfigure':
11
+ return {
12
+ downloadsPath: downloadsPath,
13
+ parameters: {
14
+ backgroundImage: parameters.backgroundImage,
15
+ descriptionEnabled: parameters.descriptionEnabled,
16
+ descriptionFormat: parameters.descriptionFormat,
17
+ imageAlignment: parameters.imageAlignment,
18
+ imageEnabled: parameters.imageEnabled,
19
+ imagePosition: parameters.imagePosition,
20
+ imageSize: parameters.imageSize,
21
+ imageStyle: parameters.imageStyle,
22
+ itemMargins: parameters.itemMargins,
23
+ msj0: parameters.msj0,
24
+ nameFormat: parameters.nameFormat,
25
+ orientation: parameters.orientation,
26
+ padding: parameters.padding,
27
+ photosMode: parameters.photosMode,
28
+ photosZip: parameters.photosZip,
29
+ template: parameters.template,
30
+ textAlignment: parameters.textAlignment,
31
+ textPosition: parameters.textPosition,
32
+ updateTime: parameters.updateTime,
33
+ urlBaseApi: parameters.urlBaseApi,
34
+ imageMargin: parameters.imageMargin,
35
+ textMargin: parameters.textMargin,
36
+ dateMargin: parameters.dateMargin,
37
+ separator: parameters.separator,
38
+ descriptionMaxChar: parameters.descriptionMaxChar,
39
+ nameMaxChar: parameters.nameMaxChar,
40
+ timeFormat: parameters.timeFormat,
41
+ goalsFormat: parameters.goalsFormat,
42
+ title0: parameters.title0,
43
+ titleEnabled: parameters.titleEnabled,
44
+ titleFormat: parameters.titleFormat,
45
+ statusFormat: parameters.statusFormat,
46
+ widthDescription: parameters.widthDescription,
47
+ widthImage: parameters.widthImage,
48
+ widthScore: parameters.widthScore,
49
+ columnGap: parameters.columnGap,
50
+ rowGap: parameters.rowGap,
51
+ widthTime: parameters.widthTime,
52
+ widthStatus: parameters.widthStatus,
53
+ timeStart: parameters.timeStart,
54
+ timeEnd: parameters.timeEnd,
55
+ formatMjs: parameters.formatMjs,
56
+ alignVerticalMsj: parameters.alignVerticalMsj,
57
+ league: parameters.league
58
+ }
59
+ }
60
+ default:
61
+ return state;
62
+ }
62
63
 
63
64
  }
@@ -1,25 +1,25 @@
1
1
  import moment from 'moment';
2
2
  const axios = require("axios");
3
3
 
4
- export const getFixture = async () => {
5
-
6
- const today = moment().format('YYYY-MM-DD')
7
- const options = {
8
- method: 'GET',
9
- url: 'https://api-football-v1.p.rapidapi.com/v3/fixtures',
10
- params: { date: `${today}`, league: '1', season: '2022' },
11
- headers: {
12
- 'X-RapidAPI-Key': 'a7e693d4c5msh72a2ff2020fd601p12dd08jsn0f168421d7bb',
13
- 'X-RapidAPI-Host': 'api-football-v1.p.rapidapi.com'
14
- }
15
- };
16
- try {
17
- const response = await axios.request(options)
18
- console.log("🚀 ~ file: getFixture.ts:20 ~ getFixture ~ response", response.data.response)
19
- return response.data.response
20
- } catch (error) {
21
- console.error(error);
22
- return []
4
+ export const getFixture = async (league: string) => {
5
+ const today = moment().format('YYYY-MM-DD')
6
+ const year = moment().format('YYYY')
7
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
8
+ const options = {
9
+ method: 'GET',
10
+ url: 'https://api-football-v1.p.rapidapi.com/v3/fixtures',
11
+ params: { date: `${today}`, league: league, season: `${year}`, timezone: `${timezone}` },
12
+ headers: {
13
+ 'X-RapidAPI-Key': 'a7e693d4c5msh72a2ff2020fd601p12dd08jsn0f168421d7bb',
14
+ 'X-RapidAPI-Host': 'api-football-v1.p.rapidapi.com'
23
15
  }
24
-
16
+ };
17
+ try {
18
+ const response = await axios.request(options)
19
+ console.log("🚀 ~ getFixture ~ response:", response.data )
20
+ return response.data.response
21
+ } catch (error) {
22
+ console.error(error);
23
+ return []
24
+ }
25
25
  }
@@ -73,7 +73,8 @@ declare type VixonicParameters = Partial<{
73
73
  timeStart: string,
74
74
  timeEnd: string,
75
75
  formatMjs: DateFormat,
76
- alignVerticalMsj: string
76
+ alignVerticalMsj: string,
77
+ league: string
77
78
  }>
78
79
 
79
80
 
@@ -1,97 +1,98 @@
1
1
  {
2
- "parameters": {
3
- "urlBaseApi": "mandomedio",
4
- "msj0": "No hay partidos",
5
- "statusEnabled": true,
6
- "timeRequest":60000,
7
- "rowGap":"30px",
8
- "columnGap":"10px",
9
- "padding": "30px 25px 80px 40px",
10
- "dataMode": "monthly",
11
- "template": "standard",
12
- "dateStyle": "circle",
13
- "photosZip": {
14
- "id": "d1093778-f3c9-42c8-9b07-9f8736390aeb",
15
- "filename": "d1093778-f3c9-42c8-9b07-9f8736390aeb.zip",
16
- "__isAsset": true,
17
- "extension": "zip"
2
+ "parameters": {
3
+ "urlBaseApi": "mandomedio",
4
+ "msj0": "No hay partidos",
5
+ "statusEnabled": true,
6
+ "timeRequest": 60000,
7
+ "rowGap": "30px",
8
+ "columnGap": "10px",
9
+ "padding": "30px 25px 80px 40px",
10
+ "dataMode": "monthly",
11
+ "template": "standard",
12
+ "league": "9",
13
+ "dateStyle": "circle",
14
+ "photosZip": {
15
+ "id": "d1093778-f3c9-42c8-9b07-9f8736390aeb",
16
+ "filename": "d1093778-f3c9-42c8-9b07-9f8736390aeb.zip",
17
+ "__isAsset": true,
18
+ "extension": "zip"
19
+ },
20
+ "imageStyle": "circle",
21
+ "nameFormat": {
22
+ "font": {
23
+ "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
24
+ "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
25
+ "__isAsset": true
26
+ },
27
+ "fontSize": 3.8,
28
+ "alignment": {
29
+ "horizontal": "left"
18
30
  },
19
- "imageStyle": "circle",
20
- "nameFormat": {
21
- "font": {
22
- "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
23
- "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
24
- "__isAsset": true
25
- },
26
- "fontSize": 3.8,
27
- "alignment": {
28
- "horizontal": "left"
29
- },
30
- "fontColor": "#585858"
31
+ "fontColor": "#585858"
32
+ },
33
+ "photosMode": "zip",
34
+ "updateTime": 300000,
35
+ "dateEnabled": true,
36
+ "excludePast": false,
37
+ "itemMargins": "5px",
38
+ "orientation": "h",
39
+ "datePosition": 1,
40
+ "imageEnabled": true,
41
+ "textPosition": 3,
42
+ "animationMode": "fade",
43
+ "animationTime": "5",
44
+ "containerRows": "3",
45
+ "dateAlignment": "center",
46
+ "dateDayFormat": {
47
+ "font": {
48
+ "id": "c705a739-312e-4334-9231-e73a05e9d382",
49
+ "filename": "c705a739-312e-4334-9231-e73a05e9d382.ttf",
50
+ "__isAsset": true
31
51
  },
32
- "photosMode": "zip",
33
- "updateTime": 300000,
34
- "dateEnabled": true,
35
- "excludePast": false,
36
- "itemMargins": "5px",
37
- "orientation": "h",
38
- "datePosition": 1,
39
- "imageEnabled": true,
40
- "textPosition": 3,
41
- "animationMode": "fade",
42
- "animationTime": "5",
43
- "containerRows": "3",
44
- "dateAlignment": "center",
45
- "dateDayFormat": {
46
- "font": {
47
- "id": "c705a739-312e-4334-9231-e73a05e9d382",
48
- "filename": "c705a739-312e-4334-9231-e73a05e9d382.ttf",
49
- "__isAsset": true
50
- },
51
- "fontSize": 55,
52
- "alignment": {
53
- "horizontal": "center"
54
- },
55
- "fontColor": "#ffffff"
52
+ "fontSize": 55,
53
+ "alignment": {
54
+ "horizontal": "center"
56
55
  },
57
- "imagePosition": 2,
58
- "textAlignment": "center",
59
- "animationOrder": false,
60
- "animationSpeed": 1.5,
61
- "imageAlignment": "center",
62
- "backgroundImage": {
63
- "id": "",
64
- "filename": "",
56
+ "fontColor": "#ffffff"
57
+ },
58
+ "imagePosition": 2,
59
+ "textAlignment": "center",
60
+ "animationOrder": false,
61
+ "animationSpeed": 1.5,
62
+ "imageAlignment": "center",
63
+ "backgroundImage": {
64
+ "id": "",
65
+ "filename": "",
66
+ "__isAsset": true
67
+ },
68
+ "dateMonthFormat": {
69
+ "font": {
70
+ "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
71
+ "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
65
72
  "__isAsset": true
66
73
  },
67
- "dateMonthFormat": {
68
- "font": {
69
- "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
70
- "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
71
- "__isAsset": true
72
- },
73
- "fontSize": 20,
74
- "alignment": {
75
- "horizontal": "center"
76
- },
77
- "fontColor": "#ffffff"
74
+ "fontSize": 20,
75
+ "alignment": {
76
+ "horizontal": "center"
77
+ },
78
+ "fontColor": "#ffffff"
79
+ },
80
+ "containerColumns": "1",
81
+ "containerRowsGap": "5",
82
+ "datePrimaryColor": "#d13139",
83
+ "abbreviatedMonths": false,
84
+ "descriptionFormat": {
85
+ "font": {
86
+ "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
87
+ "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
88
+ "__isAsset": true
78
89
  },
79
- "containerColumns": "1",
80
- "containerRowsGap": "5",
81
- "datePrimaryColor": "#d13139",
82
- "abbreviatedMonths": false,
83
- "descriptionFormat": {
84
- "font": {
85
- "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
86
- "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
87
- "__isAsset": true
88
- },
89
- "fontSize": 3.8,
90
- "alignment": {
91
- "horizontal": "left"
92
- },
93
- "fontColor": "#585858"
90
+ "fontSize": 3.8,
91
+ "alignment": {
92
+ "horizontal": "left"
94
93
  },
95
- "descriptionEnabled": true
96
- }
97
- }
94
+ "fontColor": "#585858"
95
+ },
96
+ "descriptionEnabled": true
97
+ }
98
+ }