Skip to content

Commit 41789c6

Browse files
authored
Merge pull request #562 from AuraOfDivinity/dashboard-issues
Fixing Dashboard navbar issues
2 parents 1e3cd50 + 9f7d203 commit 41789c6

File tree

6 files changed

+36
-52
lines changed

6 files changed

+36
-52
lines changed

src/user/dashboard/dashboard.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
height: auto;
55
font-family: Muli, sans-serif;
66
.navigation {
7+
background: #f5f5f5;;
78
flex-grow: 1;
89
border-right: solid 1px #dfe9f1;
10+
position: fixed;
11+
top: 0px;
12+
bottom: 0px;
13+
left: 0px;
914
}
1015
.news {
16+
margin-left: 10%;
1117
flex-grow: 4;
1218
.notify-user {
1319
display: flex;

src/user/dashboard/navigation/navigation.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.main-navigation {
22
.list-group {
3+
background-color: #F5F5F5;
34
.list-group-item {
5+
background-color: #F5F5F5;
46
white-space: nowrap;
57
cursor: pointer;
68
border: none;

src/user/dashboard/news-feed/news-feed.js

Lines changed: 12 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const reactionVariant = {
4545
},
4646
};
4747

48+
const navStyles = { position: 'fixed', width: '83%', top: '0', zIndex:1, background: '#fff', marginTop: '0px', marginBottom:'0px'}
49+
4850
const CustomToggle = React.forwardRef(({ children, onClick }, ref) => (
4951
<a
5052
href=""
@@ -130,6 +132,7 @@ function NewsFeed(props) {
130132
const [projects, setAllProjects] = useState([]);
131133
const [posts, setAllPosts] = useState([]);
132134
const [votes, setVotes] = useState({});
135+
const [isTop, setisTop] = useState(false);
133136
const [displayReactionContainer, setDisplayReactioContainer] = useState(
134137
false
135138
);
@@ -141,6 +144,13 @@ function NewsFeed(props) {
141144
setAllPosts(props?.allPosts);
142145
}, [props.allEvents, props.allPosts, props.allProjects, props]);
143146

147+
useEffect(() => {
148+
window.addEventListener("scroll", () => {
149+
const scrollAmount = window.scrollY;
150+
scrollAmount > 369 ? setisTop(true) : setisTop(false)
151+
});
152+
}, [window]);
153+
144154
let navigateToProfile = (userId) => {
145155
console.log(`Navigating to user profile ${userId}`);
146156
props.history.push(`/profile/${userId}`);
@@ -541,58 +551,9 @@ function NewsFeed(props) {
541551
</div>
542552
</div>
543553
<div className="news__feed__container">
544-
{/* <div className="posts">
545-
<span className="category">
546-
<span className="to-centre">
547-
{first === "f" ? (
548-
<Button
549-
active
550-
variant="primary"
551-
className="category-btn"
552-
onClick={handleClick("All")}
553-
>
554-
<span className="btn-content">All</span>
555-
</Button>
556-
) : (
557-
<Button
558-
autoFocus
559-
variant="primary"
560-
className="category-btn"
561-
onClick={handleClick("All")}
562-
>
563-
All
564-
</Button>
565-
)}
566-
<span className="space"></span>
567-
<Button
568-
variant="primary"
569-
className="category-btn"
570-
onClick={handleClick("Post")}
571-
>
572-
<span className="btn-content">Posts</span>
573-
</Button>
574-
<span className="space"></span>
575-
<Button
576-
variant="primary"
577-
className="category-btn"
578-
onClick={handleClick("Event")}
579-
>
580-
<span className="btn-content">Events</span>
581-
</Button>
582-
<span className="space"></span>
583-
<Button
584-
variant="primary"
585-
className="category-btn"
586-
onClick={handleClick("Project")}
587-
>
588-
<span className="btn-content">Projects</span>
589-
</Button>
590-
</span>
591-
</span>
592-
</div> */}
593-
<div className="tabs__container">
554+
<div className="tabs__container" style={isTop? navStyles: {}}>
594555
<span className="nav__tab container">
595-
<ul className="nav__list__container">
556+
<ul className="nav__list__container" style={isTop ? {marginBottom: '0px'}: {}}>
596557
<li
597558
className={
598559
type === "All"

src/user/organization/organization.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
.navigation {
77
flex: 0.5;
88
border-right: solid 1px #dfe9f1;
9+
position: fixed;
10+
top: 0px;
11+
bottom: 0px;
12+
left: 0px;
913
}
1014
h2 {
1115
font-size: 20px;
1216
font-weight: bold;
1317
font-family: "Inter";
1418
}
1519
.news {
20+
margin-left: 10%;
1621
flex: 3;
1722
.notify-user {
1823
display: flex;

src/user/profile/profile.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
.navigation {
77
flex: 0.5;
88
border-right: solid 1px #dfe9f1;
9+
position: fixed;
10+
top: 0px;
11+
bottom: 0px;
12+
left: 0px;
913
}
1014
h2 {
1115
font-size: 22px;
1216
font-weight: 650;
1317
}
1418
.news {
19+
margin-left: 10%;
1520
flex: 3;
1621
.notify-user {
1722
display: flex;

src/user/projects/projects.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
.navigation {
66
flex: 0.5;
77
border-right: solid 1px #dfe9f1;
8+
position: fixed;
9+
top: 0px;
10+
bottom: 0px;
11+
left: 0px;
812
}
913

1014
.projects {
@@ -71,4 +75,5 @@
7175
}
7276

7377
}
74-
}
78+
margin-left: 10%;
79+
}

0 commit comments

Comments
 (0)