import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */
import { useMediaQuery } from 'react-responsive'
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 })
return isDesktop ? children : null
}
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 })
return isTablet ? children : null
}
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 })
return isMobile ? children : null
}
const Default = ({ children }) => {
const isNotMobile = useMediaQuery({ minWidth: 768 })
return isNotMobile ? children : null
}
const Example = () => (
<div>
<Desktop>Desktop or laptop</Desktop>
<Tablet>Tablet</Tablet>
<Mobile>Mobile</Mobile>
<Default>Not mobile (desktop or laptop or tablet)</Default>
</div>
)
export default Example
import React from 'react'
import styled from 'styled-components';
//components
import Header from './modules/header/index'
import CurrentEatingHabbits from './modules/eating-habits-current'
import EatingHabbitsComment from './modules/eating-habits-comment'
import MonthlyMenuRanking from './modules/monthly-menu-ranking'
import EnvirommentWeProtect from './modules/environment-we-protect'
import Footer from'./modules/footer'
export default function Report(){
//뷰포트를 가져옴 window.innerWidth
let width = window.innerWidth/327 > 2? 1:window.innerWidth/327;
console.log(width)
return (
<Wrap width={width}>
<Header/>
<CurrentEatingHabbits/>
<EatingHabbitsComment/>
<MonthlyMenuRanking/>
<EnvirommentWeProtect/>
<Footer/>
</Wrap>
);
}
const Wrap = styled.div`
position: relative;
width: 320px;
margin:0 auto;
height: auto;
background: #FFFFFF;
//뷰포트에 맞게 크기를 바꿈
transform:scale(${props =>props.width});
overflow-x:hidden;
transform-origin: top;
`
`/* pc */
@media all and (min-width: 1025px) {
.wrap{width:1200px;}
}
/* tablet */
@media all and (min-width: 768px) and (max-width: 1024px) {
.wrap{width:712px;}
}
/* phone */
@media all and (max-width: 767px) {
.wrap{width:320px;}
}
/* index */