Skip to content

Commit

Permalink
refactor(skeleton): added default type
Browse files Browse the repository at this point in the history
  • Loading branch information
saiponnada committed Nov 14, 2023
1 parent 99f12ba commit 4b58823
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/ebay-skeleton/index.marko
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ static var validTypes = ["avatar", "button", "text", "form", "image", "tile"];
static var validSizes = ["large", "small"];
static var validTypeSizes = ["button", "text", "tile"];
$ var size = validSizes.includes(input.size) ? input.size : "default";
$ var type = validTypes.includes(input.type) ? input.type : null;
$ var typeClass = type && `skeleton-${type}`;
$ var type = validTypes.includes(input.type) ? input.type : "form";
$ var typeClass = `skeleton-${type}`;
$ var skeletonClass = (
validTypeSizes.includes(input.type) &&
(size !== "default"
Expand Down
7 changes: 5 additions & 2 deletions src/components/ebay-skeleton/skeleton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export default {
type: {
control: { type: "select" },
options: ["avatar", "button", "text", "form", "image", "tile"],
table: {
defaultValue: {
summary: "form",
},
},
description: "Type of the component to render.",
},
size: {
Expand Down Expand Up @@ -76,8 +81,6 @@ export default {
export const Default = Template.bind({});
Default.args = {
style: "width: 220px",
type: "button",
size: "small",
};
Default.parameters = {
docs: {
Expand Down

0 comments on commit 4b58823

Please sign in to comment.