473,416 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Failed to compile. Attempted import error: 'updateMoviePictureUrls'

10 Byte
./src/modules/movie-browser/movie-modal/movie-modal.container.js
Attempted import error: 'updateMoviePictureUrls' is not exported from '../movie-browser.helper' (imported as 'movieHelpers').


movie-browser.helper.js code
const TMDB_IMAGE_BASE_URL = (width = 300) => `https://image.tmdb.org/t/p/w$(width)`;

const updateMoviePictureUrls = (movieResult, width = 300) => ({
...movieResult,
backdrop_path: `${TMDB_IMAGE_BASE_URL(width)}${movieResult.backdr op_path}`,
poster_path: `${TMDB_IMAGE_BASE_URL(width)}${movieResult.poster _path}`,
});

export const getMoviesList = (moviesRes) => {
return !!moviesRes ? ([
...moviesRes.results.map(movieResult => updateMoviePictureUrls(movieResult))
]) : null;
}

movie-modal.container.js code
import React from 'react';
import {connect} from 'react-redux';
import { Dialog } from 'material-ui';
import _ from 'lodash';
import { closeMovieModal } from './movie-modal.actions';
import { getMovieDetails } from '../movie-browser.actions';
import * as movieHelpers from '../movie-browser.helper';
import Loader from '../../common/loader.component';

render() {
const {isOpen, closeMovieModal, isLoading} = this.props;
// const loadingStatus = isLoading ? 'loading' : 'hide';
const movie = movieHelpers.updateMoviePictureUrls(this.props.mov ie);
const genres = (movie && movie.genres) ? movie.genres.map(genre => genre.name).join(', ') : '';

return (
<Dialog
autoScrollBodyContent={true}
title={null}
modal={false}
open={isOpen}
onRequestClose={closeMovieModal}
>
<Loader isLoading={isLoading}>
<div style={styles.dialogContent(movie.backdrop_path)}>
<h1>{movie.title}</h1>
<h5>{genres}</h5>
<p>{movie.overview}</p>
<p>Popularity: {movie.popularity}</p>
<p>Budget: ${movie.budget}</p>
</div>
</Loader>
</Dialog>
);
}
}

export default connect(
(state) => ({
isOpen: _.get(state, 'movieBrowser.movieModal.isOpen', false),
movieId: _.get(state, 'movieBrowser.movieModal.movieId'),
movie: _.get(state, 'movieBrowser.movieDetails.res', {}),
isLoading: _.get(state, 'movieBrowser.movieDetails.isLoading', false),
}),
{ closeMovieModal, getMovieDetails }
)(MovieModalContainer);
Oct 21 '20 #1
0 2965

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Markus Doering | last post by:
Hello, I just switched from 2.2 to Python 2.3. I am developing an XML/CGI interface to databases as a python package called "unitWrapper" containing several modules which ran fine under v2.2. ...
0
by: Carl | last post by:
Does anyone know what I can do to resolve this problem I have tried everything. I have an identical package and procedure on a different database that works fine. Request Failed...
3
by: Eamonn O'Connell | last post by:
Hi, We have an ASP.net application, where we dynamically add controls, in the Page_Load. Occasionally, when the user posts back the page (e.g. clicks Save button on the page), we get a "Failed...
4
by: Steve | last post by:
I'm trying to run a Python program on Unix and I'm encountering some behavior I don't understand. I'm a Unix newbie, and I'm wondering if someone can help. I have a simple program:...
2
by: mike_li | last post by:
CLI connection failed. SQL0902C. A system error (reasoncode="6029321") occurred. Subsequent SQL statements cannot be processed. SQLSTATE=58005. Has anyone encountered the above error? We are...
10
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an...
3
by: Neter Smith | last post by:
I have run into a problem when trying to import a WSDL reference under VS 2003 and 1.1 of the framework. It appears as if it is in the generation of the proxy that things are failing. When I...
0
by: Michael Boldin via alt email | last post by:
I installed python 2.5 and used the win package for installing MySQLdb. (Iam running Windows XP) Everything works as expected using python directly (Windows command shell) but using IDLE gives the...
1
by: umeshchitta | last post by:
Hi All, Iam getting below error when I click on of the button from front end. Front end pages are developed in PLSQL code. Procedure which is performing button action...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.