Skip to content

Commit

Permalink
make top bar fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
annacai44 committed Jan 21, 2025
1 parent e005e8a commit bff0607
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 29 deletions.
8 changes: 8 additions & 0 deletions src/components/Account/Account.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.account-details {
margin-bottom: 20px;
}

.account-content {
text-align: center;
padding-top: 20px;
height: calc(100vh - 56px - 64px); /* This is the height of the viewport minus the height of the app bar and the bottom navigation bar */
margin-top: 4rem;
margin-bottom: 6rem;
}
2 changes: 1 addition & 1 deletion src/components/Account/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Account({ userName, userEmail, profilePic }) {
<AppBar />
<Container
maxWidth="sm"
style={{ textAlign: 'center', paddingTop: '20px', height: '100vh' }}
className="account-content"
>
<Box
style={{
Expand Down
6 changes: 6 additions & 0 deletions src/components/AppBar/AppBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
color: white;
height: 4rem;
padding: 0 1rem;
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 1000;
}

.app-bar-title {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Feed/Feed.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.feed-screen {
background-color: white;
width: 100%;
.feed-content {
margin-top: 4rem;
margin-bottom: 4rem;
}
40 changes: 20 additions & 20 deletions src/components/Feed/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,26 @@ function Feed() {
return (
<div>
<AppBar />
<Tabs value={value} onChange={handleChange} centered>
<Tab label="Friends" icon={<PeopleIcon />} component={Link} to="/feed" />
<Tab label="Public" icon={<PublicIcon />} component={Link} to="/public" />
</Tabs>
<CourseSelect searchFunc={setSearch} />
<Container maxWidth="sm">
<Box paddingBottom="30px">
<Stack spacing={3}>
{ filteredposts.length === 0 ?
(<p>No results found...</p>) :
(filteredposts
.slice()
.sort((a, b) => b.date.seconds - a.date.seconds).map((post) =>
<div key={post.id}>
<Post post={post} friends={fake_friends} />
</div>)
)
}
</Stack>
</Box>
<Container className="feed-content" maxWidth="sm">
<Tabs value={value} onChange={handleChange} centered>
<Tab label="Friends" icon={<PeopleIcon />} component={Link} to="/feed" />
<Tab label="Public" icon={<PublicIcon />} component={Link} to="/public" />
</Tabs>
<CourseSelect searchFunc={setSearch} />
<Box paddingBottom="30px">
<Stack spacing={3}>
{ filteredposts.length === 0 ?
(<p>No results found...</p>) :
(filteredposts
.slice()
.sort((a, b) => b.date.seconds - a.date.seconds).map((post) =>
<div key={post.id}>
<Post post={post} friends={fake_friends} />
</div>)
)
}
</Stack>
</Box>
</Container>
<NavigationBar />
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/NavigationBar/NavigationBar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.nav-bar {
background-color: #f5f5f5 !important;
position: sticky;
position: fixed;
left: 0;
right: 0;
bottom: 0;
width: 100%;
}
7 changes: 4 additions & 3 deletions src/components/Submission/Submission.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.submission-page {
padding: 3em;
height: 100vh;
.submission-content {
height: calc(100vh - 56px - 64px);
margin-top: 6rem;
margin-bottom: 6rem;
}

#rating {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Submission/Submission.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Submission({ userName }) {

<div>
<AppBar />
<Container className="submission-page">
<Container className="submission-content">
<Stack spacing={2}>
<TextField required id="title" label="Title" value={title} type='text' onChange={(e) => setTitle(e.target.value)} />
<TextField required id="course" label="Course" value={course} type='text' onChange={(e) => setCourse(e.target.value)} />
Expand Down

0 comments on commit bff0607

Please sign in to comment.