Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: PNGS 상수명 WEBPS로 변경 #297

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/landing/MatchTeam/MatchCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Dispatch, useEffect, useState } from 'react';

import classNames from 'classnames/bind';

import { GAME_NAME_KR_TO_PATH_NAME, GAME_NAME_LIST_EN, PNGS } from '@/constants';
import { GAME_NAME_KR_TO_PATH_NAME, GAME_NAME_LIST_EN, WEBPS } from '@/constants';

import { GameClassName } from '@/components/landing/MatchTeam/MatchTeam';
import { useDeviceType } from '@/hooks/useDeviceType';
Expand All @@ -14,7 +14,7 @@ import styles from './MatchCards.module.scss';

const cx = classNames.bind(styles);

const { lol, bg, ow, mc } = PNGS.match;
const { lol, bg, ow, mc } = WEBPS.match;

type MatchCardsProps = {
hoveredCard: GameClassName;
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRouter } from 'next/router';

import classNames from 'classnames/bind';

import { GAME_PATH_NAME_TO_GAME_NAME_EN, PNGS } from '@/constants';
import { GAME_PATH_NAME_TO_GAME_NAME_EN, WEBPS } from '@/constants';

import styles from './Banner.module.scss';

Expand All @@ -13,7 +13,7 @@ const Banner = () => {
const { game } = router.query;
if (!game) return;
const gameName = GAME_PATH_NAME_TO_GAME_NAME_EN[game as keyof typeof GAME_PATH_NAME_TO_GAME_NAME_EN];
const { url } = PNGS.banner[gameName as keyof typeof PNGS.banner];
const { url } = WEBPS.banner[gameName as keyof typeof WEBPS.banner];

return (
<section className={cx('banner')} style={{ backgroundImage: `url(${url})` }}>
Expand Down
2 changes: 1 addition & 1 deletion src/constants/images.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const PNGS = {
export const WEBPS = {
banner: {
['LEAGUE OF LEGENDS']: { url: '/images/banner-LOL.webp' },
['BATTLEGROUNDS']: { url: '/images/banner-BG.webp' },
Expand Down
4 changes: 2 additions & 2 deletions src/pages/404/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import Image from 'next/image';

import classNames from 'classnames/bind';

import { PNGS } from '@/constants';
import { WEBPS } from '@/constants';

import styles from './404.module.scss';

const cx = classNames.bind(styles);
const { url, alt } = PNGS.errorPage.error404;
const { url, alt } = WEBPS.errorPage.error404;

const Error404 = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/500/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import Image from 'next/image';

import classNames from 'classnames/bind';

import { PNGS } from '@/constants';
import { WEBPS } from '@/constants';

import styles from './500.module.scss';

const cx = classNames.bind(styles);
const { url, alt } = PNGS.errorPage.error500;
const { url, alt } = WEBPS.errorPage.error500;

const Error404 = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/error/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import Image from 'next/image';

import classNames from 'classnames/bind';

import { PNGS } from '@/constants';
import { WEBPS } from '@/constants';

import styles from './error.module.scss';

const cx = classNames.bind(styles);
const { url, alt } = PNGS.errorPage.error;
const { url, alt } = WEBPS.errorPage.error;

export type ErrorProps = {
statusCode: number | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/gameFormatter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CATEGORY_TO_GAME, GAME_NAME_EN_TO_KR, PNGS } from '@/constants';
import { CATEGORY_TO_GAME, GAME_NAME_EN_TO_KR, WEBPS } from '@/constants';

import { GameNameEN, LinkName } from '@/types';

Expand All @@ -11,4 +11,4 @@ export const formatCategoryToGameNameEN = (category: string) => CATEGORY_TO_GAME
export const formatCategoryToGameNameKR = (category: string) => GAME_NAME_EN_TO_KR[CATEGORY_TO_GAME[category]];

export const formatCategoryToBannerImageURL = (category: string) =>
PNGS.banner[formatCategoryToGameNameEN(category)].url;
WEBPS.banner[formatCategoryToGameNameEN(category)].url;