Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}),
background: css({
display: 'block',
position: 'absolute',
zIndex: '-1',
top: '0',
width: '100%',
height: '300px',
backgroundColor: '#599ded' // corresponds to logo
}),
featuresListItem: css({
listStyleType: 'disc',
marginLeft: tokens.spacingM
}),
light: css({
color: tokens.colorTextLight,
marginTop: tokens.spacingM
}),
logo: css({
width: '100%',
display: 'flex',
justifyContent: 'center',
marginTop: tokens.spacingXl,
marginBottom: tokens.spacingXl,
'& > img': css({
width: '80px'
})
}),
paragraph: css({
marginTop: tokens.spacingM
}),
heading: css({
import { css } from 'emotion';
import tokens from '@contentful/forma-36-tokens';
export default {
info: css({
color: tokens.colorTextLight,
marginBottom: tokens.spacingM,
fontSize: tokens.fontSizeS,
fontWeight: tokens.fontWeightNormal
}),
button: css({
marginBottom: tokens.spacingS
}),
previewButton: css({
margin: `${tokens.spacingS} 0`,
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}),
previewContent: css({
display: 'flex',
alignContent: 'center'
variationContainer: css({
marginTop: tokens.spacingXl
}),
variationTitle: css({
small: {
color: tokens.colorTextLight,
fontWeight: tokens.fontWeightNormal,
marginLeft: tokens.spacingXs,
fontSize: tokens.fontSizeL
}
}),
variationDescription: css({
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
color: tokens.colorTextLight,
marginTop: tokens.spacingXs
}),
entryCard: css({
marginTop: tokens.spacingM
}),
missingNote: css({
marginTop: tokens.spacingM
})
};
function getPercentOfTraffic(variation) {
return Math.floor(variation.weight) / 100;
}
function useEntryCard(id) {
const sdk = useContext(SDKContext);
transition: `opacity ${tokens.transitionDurationDefault} ${tokens.transitionEasingDefault}`,
svg: css({
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
})
}),
errorImage: css({
backgroundColor: tokens.colorElementLightest,
width: '100%',
height: '40px',
position: 'relative',
zIndex: -1,
svg: css({
fill: tokens.colorTextLight,
width: '100%',
height: '50%',
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
})
})
};
export const ProductSelectionListItem = (props: Props) => {
const [imageHasLoaded, setImageHasLoaded] = useState(false);
const [imageHasErrored, setImageHasErrored] = useState(false);
const { product, selectProduct } = props;
const productIsMissing = !product.name;
Note,
TextLink
} from '@contentful/forma-36-react-components';
import tokens from '@contentful/forma-36-tokens';
import { SDKContext, GlobalStateContext } from './all-context';
import VariationSelect from './variation-select';
import VariationStats from './variations-stats';
import { getAdditionalEntryInformation } from './utils';
const styles = {
variationContainer: css({
marginTop: tokens.spacingXl
}),
variationTitle: css({
small: {
color: tokens.colorTextLight,
fontWeight: tokens.fontWeightNormal,
marginLeft: tokens.spacingXs,
fontSize: tokens.fontSizeL
}
}),
variationDescription: css({
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
color: tokens.colorTextLight,
marginTop: tokens.spacingXs
}),
entryCard: css({
marginTop: tokens.spacingM
}),
missingNote: css({
import React from 'react';
import PropTypes from 'prop-types';
import { css } from 'emotion';
import tokens from '@contentful/forma-36-tokens';
import { Button, ValidationMessage } from '@contentful/forma-36-react-components';
import { normalizeMessage, isOutOfOrder, isDuplicate, messageToState } from './message-processor';
import { createPubSub } from './pubnub-client';
import { EVENT_TRIGGERED, EVENT_TRIGGER_FAILED } from '../constants';
const styles = {
info: css({
color: tokens.colorTextLight,
marginTop: tokens.spacingS,
marginBottom: tokens.spacingM,
fontSize: tokens.fontSizeS,
fontWeight: tokens.fontWeightNormal
}),
header: css({
display: 'flex',
marginBottom: tokens.spacingS
})
};
export default class NeflifySidebarBuildButton extends React.Component {
static propTypes = {
site: PropTypes.object.isRequired,
users: PropTypes.arrayOf(PropTypes.object.isRequired).isRequired,
userId: PropTypes.string.isRequired
}),
background: css({
display: 'block',
position: 'absolute',
zIndex: '-1',
top: '0',
width: '100%',
height: '300px',
backgroundColor: '#bcc3ca'
}),
featuresListItem: css({
listStyleType: 'disc',
marginLeft: tokens.spacingM
}),
light: css({
color: tokens.colorTextLight,
marginTop: tokens.spacingM
}),
logo: css({
width: '100%',
display: 'flex',
justifyContent: 'center',
marginTop: tokens.spacingXl,
marginBottom: tokens.spacingXl
})
};
export default class AppPage extends React.Component {
static propTypes = {
openAuth: PropTypes.func.isRequired,
accessToken: PropTypes.string,
client: PropTypes.object,
import tokens from '@contentful/forma-36-tokens';
export const styles = {
header: css({
display: 'flex',
justifyContent: 'space-between',
padding: tokens.spacingL
}),
body: css({
height: 'calc(100vh - 140px)',
overflowY: 'auto',
padding: `${tokens.spacingL} ${tokens.spacingL} 0 ${tokens.spacingL}`
}),
total: css({
fontSize: tokens.fontSizeS,
color: tokens.colorTextLight,
display: 'block',
marginTop: tokens.spacingS
}),
saveBtn: css({
marginRight: tokens.spacingM
}),
paginator: css({
margin: `${tokens.spacingM} auto ${tokens.spacingL} auto`,
textAlign: 'center'
}),
leftsideControls: css({
position: 'relative',
zIndex: 0,
svg: css({
zIndex: 1,
position: 'absolute',
boxShadow: '0 2px 4px 0 rgba(14,30,37,.12)',
cursor: 'pointer',
fontSize: '16px',
boxSizing: 'border-box'
}),
splitter: css({
marginTop: tokens.spacingL,
marginBottom: tokens.spacingL,
border: 0,
height: '1px',
backgroundColor: tokens.colorElementMid
}),
connectAgain: css({
marginTop: tokens.spacingXs,
textAlign: 'center',
color: tokens.colorTextLight
}),
connectAgainIcon: css({
fill: tokens.colorTextLight,
marginRight: tokens.spacingXs,
verticalAlign: 'middle'
})
};
export default class NetlifyConnection extends React.Component {
static propTypes = {
connected: PropTypes.bool.isRequired,
hasConfig: PropTypes.bool.isRequired,
email: PropTypes.string,
netlifyCounts: PropTypes.shape({
buildable: PropTypes.number.isRequired,
unavailable: PropTypes.number.isRequired
boxSizing: 'border-box'
}),
splitter: css({
marginTop: tokens.spacingL,
marginBottom: tokens.spacingL,
border: 0,
height: '1px',
backgroundColor: tokens.colorElementMid
}),
connectAgain: css({
marginTop: tokens.spacingXs,
textAlign: 'center',
color: tokens.colorTextLight
}),
connectAgainIcon: css({
fill: tokens.colorTextLight,
marginRight: tokens.spacingXs,
verticalAlign: 'middle'
})
};
export default class NetlifyConnection extends React.Component {
static propTypes = {
connected: PropTypes.bool.isRequired,
hasConfig: PropTypes.bool.isRequired,
email: PropTypes.string,
netlifyCounts: PropTypes.shape({
buildable: PropTypes.number.isRequired,
unavailable: PropTypes.number.isRequired
}),
onConnectClick: PropTypes.func.isRequired
};