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

fix: 영감 없을 때 이미지 구분 #632

Merged
merged 2 commits into from
Apr 5, 2024
Merged
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
26 changes: 12 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// const { withSentryConfig } = require('@sentry/nextjs');
// const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: process.env.ANALYZE === 'true',
// });
const { withSentryConfig } = require('@sentry/nextjs');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const CompressionPlugin = require('compression-webpack-plugin');
const { version } = require('./package.json');

@@ -29,14 +29,12 @@ const nextConfig = {
output: 'export',
};

// const sentryWebpackPluginOptions = {
// silent: true,
// authToken: process.env.SENTRY_AUTH_TOKEN,
// };

module.exports = nextConfig;
const sentryWebpackPluginOptions = {
silent: true,
authToken: process.env.SENTRY_AUTH_TOKEN,
};

// module.exports = () => {
// const plugins = [[withSentryConfig, sentryWebpackPluginOptions], [withBundleAnalyzer]];
// return plugins.reduce((acc, cur) => cur[0](acc, cur[1] ?? undefined), nextConfig);
// };
module.exports = () => {
const plugins = [[withSentryConfig, sentryWebpackPluginOptions], [withBundleAnalyzer]];
return plugins.reduce((acc, cur) => cur[0](acc, cur[1] ?? undefined), nextConfig);
};
Binary file added public/InspirationEmpty.webp
Binary file not shown.
Binary file removed public/InspirationEmptyText.png
Binary file not shown.
Binary file added public/InspirationEmptyText.webp
Binary file not shown.
Binary file removed public/UserProfile.png
Binary file not shown.
Binary file added public/UserProfile.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/home/ThumbnailContent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { css, Theme } from '@emotion/react';

import { INSPIRATION_EMPTY_IMAGE_SRC } from '~/constants/assets';
import { PREVIEW_NONE_IMAGE_SRC } from '~/constants/assets';
import useDidMount from '~/hooks/common/useDidMount';
import useOpenGraphImage from '~/hooks/common/useOpenGraphImage';
import { textEllipsisCss } from '~/styles/utils';
@@ -36,7 +36,7 @@ function LinkContent({ openGraph }: Pick<ContentThumbnailProps, 'openGraph'>) {
const [og, setOg] = useState<OpenGraphResponse>();
const { src, onImageError } = useOpenGraphImage({
url: og?.url,
image: og?.image || INSPIRATION_EMPTY_IMAGE_SRC,
image: og?.image || PREVIEW_NONE_IMAGE_SRC,
});

useDidMount(() => {
7 changes: 4 additions & 3 deletions src/constants/assets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const INSPIRATION_EMPTY_IMAGE_SRC = '/insp-empty.webp';
export const INSPIRATION_EMPTY_TEXT_IMAGE_SRC = '/InspirationEmptyText.png';
export const USER_PROFILE_IMAGE_SRC = '/UserProfile.png';
export const PREVIEW_NONE_IMAGE_SRC = '/insp-empty.webp'; // 영감 카드 미리보기가 비어있을 때 보여줄 이미지
export const INSPIRATION_EMPTY_IMAGE_SRC = '/InspirationEmpty.webp'; // 영감이 없을 때 이미지
export const INSPIRATION_EMPTY_TEXT_IMAGE_SRC = '/InspirationEmptyText.webp';
export const USER_PROFILE_IMAGE_SRC = '/UserProfile.webp';

export const INSPIRATION_MODAL_IMAGE = {
1: '/modal_characters/1.png',