Skip to content

Commit

Permalink
정사각형으로 나오는 이미지를 너비값 기준으로 보이게 변경 (#623)
Browse files Browse the repository at this point in the history
* chore: (#620) package-lock.json 업데이트

* fix: (#621) 스토리북을 이용하려고 할 때 웹팩 chunk 관련 에러가 나는 것 수정

* style: (#620) 이미지의 가로, 세로 비율에 맞게 이미지를 보여주도록 수정

* style: (#620) 게시글 작성 시  선택지 이미지에 적용

* chore: (#620) 변경된 컴포넌트 이름이 적용되어 있지 않던 스토리북 파일 수정

* style: (#620) 게시글 작성시 본문 이미지에도 적용
  • Loading branch information
Gilpop8663 authored Sep 15, 2023
1 parent 918bc3d commit 14aaafd
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 47 deletions.
12 changes: 11 additions & 1 deletion frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import path from 'path';
import type { StorybookConfig } from '@storybook/react-webpack5';

const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const webpack = require('webpack');

function disableChunkSplitting(config) {
config.optimization = { splitChunks: { chunks: 'async' } };
config.output = { ...config.output, chunkFilename: '[chunkhash].chunk.js' };
config.plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }));

return config;
}

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
Expand Down Expand Up @@ -31,7 +40,8 @@ const config: StorybookConfig = {
configFile: path.resolve(__dirname, '../tsconfig.json'),
})
);
return config;

return disableChunkSplitting(config);
},
staticDirs: ['./public'],
env: config => ({
Expand Down
109 changes: 81 additions & 28 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ContentImage = styled.img`
border-radius: 4px;
aspect-ratio: 1/1;
object-fit: cover;
object-fit: contain;
`;

export const FileInputContainer = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/Post/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const Image = styled.img`
margin-bottom: 10px;
aspect-ratio: 1/1;
object-fit: cover;
object-fit: contain;
@media (min-width: ${theme.breakpoint.md}) {
margin-bottom: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Image = styled.img`
border-radius: 4px;
aspect-ratio: 1/1;
object-fit: cover;
object-fit: contain;
`;

export const ImageCancelWrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Image = styled.img`
width: 100%;
aspect-ratio: 1/1;
object-fit: cover;
object-fit: contain;
@media (min-width: ${theme.breakpoint.md}) {
margin-bottom: 20px;
Expand Down
Loading

0 comments on commit 14aaafd

Please sign in to comment.