-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
/
ad.styles.js
92 lines (87 loc) · 2.08 KB
/
ad.styles.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { alpha } from '@mui/material/styles';
import { adShape } from 'docs/src/modules/components/AdManager';
const adBodyImageStyles = (theme) => ({
root: {
display: 'block',
overflow: 'hidden',
border: `1px solid ${alpha(theme.palette.action.active, 0.12)}`,
padding: `${theme.spacing(1.5)} ${theme.spacing(1.5)} ${theme.spacing(
1.5,
)} calc(${theme.spacing(1.5)} + 130px)`,
borderRadius: theme.shape.borderRadius,
},
imgWrapper: {
float: 'left',
marginLeft: -130,
width: 130,
height: 100,
},
img: {
verticalAlign: 'middle',
},
a: {
color: theme.palette.text.primary,
textDecoration: 'none',
},
description: {
...theme.typography.body1,
display: 'block',
marginLeft: theme.spacing(1.5),
},
poweredby: {
...theme.typography.caption,
marginLeft: theme.spacing(1.5),
color: theme.palette.text.secondary,
display: 'block',
marginTop: theme.spacing(0.5),
fontWeight: theme.typography.fontWeightRegular,
},
});
const adBodyInlineStyles = (theme) => {
const baseline = adBodyImageStyles(theme);
return {
...baseline,
root: {
display: 'block',
paddingTop: 8,
},
imgWrapper: {
display: 'none',
},
description: {
...baseline.description,
marginLeft: 0,
'&:before': {
border: '1px solid #3e8e41',
color: '#3e8e41',
marginRight: 6,
padding: '1px 5px',
borderRadius: 3,
content: '"Ad"',
fontSize: theme.typography.pxToRem(14),
},
'&:after': {
marginLeft: 4,
content: '"Get started"',
// Style taken from the Link component
color: theme.palette.secondary.main,
'&:hover': {
textDecoration: 'underline',
},
},
},
poweredby: {
...baseline.poweredby,
marginTop: 2,
marginLeft: 0,
},
link: {
display: 'none',
},
};
};
export const adStylesObject = {
'body-image': adBodyImageStyles,
'body-inline': adBodyInlineStyles,
};
export default adStylesObject[`body-${adShape}`];