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(Hide): remove on prop from rendered element #3845

Merged
merged 1 commit into from May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -43,7 +43,6 @@ describe("Desktop", () => {

<div
class="c0"
on="smallMobile,mediumMobile,largeMobile,tablet"
>
kek
</div>
Expand Down
Expand Up @@ -47,7 +47,6 @@ describe("Hide", () => {

<div
class="c0"
on="smallMobile,largeMobile,largeDesktop"
>
content
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/orbit-components/src/Hide/index.tsx
Expand Up @@ -7,16 +7,16 @@ import getDisplay from "./helpers/getDisplay";
import type { Props } from "./types";
import type { Devices } from "../utils/mediaQuery/types";

const StyledHide = styled.div<{ on: Devices[]; $block?: boolean }>`
${({ on }) => getViewportHideStyles(on, getDisplay)};
const StyledHide = styled.div<{ $on: Devices[]; $block?: boolean }>`
${({ $on }) => getViewportHideStyles($on, getDisplay)};
`;

StyledHide.defaultProps = {
theme: defaultTheme,
};

const Hide = ({ on = [], block, children }: Props) => (
<StyledHide on={on} $block={block}>
<StyledHide $on={on} $block={block}>
{children}
</StyledHide>
);
Expand Down
Expand Up @@ -39,7 +39,6 @@ describe("Mobile", () => {

<div
class="c0"
on="desktop,largeDesktop"
>
kek
</div>
Expand Down