Skip to content

Commit

Permalink
fix: maxWidth 삭제, blank width, height설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jungyeonPark committed Apr 29, 2024
1 parent 1d5ab7a commit ee73b57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-json-skeleton-loader",
"version": "0.0.6",
"version": "0.0.7",
"private": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
15 changes: 7 additions & 8 deletions src/JsonSkeletonLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const JsonSkeletonLoader: React.FC<UserPropsDataType> = (props: UserPropsDataTyp
}
// item의 요소들 중에 "brink" 가 존재할 경우
if (InitialValue.includes("blank")) {
return <S.Blank />;
return <S.Blank
blankWidth={InitialValue.includes(':') ? `${InitialValue.split(':')[1].trim().split('/')[0]}px` : `100px`}

Check failure on line 68 in src/JsonSkeletonLoader.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

No overload matches this call.
blankHeight={InitialValue.includes(':') ? `${InitialValue.split(':')[1].trim().split('/')[1]}px` : `100px`}
/>;
}
// title + text:x 와같은 형식이 존재할 경우 + 를 제외하고 title 과 text 요소가 생성됨 => text 같은경우에는 뒤으 Number와같은 수의 요소가 생성됨
return InitialValue
Expand Down Expand Up @@ -155,36 +158,32 @@ const S = {
//skeleton 전체를 감싸는 스타일 컴포넌트
Total: styled.div`
display: flex;
max-width: 700px;
margin: 0 auto;
`,
//skeleton text 와 title 을 감싸는 스타일 컴포넌트
Container: styled.div`
display: flex;
flex-wrap: wrap;
align-items: center;
max-width: 700px;
margin: 0 -10px;
/* animaition css 작업 */
&.own{
flex-grow: 0;
margin: 0 10px;
max-width: 700px;
margin-bottom: -5px;
}
&.two{
padding: 20px 0px;
flex-grow: 1;
margin: 0 10px;
max-width: 700px;
margin-bottom: -5px;
align-content: center;
}
`,
// skeleton brink 의 스타일 컴포넌트
// skeleton blank 의 스타일 컴포넌트
Blank: styled.div`
width: 100px;
height: 100px;
width:${({ blankWidth }) => blankWidth};

Check failure on line 185 in src/JsonSkeletonLoader.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

Property 'blankWidth' does not exist on type 'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & { ...; } & ThemeProps<...>'.
height:${({ blankHeight }) => blankHeight};

Check failure on line 186 in src/JsonSkeletonLoader.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

Property 'blankHeight' does not exist on type 'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & { ...; } & ThemeProps<...>'.
`,
// skeleton box 의 스타일 컴포넌트
Box: styled.div <StyledType>`
Expand Down

0 comments on commit ee73b57

Please sign in to comment.