diff --git a/server/proxies.json b/server/proxies.json index 15605d4ec..063fb3fc2 100644 --- a/server/proxies.json +++ b/server/proxies.json @@ -2,11 +2,12 @@ { "root": "/", "paths": [ - "/accounts/", "/accounts/", "/csrf_token/", + "/fragment/", "/get_image/", - "/session/" + "/session/", + "/static/" ] } ] diff --git a/src/_mixins.scss b/src/_mixins.scss new file mode 100644 index 000000000..c49101e79 --- /dev/null +++ b/src/_mixins.scss @@ -0,0 +1,19 @@ +@mixin modal-iframe($iframe-width, $iframe-height, $padding: 0) { + &.ReactModal__Content { + top: 50%; + right: auto; + bottom: auto; + left: 50%; + margin-top: -($iframe-height + $padding * 2)/2; + margin-left: -($iframe-width + $padding * 2)/2; + padding: $padding; + width: $iframe-width; + height: $iframe-height; + + iframe { + border: 0; + width: $iframe-width; + height: $iframe-height; + } + } +} diff --git a/src/components/intro/intro.scss b/src/components/intro/intro.scss index 39aeb4feb..27c9d986a 100644 --- a/src/components/intro/intro.scss +++ b/src/components/intro/intro.scss @@ -1,4 +1,5 @@ @import "../../colors"; +@import "../../mixins"; .intro { display: flex; @@ -224,22 +225,5 @@ } .video-modal { - $video-width: 570px; - $video-height: 357px; - $padding: 15px; - top: 50%; - right: auto; - bottom: auto; - left: 50%; - margin-top: -($video-height + $padding * 2)/2; - margin-left: -($video-width + $padding * 2)/2; - padding: $padding; - width: $video-width; - height: $video-height; - - iframe { - border: 0; - width: $video-width; - height: $video-height; - } + @include modal-iframe(570px, 357px, 15px); } diff --git a/src/components/navigation/navigation.jsx b/src/components/navigation/navigation.jsx index 9b4ff9a48..6c3181357 100644 --- a/src/components/navigation/navigation.jsx +++ b/src/components/navigation/navigation.jsx @@ -11,6 +11,7 @@ var Avatar = require('../avatar/avatar.jsx'); var Dropdown = require('./dropdown.jsx'); var Input = require('../forms/input.jsx'); var Login = require('../login/login.jsx'); +var Registration = require('../registration/registration.jsx'); require('./navigation.scss'); @@ -22,9 +23,10 @@ var Navigation = React.createClass({ ], getInitialState: function () { return { + 'accountNavOpen': false, 'loginOpen': false, 'loginError': null, - 'accountNavOpen': false + 'registrationOpen': false }; }, componentDidUpdate: function (prevProps, prevState) { @@ -39,6 +41,10 @@ var Navigation = React.createClass({ if (!this.state.session.user) return; return '/users/' + this.state.session.user.username + '/'; }, + handleJoinClick: function (e) { + e.preventDefault(); + this.setState({'registrationOpen': true}); + }, handleLoginClick: function (e) { e.preventDefault(); this.setState({'loginOpen': !this.state.loginOpen}); @@ -87,6 +93,9 @@ var Navigation = React.createClass({ closeAccountNav: function () { this.setState({'accountNavOpen': false}); }, + closeRegistration: function () { + this.setState({'registrationOpen': false}); + }, render: function () { var classes = classNames({ 'inner': true, @@ -136,7 +145,13 @@ var Navigation = React.createClass({ ] : [ -