diff --git a/public/assets/js/navBarFunctions.js b/public/assets/js/navBarFunctions.js index e405d70d..84d483ac 100644 --- a/public/assets/js/navBarFunctions.js +++ b/public/assets/js/navBarFunctions.js @@ -7,8 +7,8 @@ function toggleNavBarSelection (value) { window.location.href = '/logout'; } else if (selectedOption === 'VIEW') { // get channel info - const channelName = getCookie('channel_name'); - const channelClaimId = getCookie('channel_claim_id'); + const channelName = getCookie('CHANNEL_NAME'); + const channelClaimId = getCookie('CHANNEL_LONG_ID'); // redirect to channel page window.location.href = `/${channelName}:${channelClaimId}`; } diff --git a/react/components/ActiveStatusBar.jsx b/react/components/ActiveStatusBar.jsx new file mode 100644 index 00000000..a5cb7aed --- /dev/null +++ b/react/components/ActiveStatusBar.jsx @@ -0,0 +1,7 @@ +import React from 'react'; + +function ActiveStatusBar () { + return | ; +} + +export default ActiveStatusBar; diff --git a/react/components/InactiveStatusBar.jsx b/react/components/InactiveStatusBar.jsx new file mode 100644 index 00000000..f4422d9a --- /dev/null +++ b/react/components/InactiveStatusBar.jsx @@ -0,0 +1,7 @@ +import React from 'react'; + +function InactiveStatusBar () { + return | ; +} + +export default InactiveStatusBar(); diff --git a/react/components/Logo.jsx b/react/components/Logo.jsx new file mode 100644 index 00000000..7bc4dd36 --- /dev/null +++ b/react/components/Logo.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +function Logo () { + return ( + + + Logo + Spee.ch logo + + + + Spee<h + + + + + + + + + + + + + ); +}; + +export default Logo; diff --git a/react/components/NavBarChannelDropdown.jsx b/react/components/NavBarChannelDropdown.jsx new file mode 100644 index 00000000..4d9a88fa --- /dev/null +++ b/react/components/NavBarChannelDropdown.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +function Logo ({ channelName, handleSelection, VIEW, LOGOUT }) { + return ( + + ); +}; + +export default Logo; diff --git a/react/components/ProgressBar.jsx b/react/components/ProgressBar.jsx index 33b49182..be3d810b 100644 --- a/react/components/ProgressBar.jsx +++ b/react/components/ProgressBar.jsx @@ -1,13 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; - -function ActiveBar () { - return | ; -} - -function InactiveBar () { - return | ; -} +import ActiveStatusBar from 'components/ActiveStatusBar'; +import InactiveStatusBar from 'components/InactiveStatusBar'; class ProgressBar extends React.Component { constructor (props) { @@ -70,7 +64,7 @@ class ProgressBar extends React.Component { render () { return (
- {this.state.bars.map((bar, index) => bar.isActive ? : )} + {this.state.bars.map((bar, index) => bar.isActive ? : )}
); } diff --git a/react/containers/NavBar/view.jsx b/react/containers/NavBar/view.jsx index 46c663d1..fe2538e4 100644 --- a/react/containers/NavBar/view.jsx +++ b/react/containers/NavBar/view.jsx @@ -1,34 +1,11 @@ import React from 'react'; import { getUserCookies, clearUserCookies } from 'utils/cookies'; +import Logo from 'components/Logo'; +import NavBarChannelDropdown from 'components/NavBarChannelDropdown'; const VIEW = 'VIEW'; const LOGOUT = 'LOGOUT'; -function Logo () { - return ( - - - Logo - Spee.ch logo - - - - Spee<h - - - - - - - - - - - - - ); -} - class NavBar extends React.Component { constructor (props) { super(props); @@ -36,6 +13,7 @@ class NavBar extends React.Component { this.handleSelection = this.handleSelection.bind(this); } componentDidMount () { + // check to see if the user is already logged in this.checkForLoggedInUser(); } checkForLoggedInUser () { @@ -48,7 +26,9 @@ class NavBar extends React.Component { } } handleSelection (event) { + console.log('handling selection', event) const value = event.target.selectedOptions[0].value; + console.log('value', value); switch (value) { case LOGOUT: // remove session cookies @@ -73,14 +53,15 @@ class NavBar extends React.Component { Open-source, decentralized image and video sharing.
- Publish + Publish About { this.props.channelName ? ( - + ) : ( Channel )}