Datasets:
text-dataset-tiny-code-script-py-format / ysnrfd_messenger /BACKUP /frontend /src /components /UI /ResponsiveContainer.jsx
Download ysnrfd_messenger/BACKUP/frontend/src/components/UI/ResponsiveContainer.jsx from ysn-rfd/text-dataset-tiny-code-script-py-format: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/ysnrfd_messenger/BACKUP/frontend/src/components/UI/ResponsiveContainer.jsx
- Command line
-
hf download hf://datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/ysnrfd_messenger/BACKUP/frontend/src/components/UI/ResponsiveContainer.jsx
-
curl -L -o ResponsiveContainer.jsx https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/ysnrfd_messenger/BACKUP/frontend/src/components/UI/ResponsiveContainer.jsx
615 Bytes
| import React from 'react'; | |
| import { useScreenSize } from '../../utils/responsive'; | |
| const ResponsiveContainer = ({ | |
| children, | |
| mobileClassName = '', | |
| tabletClassName = '', | |
| desktopClassName = '', | |
| className = '' | |
| }) => { | |
| const { isMobile, isTablet, isDesktop } = useScreenSize(); | |
| const getResponsiveClass = () => { | |
| if (isMobile) return mobileClassName; | |
| if (isTablet) return tabletClassName; | |
| return desktopClassName; | |
| }; | |
| return ( | |
| <div className={`${getResponsiveClass()} ${className}`}> | |
| {children} | |
| </div> | |
| ); | |
| }; | |
| export default ResponsiveContainer; |