Skip to content

Commit

Permalink
refactor: simplify Placeholder component styling and structure
Browse files Browse the repository at this point in the history
  • Loading branch information
d-beezee committed Dec 18, 2024
1 parent d689caf commit d63a4d7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/stories/placeholder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ import styled from "styled-components";
const Wrapper = styled.span<{
display: NonNullable<React.CSSProperties["display"]>;
}>`
display: ${(props) => props.display};
padding: 10px;
border: 10px solid #e0e0e0;
background-color: #fff;
width: ${(props) => (["block"].includes(props.display) ? "100%" : "auto")};
display: block;
width: 4px;
height: 4px;
background-color: #ff00dc;
`;

const Placeholder = ({
display = "inline-block",
}: {
display?: React.CSSProperties["display"];
}) => {
return <Wrapper display={display}>PLACEHOLDER</Wrapper>;
return <Wrapper display={display} />;
};

export { Placeholder };

0 comments on commit d63a4d7

Please sign in to comment.