Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Replace navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
e-jigsaw committed Jan 7, 2016
1 parent a20ccc2 commit f910bf8
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 77 deletions.
98 changes: 67 additions & 31 deletions src/components/Menu.ls
Original file line number Diff line number Diff line change
@@ -1,54 +1,90 @@
require! {
react: {Component, DOM, create-element}
\lodash.assign : assign
}

class Menu extends Component
styles:
anchor:
color: \#fff
button:
padding: '12px 12px'
background-color: 'rgba(0, 0, 0, 0.3)'
container:
position: \fixed
will-change: \transform
bottom: \5%
right: 0
left: 0
text-align: \center
font-size: \36px
z-index: 1000

render: ->
DOM.div do
style:
position: \fixed
will-change: \transform
bottom: \5%
right: \5%
font-size: \36px
background-color: 'rgba(0, 0, 0, 0.3)'
color: \#fff
padding: '5px 10px'
z-index: 1000
style: @styles.container
switch @props.route
| \config =>
DOM.i do
style:
margin: '0px 10px'
className: 'fa fa-close'
DOM.a do
style: @styles.anchor
href: \#
on-click: @props.move-sessions
DOM.i do
style: @styles.button
className: 'fa fa-close'
| \session =>
[
DOM.i do
DOM.a do
key: \menu-prev
style: @styles.anchor
href: \#
on-click: @props.prev-post
DOM.i do
style: @styles.button
className: 'fa fa-arrow-left'
DOM.a do
key: \menu-reblog
style:
margin: '0px 10px'
className: 'fa fa-retweet'
style: @styles.anchor
href: \#
on-click: @props.reblog
DOM.i do
DOM.i do
style: @styles.button
className: 'fa fa-retweet'
DOM.a do
key: \menu-like
style:
margin: '0px 10px'
color: if @props.liked then \#BC523C else \#fff
className: 'fa fa-heart'
style: @styles.anchor
href: \#
on-click: @props.like
DOM.i do
DOM.i do
style:
assign do
@styles.button
color: if @props.liked then \#BC523C else \#fff
className: 'fa fa-heart'
DOM.a do
key: \menu-back
style:
margin: '0px 10px'
className: 'fa fa-clone'
style: @styles.anchor
href: \#
on-click: @props.move-sessions
DOM.i do
style: @styles.button
className: 'fa fa-clone'
DOM.a do
key: \menu-next
style: @styles.anchor
href: \#
on-click: @props.next-post
DOM.i do
style: @styles.button
className: 'fa fa-arrow-right'
]
| \sessions =>
DOM.i do
style:
margin: '0px 10px'
className: 'fa fa-cog'
DOM.a do
style: @styles.anchor
href: \#
on-click: @props.move-config
DOM.i do
style: @styles.button
className: 'fa fa-cog'

module.exports = Menu
39 changes: 0 additions & 39 deletions src/components/Navigator.ls

This file was deleted.

5 changes: 3 additions & 2 deletions src/components/Rblg.ls
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Rblg extends Component
position: \absolute
top: 0
left: 0
margin-bottom: \30%
create-element do
Notification
ref: \notification
Expand All @@ -50,6 +51,8 @@ class Rblg extends Component
move-session: ~> @props.dispatch set-route \session
reblog: ~> @props.dispatch reblog!
like: ~> @props.dispatch like!
next-post: ~> @props.dispatch next-post!
prev-post: ~> @props.dispatch prev-post!
switch @props.route
| \sessions =>
create-element do
Expand All @@ -64,8 +67,6 @@ class Rblg extends Component
create-element do
Session
session: @props.current-session
next-post: ~> @props.dispatch next-post!
prev-post: ~> @props.dispatch prev-post!
| \config =>
create-element do
User
Expand Down
5 changes: 0 additions & 5 deletions src/components/Session.ls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ require! {
react: {Component, DOM, create-element}
\lodash.assign : assign
\./Posts.ls
\./Navigator.ls
}

class Session extends Component
Expand Down Expand Up @@ -34,9 +33,5 @@ class Session extends Component
create-element do
Posts
session: @props.session
create-element do
Navigator
next-post: @props.next-post
prev-post: @props.prev-post

module.exports = Session

0 comments on commit f910bf8

Please sign in to comment.