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 Video from 'react-native-video'; | |
// From documentation | |
<Video source={{uri: "background"}} // Can be a URL or a local file. | |
ref={(ref) => { | |
this.player = ref | |
}} // Store reference | |
rate={1.0} // 0 is paused, 1 is normal. | |
volume={1.0} // 0 is muted, 1 is normal. | |
muted={false} // Mutes the audio entirely. |
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 Sound from 'react-native-sound'; | |
const sound = new Sound('http://sounds.com/some-sound', null, (error) => { | |
if (error) { | |
// do something | |
} | |
// play when loaded | |
sound.play(); | |
}); |
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
// component props mock | |
const properties = { | |
color: 'red', | |
large: true | |
}; | |
// curried function | |
const styled = (props) => (strings, ...args) => { | |
return strings.map((string, i) => { | |
const correspondingItem = args[i]; |
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
'font-size: 12px; background-color: ' + 'red' + ';' |
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
( | |
[ 'font-size: 12px ;background-color: ', ';' ], // first argument | |
(props => props.solid ? 'red' : 'blue') | |
) |
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
const log = (...args) => console.log(...args); | |
log('This', 'is', 'useless'); | |
// 'This', 'is', 'useless' | |
const name = 'Bob'; | |
log`Hi ${name}! How are you?`; | |
// ['Hi ', '! How are you?'], 'Bob' |
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
.header__text { | |
font-size: 24px; | |
color: wheat; | |
text-transform: uppercase; | |
&--large { | |
font-size: 32px; | |
} | |
} |
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 './HeaderText.scss'; | |
export default ({ | |
large, | |
children, | |
className, | |
...props | |
}) => { | |
const classList = `header__text ${large && 'header__text--large'} ${className}`; | |
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 styled from 'styled-components'; | |
const HeaderText = styled.h1` | |
font-size: ${ props => props.large ? 32 : 24 }px; | |
color: wheat; | |
text-transform: uppercase; | |
`; | |
export default () => ( | |
<HeaderText large>Looks Cool</HeaderText> |