|
55 | 55 | </template>
|
56 | 56 | <script>
|
57 | 57 | import { sponsorsHandler } from "@/utils-client";
|
58 |
| - import sponsorTypes from "@/data/sponsor-types"; |
| 58 | + import { sponsorConfig } from "@/data/sponsor-config"; |
59 | 59 | import { ImageType } from "@/types";
|
60 | 60 | import type { CSSProperties } from "react";
|
61 | 61 |
|
|
105 | 105 | true,
|
106 | 106 | ) as HTMLElement;
|
107 | 107 | const headerName = cards.querySelector("#header-text")!;
|
108 |
| - headerName.textContent = `${sponsorTypes[type.name].header} sponsors`; |
| 108 | + headerName.textContent = `${sponsorConfig[type.name].header} sponsors`; |
109 | 109 | const emoji = cards.querySelector("#emoji")!;
|
110 |
| - emoji.textContent = sponsorTypes[type.name].emoji; |
| 110 | + emoji.textContent = sponsorConfig[type.name].emoji; |
111 | 111 | const cardsBlock = cards.querySelector("#cards-block")!;
|
112 | 112 | cardsBlock.className = `${type.name} cards`;
|
113 | 113 | type.items.forEach((item) => {
|
114 |
| - if (sponsorTypes[type.name].hasName) { |
| 114 | + if (sponsorConfig[type.name].hasName) { |
115 | 115 | //WITH NAME
|
116 | 116 | const card = sponsorCardWithNameTemplate.content.cloneNode(
|
117 | 117 | true,
|
|
132 | 132 | if (!item.imageType) {
|
133 | 133 | imgDark.src = getImgLink(
|
134 | 134 | item.sponsorEntity.avatarUrl,
|
135 |
| - sponsorTypes[type.name].size, |
| 135 | + sponsorConfig[type.name].size, |
136 | 136 | );
|
137 | 137 | }
|
138 | 138 | imgDark.alt = item.sponsorEntity.name || item.sponsorEntity.login;
|
|
161 | 161 | if (!item.imageType) {
|
162 | 162 | imgLight.src = getImgLink(
|
163 | 163 | item.sponsorEntity.avatarUrl,
|
164 |
| - sponsorTypes[type.name].size, |
| 164 | + sponsorConfig[type.name].size, |
165 | 165 | );
|
166 | 166 | }
|
167 | 167 | imgLight.alt =
|
|
178 | 178 | )! as HTMLDivElement;
|
179 | 179 | imgWrapper.setAttribute(
|
180 | 180 | "style",
|
181 |
| - `width: ${sponsorTypes[type.name].size}px; height: ${ |
182 |
| - sponsorTypes[type.name].size |
| 181 | + `width: ${sponsorConfig[type.name].size}px; height: ${ |
| 182 | + sponsorConfig[type.name].size |
183 | 183 | }px`,
|
184 | 184 | );
|
185 | 185 | const gitLink = card.querySelector(
|
|
224 | 224 | "#card-wrapper",
|
225 | 225 | )! as HTMLDivElement;
|
226 | 226 | cardWrapper.classList.add("with_name");
|
227 |
| - if (sponsorTypes[type.name].hasCard) { |
| 227 | + if (sponsorConfig[type.name].hasCard) { |
228 | 228 | if (item.popover) {
|
229 | 229 | cardWrapper.classList.add("styled_card_with_popover");
|
230 | 230 | const popover =
|
|
269 | 269 | if (!item.imageType) {
|
270 | 270 | imgDark.src = getImgLink(
|
271 | 271 | item.sponsorEntity.avatarUrl,
|
272 |
| - sponsorTypes[type.name].size, |
| 272 | + sponsorConfig[type.name].size, |
273 | 273 | );
|
274 | 274 | }
|
275 | 275 | imgDark.alt = item.sponsorEntity.name || item.sponsorEntity.login;
|
|
299 | 299 | if (!item.imageType) {
|
300 | 300 | imgLight.src = getImgLink(
|
301 | 301 | item.sponsorEntity.avatarUrl,
|
302 |
| - sponsorTypes[type.name].size, |
| 302 | + sponsorConfig[type.name].size, |
303 | 303 | );
|
304 | 304 | }
|
305 | 305 | imgLight.alt =
|
|
310 | 310 | )! as HTMLDivElement;
|
311 | 311 | imgWrapper.setAttribute(
|
312 | 312 | "style",
|
313 |
| - `width: ${sponsorTypes[type.name].size}px; height: ${ |
314 |
| - sponsorTypes[type.name].size |
| 313 | + `width: ${sponsorConfig[type.name].size}px; height: ${ |
| 314 | + sponsorConfig[type.name].size |
315 | 315 | }px`,
|
316 | 316 | );
|
317 | 317 | const gitLink = card.querySelector(
|
|
0 commit comments