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

Feature/user page design #165

Open
wants to merge 5 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
3 changes: 2 additions & 1 deletion front-end/src/components/App/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { BrowserRouter, withRouter, Switch, Route } from 'react-router-dom'

import { Home, Register, Login, PrivateRoute, ChatRoom , Contributors } from '..'
import { Home, Register, Login, PrivateRoute, ChatRoom , Contributors , UserProfile } from '..'
import QuizMcq from '../Quiz/mcq/quizMcq';

import '../../styles/index.css'
Expand All @@ -13,6 +13,7 @@ const App = () => (
<Route exact path ="/contributors" component ={Contributors} />
<Route exact path="/sign-in" component={Login} />
<Route exact path="/sign-up" component={Register} />
<Route exact path="/userProfile" component={UserProfile} />
<Route exact path="/quizmcq" component={QuizMcq} />
<PrivateRoute exact path="/chat-room" component={ChatRoom} />
</Switch>
Expand Down
45 changes: 45 additions & 0 deletions front-end/src/components/UserProfile/BlogOrFavorite.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { Component } from 'react'
import './index.scss'
import pinIcon from './assests/pin.png'
import dummyImg from './assests/dummy_image.png'
import heartImg from './assests/heartIcon.png'

export class BlogOrFavorite extends Component {
render() {
return (
<React.Fragment>
<li className="fx-b30 dFlexRow blogItem">
<div className="fx-b100 dFlexRow">
<div className="blogPageIcon">
{this.props.view === "favorite" ?
<span><img src={heartImg}/></span>
:
<span><img src={pinIcon} alt="pinBlog" />Pinned Blogs</span>
}
</div>

<div className="dFlexColumn jContentFlexStart">
<div className="fx-b20 blogImage">
<img className="round-img" src={dummyImg} alt="dummy" />
</div>
<div className="fx-b80 dFlexRow blogContent">
<div className = "fx-b100">
<input className="blogInput" type="text" readOnly={this.props.view !== "blog"} placeholder="blog post 1" />
</div>
<div className = "fx-b100">
<textarea className="blogInput" rows="3" readOnly={this.props.view !== "blog"} type="text" placeholder="Brief Intro about the blog post" />
</div>
<div className="fx-b100 blogBtns">
<button>Comment</button>
<button>Share Via</button>
</div>
</div>
</div>
</div>
</li>
</React.Fragment>
)
}
}

export default BlogOrFavorite
46 changes: 46 additions & 0 deletions front-end/src/components/UserProfile/ProfileHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { Component } from 'react'
import './index.scss'
import dummyImg from './assests/dummy_image.png'
import fbIcon from './assests/facebookIcon.png'
import githubIcon from './assests/githubIcon.png'
import twitterIcon from './assests/twitterIcon.png'
import instagramIcon from './assests/InstagramIcon.png'
export class ProfileHeader extends Component {
render() {
return (
<div className="dFlexRow headerContainer">
<div className="profileAvatarDiv">
<img className="profileAvatar round-img" src={dummyImg} alt="dummy" />
</div>
<div className="fx-b40 headerProfileDetailsContainer">
<h3>User Name</h3>
<h5>@profile</h5>
<p>Brief bio about the user </p>
</div>
<div className="fx-b40 socialLinksDiv">
<ul className="socialLinks">
<li>
<img src={githubIcon} alt="github-icon" title="github-icon" />
</li>

<li>
<img src={twitterIcon} alt="twitter-icon" title="twitter-icon" />
</li>

<li>
<img src={instagramIcon} alt="instagram-icon" title="instagram-icon" />
</li>

<li >
<img src={fbIcon} alt="facebook-icon" title="facebook-icon"/>
</li>
</ul>
<button className="editProfileBtn">Edit Profile</button>
</div>

</div>
)
}
}

export default ProfileHeader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions front-end/src/components/UserProfile/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { Component } from 'react'
import ProfileHeader from './ProfileHeader'
import BlogOrFavorite from './BlogOrFavorite'

export class UserProfile extends Component {
state = {
view: "blog",
blogs: ["blog1", "blog2", "blog3"],

}
handleViewChange = (view) => {
this.setState({ view })
}
render() {
return (
<div>
<ProfileHeader />
<div className="mainDiv">
<ul className="profileNavbar">
<li className={this.state.view === "blog" ? "nav-item active " : "nav-item"} onClick={() => this.handleViewChange("blog")}>
Blogs
</li>
<li className={this.state.view === "favorite" ? "nav-item active " : "nav-item"} onClick={() => this.handleViewChange("favorite")}>
Favorite
</li>
<li className={this.state.view === "followers" ? "nav-item active " : "nav-item"} onClick={() => this.handleViewChange("followers")}>
Followers
</li>
<li className={this.state.view === "following" ? "nav-item active " : "nav-item"} onClick={() => this.handleViewChange("following")}>
Followings
</li>
</ul>
{this.state.view === "blog" || this.state.view === "favorite"
?
<ul className="contentContainer dFlexRow">
{this.state.view === "blog" ?
this.state.blogs.map((item, index) => (
<BlogOrFavorite key={index} view={this.state.view} />
))
:
''
}

</ul>
:
''
}
</div>
</div>
)
}
}

export default UserProfile
Loading