|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import styled from 'styled-components' |
|
|
|
import styled from 'styled-components/macro' |
|
|
|
import { VIEW_ADS } from '../../types' |
|
|
|
import { VIEW_ADS } from '../../types' |
|
|
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
type Props = { |
|
|
|
@ -7,15 +7,15 @@ type Props = { |
|
|
|
|
|
|
|
|
|
|
|
const chooseStyle = (type: number) => { |
|
|
|
const chooseStyle = (type: number) => { |
|
|
|
switch (true) { |
|
|
|
switch (true) { |
|
|
|
case VIEW_ADS[type] === 'COLUMN': |
|
|
|
case VIEW_ADS.COLUMN === type: |
|
|
|
return 'grid-row: 1 / 3; img {max-height: none;}' |
|
|
|
return 'grid-row: 1 / 3; img {max-height: none;}' |
|
|
|
case VIEW_ADS[type] === 'ROW': |
|
|
|
case VIEW_ADS.ROW === type: |
|
|
|
return 'grid-column: 1 / 3' |
|
|
|
return 'grid-column: 1 / 3' |
|
|
|
case VIEW_ADS[type] === 'SQUARE': |
|
|
|
case VIEW_ADS.SQUARE === type: |
|
|
|
return 'grid-row: 1 / 3; grid-column: 1 / 3; img {max-height: none;}' |
|
|
|
return 'grid-row: 1 / 3; grid-column: 1 / 3; img {max-height: none;}' |
|
|
|
case VIEW_ADS[type] === 'SECOND_COLUMN': |
|
|
|
case VIEW_ADS.SECOND_COLUMN === type: |
|
|
|
return 'grid-column: 2 / 3; grid-row: 1 / 1' |
|
|
|
return 'grid-column: 2 / 3; grid-row: 1 / 1' |
|
|
|
case VIEW_ADS[type] === 'SECOND_ROW': |
|
|
|
case VIEW_ADS.SECOND_ROW === type: |
|
|
|
return 'grid-column: 1 / 2; grid-row: 2 / 3;' |
|
|
|
return 'grid-column: 1 / 2; grid-row: 2 / 3;' |
|
|
|
default: |
|
|
|
default: |
|
|
|
return '' |
|
|
|
return '' |
|
|
|
|