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

Upgrade Deps #35

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import ReactDOM from 'react-dom'
import App from './components/app'
import Menu from './components/menu'
Expand Down
8 changes: 3 additions & 5 deletions components/admin/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { Component } from 'react'
import { Component } from 'react'
import { store } from '../../client.js'
import Local from '../connection/local.js'
import Radium from 'radium'

@Radium
export default class Admin extends Component {
constructor() {
super()
Expand Down Expand Up @@ -50,7 +48,7 @@ export default class Admin extends Component {
render() {
return (
<figure
style={[
css={[
styles.drop,
this.props.admin.display || this.state.dragging
? styles.show
Expand All @@ -63,7 +61,7 @@ export default class Admin extends Component {
onDragLeave={this.handleDragLeave}
onDrop={this.handleDrop}
>
<span style={styles.span}>Drop music collection here</span>
<span css={styles.span}>Drop music collection here</span>
</figure>
)
}
Expand Down
11 changes: 5 additions & 6 deletions components/app/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import { Global } from '@emotion/react'
import Loading from '../loading'
import Admin from '../admin'
import Bar from '../bar'
Expand All @@ -7,11 +7,10 @@ import Status from '../status'
import Library from '../library'
import Showcase from '../showcase'
import Playbar from '../playbar'
import Radium, { StyleRoot, Style } from 'radium'

const App = props => (
<StyleRoot>
<Style rules={styles} />
<main>
<Global styles={styles} />
<Bar />
<Admin admin={props.admin} />
<Library library={props.library} player={props.player} />
Expand All @@ -24,10 +23,10 @@ const App = props => (
admin={props.admin}
metadata={props.metadata}
/>
</StyleRoot>
</main>
)

export default Radium(App)
export default App

const styles = {
html: {
Expand Down
7 changes: 2 additions & 5 deletions components/bar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react'
import Radium from 'radium'
const Bar = () => <nav css={styles.base} />

const Bar = () => <nav style={styles.base} />

export default Radium(Bar)
export default Bar

const styles = {
base: {
Expand Down
7 changes: 2 additions & 5 deletions components/button/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react'
import Radium from 'radium'

const Button = props => (
<button
style={[styles.base, props.disabled && styles.disabled]}
css={[styles.base, props.disabled && styles.disabled]}
type={props.type}
onClick={props.callback}
disabled={props.disabled}
Expand Down Expand Up @@ -42,4 +39,4 @@ const styles = {
}
}

export default Radium(Button)
export default Button
8 changes: 3 additions & 5 deletions components/close-button/index.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import React from 'react'
import Radium from 'radium'
import { store } from '../../client.js'

const CloseButton = props => (
<div
style={styles.base}
css={styles.base}
onClick={() => {
store.dispatch({ type: 'ESCAPE' })
if (props.onClick) props.onClick()
}}
>
<svg style={styles.svg} viewBox="0 0 63.8 63.7">
<svg css={styles.svg} viewBox="0 0 63.8 63.7">
<path d="M61.3 63.7c-.6 0-1.3-.2-1.8-.7L.7 4.3c-1-1-1-2.6 0-3.5 1-1 2.6-1 3.5 0L63 59.5c1 1 1 2.6 0 3.5-.5.5-1.1.7-1.7.7z" />
<path d="M2.5 63.7c-.6 0-1.3-.2-1.8-.7-1-1-1-2.6 0-3.5L59.5.7c1-1 2.6-1 3.5 0 1 1 1 2.6 0 3.5L4.3 63c-.5.5-1.2.7-1.8.7z" />
</svg>
</div>
)

export default Radium(CloseButton)
export default CloseButton

const styles = {
base: {
Expand Down
4 changes: 2 additions & 2 deletions components/fuzz/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import ReactDOM from 'react-dom'
const paper = require('paper/dist/paper-full')

Expand Down Expand Up @@ -61,7 +61,7 @@ export default class Fuzz extends Component {
id="oscilloscope"
height="100%"
width="100%"
style={{
css={{
opacity: 0.8,
width: '100%',
pointerEvents: 'none',
Expand Down
13 changes: 5 additions & 8 deletions components/input/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React from 'react'
import Radium from 'radium'

const Input = props => (
<div style={styles.base}>
<div style={{ padding: '0 .5em' }}>
{props.label && <label style={styles.label}>{props.label}</label>}
<div css={styles.base}>
<div css={{ padding: '0 .5em' }}>
{props.label && <label css={styles.label}>{props.label}</label>}
<input
type={props.type || 'text'}
style={styles.input}
css={styles.input}
required={props.required}
value={props.value}
onChange={props.onChange}
Expand All @@ -17,7 +14,7 @@ const Input = props => (
</div>
)

export default Radium(Input)
export default Input

const styles = {
base: {
Expand Down
12 changes: 5 additions & 7 deletions components/library/album.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { Component } from 'react'
import { Component } from 'react'
import ReactDOM from 'react-dom'
import Radium from 'radium'
import { store } from '../../client.js'
import { rafThrottle } from '../utilities'
import shallowCompare from 'react-addons-shallow-compare'
import inView from 'in-view'

@Radium
export default class Album extends Component {
constructor(props) {
super()
Expand Down Expand Up @@ -50,18 +48,18 @@ export default class Album extends Component {
onClick={this.handleClick}
onMouseOver={this.activate}
onMouseOut={this.reset}
style={[
css={[
styles.base,
this.props.newest ? { order: this.props.album.time } : { order: -2 }
]}
>
<div style={this.state.fade ? styles.fade : styles.nonfade}>
<div css={this.state.fade ? styles.fade : styles.nonfade}>
<div
ref="album"
style={[styles.cover, cover, this.state.active ? styles.zoom : '']}
css={[styles.cover, cover, this.state.active ? styles.zoom : '']}
/>
</div>
<span style={[this.state.active ? styles.active : '']}>
<span css={[this.state.active ? styles.active : '']}>
{this.props.album.artist + ' - ' + this.props.album.title}
</span>
</li>
Expand Down
26 changes: 12 additions & 14 deletions components/library/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { Component } from 'react'
import { Component } from 'react'
import Album from './album.jsx'
import Radium from 'radium'
import shallowCompare from 'react-addons-shallow-compare'
import { store } from '../../client.js'

@Radium
export default class Library extends Component {
componentDidMount() {
if (localStorage.getItem('newest') === 'true')
Expand All @@ -18,7 +16,7 @@ export default class Library extends Component {
return (
<ul
ref="library"
style={[
css={[
styles.base,
this.props.player.track
? { padding: '12.5vh 0 33vh' }
Expand All @@ -36,16 +34,16 @@ export default class Library extends Component {
/>
)
})}
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li style={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
<li css={styles.li} />
</ul>
)
}
Expand Down
9 changes: 3 additions & 6 deletions components/loading/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React from 'react'
import Radium from 'radium'

const Loading = props => (
<section
style={[styles.base, props.loading.display ? styles.show : styles.hide]}
css={[styles.base, props.loading.display ? styles.show : styles.hide]}
>
<span style={styles.span}>{props.loading.message}</span>
<span css={styles.span}>{props.loading.message}</span>
</section>
)

export default Radium(Loading)
export default Loading

const styles = {
base: {
Expand Down
22 changes: 10 additions & 12 deletions components/playbar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { Component } from 'react'
import Radium from 'radium'
import { Component } from 'react'
import ReactDOM from 'react-dom'
import shallowCompare from 'react-addons-shallow-compare'
import { rafThrottle } from '../utilities'

@Radium
export default class Playbar extends Component {
constructor() {
super()
Expand Down Expand Up @@ -40,14 +38,14 @@ export default class Playbar extends Component {
render() {
return (
<div
style={[
css={[
styles.playbar,
this.props.playbar.display ? styles.show : styles.hide
]}
>
<audio id="xxx" />
<div
style={{
css={{
position: 'relative',
height: 40,
width: '100%',
Expand All @@ -58,24 +56,24 @@ export default class Playbar extends Component {
onMouseLeave={() => this.setState({ hover: false })}
onClick={this.scan}
>
<div data-range style={styles.range} />
<div data-buffer style={styles.buffer} />
<div data-range css={styles.range} />
<div data-buffer css={styles.buffer} />
<div
style={[
css={[
styles.slider,
this.state.hover ? { opacity: 1 } : { opacity: 0 },
{ transform: `translateX(${this.state.left}px)` || 0 }
]}
/>
</div>
<div style={styles.panel}>
<span style={styles.span} key="previous" onClick={this.previous}>
<div css={styles.panel}>
<span css={styles.span} key="previous" onClick={this.previous}>
previous
</span>
<span style={styles.span} key="toggle" onClick={this.toggle}>
<span css={styles.span} key="toggle" onClick={this.toggle}>
{this.props.playbar.toggle}
</span>
<span style={styles.span} key="next" onClick={this.next}>
<span css={styles.span} key="next" onClick={this.next}>
next
</span>
</div>
Expand Down
8 changes: 3 additions & 5 deletions components/search/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { Component } from 'react'
import { Component } from 'react'
import key from 'key'
import Radium from 'radium'
import shallowCompare from 'react-addons-shallow-compare'
import CloseButton from '../close-button'
import { store } from '../../client.js'

@Radium
export default class Search extends Component {
constructor() {
super()
Expand Down Expand Up @@ -33,7 +31,7 @@ export default class Search extends Component {
render() {
return (
<form
style={[
css={[
styles.search,
this.props.search.display ? styles.show : styles.hide
]}
Expand All @@ -43,7 +41,7 @@ export default class Search extends Component {
ref="search"
type="text"
value={this.props.search.input}
style={styles.input}
css={styles.input}
onChange={this.handleSearch}
/>
</form>
Expand Down
Loading