Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete button works for all edit profile video dialogs #102

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/presentation/locationProfile/EditLocationProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ class EditLocationProfile extends React.Component {
const locationLinks = get(locationProfile, 'links', [])
const isPublic = get(locationProfile, 'public', false)
const video = get(locationProfile, 'video', '')[0]
let videoType = 0
if (video) videoType = video.url.indexOf('youtube') > -1 ? 1 : 2 // 1 for Youtube, 2 for Vimeo

const addLinkActions = [
<FlatButton
Expand Down Expand Up @@ -483,7 +481,7 @@ class EditLocationProfile extends React.Component {
editLocationVideo(video, values.title, values.url, locationId)
}}
onDelete={() => {
removeLocationVideo(video, videoType, locationId)
removeLocationVideo(video, locationId)
this.handleEditVideoClose()
}}
initialValues={{ title: video.title, url: video.url }}
Expand Down
6 changes: 2 additions & 4 deletions src/presentation/profile/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ class EditProfile extends React.Component {
const name = `${get(profile, 'firstName', '')} ${get(profile, 'lastName', '')}`
const isPublic = get(profile, 'public', false)
const video = get(userProfile, 'video', '')[0]
let videoType = 0
if (video) videoType = video.url.indexOf('youtube') > -1 ? 1 : 2 // 1 for Youtube, 2 for Vimeo

const addYoutubeActions = [
<FlatButton
Expand Down Expand Up @@ -606,7 +604,7 @@ class EditProfile extends React.Component {
editVideo(video, values.title, values.url, uid)
}}
onDelete={() => {
removeVideo(video, videoType, uid)
removeVideo(video, uid)
this.handleEditVideoClose()
}}
initialValues={{ title: video.title, url: video.url }}
Expand Down Expand Up @@ -676,7 +674,7 @@ class EditProfile extends React.Component {
</div>
<div className="credits">
{ associatedCredits.map(credit => (
<div>
<div key={credit.title}>
<div style={{ textAlign: 'left', display: 'flex', alignItems: 'center' }} key={credit.title}>
{credit.year}{credit.genre ? ` (${credit.genre})` : ''} : {credit.title}
<div>
Expand Down
7 changes: 2 additions & 5 deletions src/presentation/vendorProfile/EditVendorProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ class EditVendorProfile extends React.Component {
const vendorLinks = get(vendorProfile, 'links', [])
const isPublic = get(vendorProfile, 'public', false)
const video = get(vendorProfile, 'video', '')[0]
let videoType = 0
if(video) videoType = video.url.indexOf("youtube") > -1 ? 1 : 2 // 1 for Youtube, 2 for Vimeo

const profileImageUrl = get(vendorProfile, 'profileImage', 'https://images.vexels.com/media/users/3/144866/isolated/preview/927c4907bbd0598c70fb79de7af6a35c-business-building-silhouette-by-vexels.png')
const addLinkActions = [
Expand Down Expand Up @@ -591,7 +589,7 @@ class EditVendorProfile extends React.Component {
editVendorVideo(video, values.title, values.url, vendorId)
}}
onDelete={() => {
removeVendorVideo(video, videoType, vendorId)
removeVendorVideo(video, vendorId)
this.handleEditVideoClose()
}}
initialValues={{ title: video.title, url: video.url }}
Expand Down Expand Up @@ -637,7 +635,7 @@ class EditVendorProfile extends React.Component {
}
</Card>
</div>

</div>
)
}
Expand Down Expand Up @@ -681,4 +679,3 @@ const EditVendorProfileFormEnriched = reduxForm({
})(EditVendorProfile)

export default EditVendorProfileFormEnriched