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
import React, { useRef, useEffect } from "react"; | |
// Checks if API is supported; otherwise imports pollyfill | |
const ResizeObserver = | |
window.ResizeObserver || require("resize-observer-polyfill"); | |
// Defines observer behaviour to react to changes upon container dimensions | |
const observer = new ResizeObserver(function (entries) { | |
// Default breakpoints. This object's keys will be mapped to CSS classnames used to | |
// dinamically style the elements inside container |
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
export default const ResponsiveContainerExample = () => { | |
return ( | |
<ResponsiveContainer | |
className="overflow-y-auto" | |
breakpoints={{ SM: 0, MD: 430 }} | |
> | |
<div className="panel"> | |
... | |
</div> | |
</ResponsiveContainer> |
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
.SM > .panel .item-container { | |
flex-direction: column; | |
align-items: center; | |
} | |
.MD > .panel .item-container { | |
flex-direction: row; | |
align-items: flex-start; | |
border-bottom-width: 1px; | |
} |
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
.SM > .panel { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.MD > .panel { | |
display: block; | |
} |
This file has been truncated, but you can view the full file.
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
{ | |
"vs/base/common/collections": { | |
"map": "a" | |
}, | |
"vs/base/common/lazy": { | |
"_value": "b", | |
"_error": "c", | |
"_didRun": "a", | |
"executor": "d" | |
}, |