Code Monkey home page Code Monkey logo

bp's People

Contributors

deal-disputes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bp's Issues

User profiles

User profiles

Profile Tabs

  • User feed
  • User groups
  • User images
  • User About

DashBoard menu group tab

Currently there are three dashboard menu tabs use for navigation these are Profile, Setting and Feed tab.
Create a new menu tab called group and placed it after the feed tab. This tab should be able to navigate to the MenuGroup component

Dashboard Menu

import React from 'react';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import { withRouter } from 'react-router-dom';
import './index.css';
class DashBoardMenu extends React.Component{
state = {
prevActiveElem: null
}
componentDidMount(){
const { location } = this.props;
const activeTab = location.pathname.split('/');
let elem = document.querySelector(`#\\\/${activeTab[1]}\\/${activeTab[2]}`);
if(elem){
this.onMountActiveTab(elem.parentElement);
}
}
onMountActiveTab = (e) => {
e.classList.add('dashboard-active-tab');
this.setState({
prevActiveElem: e.children[1]
});
}
toggleTab = (e) => {
const { prevActiveElem } = this.state;
const { history } = this.props;
if(e === null) {
return false;
}
this.toggleClassTab(
prevActiveElem,
e.currentTarget,
() => history.push({
pathname: e.currentTarget.id,
retainElem: e.currentTarget
})
);
}
toggleClassTab(prevActiveElem, currentTarget, navigate){
this.setState({
prevActiveElem: currentTarget
});
currentTarget.parentElement.classList.add('dashboard-active-tab');
if(prevActiveElem && prevActiveElem !== currentTarget){
prevActiveElem.parentElement.classList.remove('dashboard-active-tab');
}
navigate();
}
render(){
const { user } = this.props;
return (
<div className="dashboard-menu">
<div className="dashboard-controls">
<div className="dashboard-tab">
<label htmlFor="/dashboard/me">
<div className="dashboard-user-icon" style={{backgroundImage: `url(${user.photoURL})`}}></div>
<span className="dashboard-tab-name">
{user.displayName}
</span>
</label>
<input type="button" onClick={this.toggleTab} id="/dashboard/me" className="opt-none"/>
</div>
<div className="dashboard-tab">
<label htmlFor="/dashboard/setting">
<FontAwesomeIcon className="dashboard-icon" icon="ellipsis-h"/>
<span className="dashboard-tab-name">
Settings
</span>
</label>
<input type="button" onClick={this.toggleTab} id="/dashboard/setting" className="opt-none"/>
</div>
<div className="dashboard-tab">
<label htmlFor="/dashboard/feed">
<FontAwesomeIcon className="dashboard-icon" icon="newspaper"/>
<span className="dashboard-tab-name">
Feed
</span>
</label>
<input type="button" onClick={this.toggleTab} id="/dashboard/feed" className="opt-none"/>
</div>
</div>
</div>
);
}
}
export default withRouter(DashBoardMenu);

MenuGroup Component

import React from 'react';
class MenuGroup extends React.Component{
render(){
return (
{/* Leave this empty for now */}
)
}
}
export default MenuGroup;

response util

A function is being pass down to child components instead of this, create a util that handles the server response and returns the appropriate message back to the component.

bcrypt 1.0.3 issue

issue while installing (npm install)
solution :version 2.0.1 works fine
"bcrypt": "^1.0.3" ->"bcrypt": "^2.0.1"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.