show dbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { DndProvider } from 'react-dnd'; | |
import { HTML5Backend } from 'react-dnd-html5-backend'; | |
import { connect } from 'react-redux' | |
import ShoppingCart from './ShoppingCart' | |
import MyCart from './MyCart' | |
import DisplayPhone from './DisplayPhone' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShoppingCart extends Component{ | |
render(){ | |
const { canDrop, isOver, connectDropTarget } = this.props; | |
const isActive = canDrop && isOver; | |
let backgroundColor = '#FFFFFF'; | |
if (isActive){ | |
backgroundColor ='#F7F7BD'; | |
} else if (canDrop){ | |
backgroundColor = '#F7F7F7'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Phone extends Component{ | |
render(){ | |
const { brand } = this.props; | |
const { isDragging, connectDragSource } = this.props; | |
const opacity = isDragging? 0.4: 1; | |
const style={ | |
opacity: opacity | |
}; | |
const phoneClass = isDragging? 'ui card phone drag': 'ui card phone'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { DndProvider } from 'react-dnd'; | |
import { HTML5Backend } from 'react-dnd-html5-backend'; | |
import Phone from './Phone' | |
import ShoppingCart from './ShoppingCart' | |
import MyCart from './MyCart' | |
class Container extends Component { | |
render(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class MyCart extends Component { | |
render(){ | |
return( | |
<div> | |
<div class="ui cards"> | |
<div class="ui card centered"> | |
<div class="content"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Phone from './Phone' | |
import ShoppingCart from './ShoppingCart' | |
import MyCart from './MyCart' | |
class Container extends Component { | |
render(){ | |
const { phones } = this.props | |
return( | |
<div class="ui container"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Phone from './Phone' | |
import ShoppingCart from './ShoppingCart' | |
class Container extends Component { | |
render(){ | |
const { phones } = this.props | |
return( | |
<div className='container'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux' | |
import '../index.css' | |
import { _getPhones } from '../utils/_DATA' | |
import { receivePhones } from '../actions/phones' | |
import Container from './container' | |
class App extends Component { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def text_wrap(text, font, max_width): | |
"""Wrap text base on specified width. | |
This is to enable text of width more than the image width to be display | |
nicely. | |
@params: | |
text: str | |
text to wrap | |
font: obj | |
font of the text |
NewerOlder