Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{shouldLockEditing ? (
this.currentSessionText(article)
) : (
<h2>{this.publishText(article)}</h2>
)}
<a href="{`${forceURL}/article/${article.slug}`}">
{shouldLockEditing ? (
<span>
<span>Locked</span>
</span>
) : (
"View"
)}
</a>
)
})
}
getIconForType (type) {
switch (type) {
case 'lock': return
default: return null
}
}
align-items: center;
`
const ActionsContainer = styled.div`
margin-right: 20px;
`
const ActionButton = styled.button`
margin-right: 15px;
`
ActionButton.displayName = "ActionButton"
const RedirectText = styled.span`
${avantgarde("s11")};
text-transform: uppercase;
color: ${colors.grayMedium};
`
data-editing={editing}
data-layout={layout || 'column_width'}
data-type={type}
>
<div>
{!isHero &&
<div>
</div>
}
</div>
{this.getSectionComponent()}
<div>
</div>
)
}
}
align-items: center;
`
const ActionsContainer = styled.div`
margin-right: 20px;
`
const ActionButton = styled.button`
margin-right: 15px;
`
ActionButton.displayName = 'ActionButton'
const RedirectText = styled.span`
${Fonts.avantgarde('s11')};
text-transform: uppercase;
color: ${colors.grayMedium};
`
export class MessageModal extends Component {
static propTypes = {
type: PropTypes.oneOf(['locked', 'timeout']),
session: PropTypes.object,
onClose: PropTypes.func,
onTimerEnded: PropTypes.func
}
state = {
timeLeft: 10
}
componentDidMount () {
this.timer = setInterval(this.updateTimer, 1000)
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import moment from 'moment'
import styled from 'styled-components'
import { connect } from 'react-redux'
import colors from '@artsy/reaction/dist/Assets/Colors'
import { IconLock } from '@artsy/reaction/dist/Components/Publishing/Icon/IconLock'
import Icon from '@artsy/reaction/dist/Components/Icon'
const IconCheckCircle = styled(Icon)`
color: ${colors.grayMedium};
font-size: 30px;
&:hover {
color: black;
}
`
export class ArticleList extends Component {
static propTypes = {
display: PropTypes.string,
checkable: PropTypes.bool,
articles: PropTypes.array,
selected: PropTypes.func,
activeSessions: PropTypes.object,
user: PropTypes.object,
forceURL: PropTypes.string
return articles.map((article, i) => {
const attrs = this.getDisplayAttrs(article)
const session = activeSessions[article.id]
const isCurrentlyBeingEdited = session
const isCurrentUserEditing =
user && session && user.id === session.user.id
const style = isCurrentlyBeingEdited ? { color: colors.grayMedium } : null
const shouldLockEditing = isCurrentlyBeingEdited && !isCurrentUserEditing
const lockedClass = shouldLockEditing ? "locked" : ""
const missingData = `Missing ${isArtsyChannel ? "Magazine" : "Thumbnail"}`
return (
<div style="{style}">
{checkable && (
<div> this.props.selected(article)}
></div></div>
return articles.map(article => {
const attrs = this.getDisplayAttrs(article)
const session = activeSessions[article.id]
const isCurrentlyBeingEdited = session
const isCurrentUserEditing = user && session && user.id === session.user.id
const style = isCurrentlyBeingEdited ? {color: colors.grayMedium} : null
const shouldLockEditing = isCurrentlyBeingEdited && !isCurrentUserEditing
const lockedClass = shouldLockEditing ? 'locked' : ''
return (
<div style="{style}">
{checkable && <div> this.props.selected(article)}
>
</div>}
<a href="{`/articles/${article.id}/edit`}">
<div style="{attrs.image"></div></a></div>
<input value="{url}"> this.setState({url: e.target.value})}
placeholder='Paste or type a link'
onKeyUp={(e) => {
if (e.key === 'Enter') {
this.confirmLink(e)
}
}}
/>
{url.length > 0 &&
}
<button>
Apply
</button>
)
}
}
: <h1>Missing Title</h1>
}
{shouldLockEditing
? this.currentSessionText(article)
: <h2>{this.publishText(article)}</h2>
}
<a href="{`${forceURL}/article/${article.slug}`}">
{shouldLockEditing
? <span>
<span>Locked</span>
</span>
: 'View'}
</a>
)
})
}