Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Layout): remove getViewportHideStyles test: update snapshots Update packages/orbit-tailwind-preset/src/presets/components/index.ts Co-authored-by: Marco Vidal García <marco.vidal@kiwi.com>
- Loading branch information
1 parent
01fd709
commit 302e0dd
Showing
9 changed files
with
78 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
packages/orbit-components/src/Hide/helpers/getViewportHideStyles.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import styled from "styled-components"; | ||
import React from "react"; | ||
import cx from "clsx"; | ||
|
||
import defaultTheme from "../defaultTheme"; | ||
import getViewportHideStyles from "./helpers/getViewportHideStyles"; | ||
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)}; | ||
`; | ||
|
||
StyledHide.defaultProps = { | ||
theme: defaultTheme, | ||
}; | ||
|
||
const Hide = ({ on = [], block, children }: Props) => ( | ||
<StyledHide $on={on} $block={block}> | ||
<div | ||
className={cx(block ? "block" : "inline-block", { | ||
"sm-mm:hidden": on.includes("smallMobile"), | ||
"mm-lm:hidden": on.includes("mediumMobile"), | ||
"lm-tb:hidden": on.includes("largeMobile"), | ||
"tb-de:hidden": on.includes("tablet"), | ||
"de-ld:hidden": on.includes("desktop"), | ||
"ld:hidden": on.includes("largeDesktop"), | ||
})} | ||
> | ||
{children} | ||
</StyledHide> | ||
</div> | ||
); | ||
|
||
export default Hide; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters