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

Task/wp 209 header, footer main menu #282

Merged
merged 27 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8e81d4f
task/WP-209-Footer-Main-Menu
sophia-massie Nov 14, 2024
0d4c293
- Moved assets to public
sophia-massie Nov 15, 2024
fcca982
- Need to merge in project listing to see if this
sophia-massie Nov 15, 2024
967f9ed
Linting
sophia-massie Nov 15, 2024
3f46b29
git
sophia-massie Nov 15, 2024
e3be27c
- Moves assets to src/assets
sophia-massie Nov 15, 2024
1871ce5
- Gets listing to scroll and take up whole pages
sophia-massie Nov 15, 2024
a73744b
Linting
sophia-massie Nov 15, 2024
4f04521
- Adds header component and footer
sophia-massie Nov 22, 2024
61913b7
- Prettier
sophia-massie Nov 22, 2024
cd8fe9d
Merge branch 'main' into task/WP-209-Footer-Main-Menu
sophia-massie Nov 22, 2024
0992cda
- Linting
sophia-massie Nov 22, 2024
c579c2e
Merge branch 'task/WP-209-Footer-Main-Menu' of github.com:TACC-Cloud/…
sophia-massie Nov 22, 2024
a6c4294
- Changes name to HeaderNavBar
sophia-massie Nov 22, 2024
b363df7
Left over unstaged changes from last commit
sophia-massie Nov 22, 2024
38701c5
Update react/src/pages/MainMenu/MainMenu.tsx
sophia-massie Nov 22, 2024
8fcd7ae
Update react/src/pages/MainMenu/MainMenu.tsx
sophia-massie Nov 22, 2024
96bd1d0
Update react/src/pages/MainMenu/MainMenu.tsx
sophia-massie Nov 22, 2024
82c911a
- Regression in delete button
sophia-massie Nov 22, 2024
09dbad7
Merge branch 'task/WP-209-Footer-Main-Menu' of github.com:TACC-Cloud/…
sophia-massie Nov 22, 2024
81e4a4f
- Factors out user hook to only HeaderNavBar
sophia-massie Nov 26, 2024
dd5ceae
- Removes debugging test statement
sophia-massie Nov 26, 2024
3831310
- Factors out user guide and logo to Main Menu
sophia-massie Nov 26, 2024
f4923df
- Updates test to include refetch
sophia-massie Nov 26, 2024
37b9d33
- Removes unused flex container
sophia-massie Nov 26, 2024
3ca6e93
Removes refetch
sophia-massie Nov 27, 2024
5a332df
- Adds Taggit link
sophia-massie Dec 3, 2024
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
Binary file added react/src/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions react/src/assets/designsafe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react/src/assets/hazmapper-header-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react/src/assets/nheri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react/src/assets/nsf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions react/src/components/HeaderNavBar/HeaderNavBar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.root {
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
height: var(--hazmapper-header-navbar-height);
}
.userName {
color: white;
}
53 changes: 53 additions & 0 deletions react/src/components/HeaderNavBar/HeaderNavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import { Layout } from 'antd';
import useAuthenticatedUser from '@hazmapper/hooks/user/useAuthenticatedUser';
import { useNavigate } from 'react-router-dom';
import { Button, InlineMessage, LoadingSpinner } from '@tacc/core-components';
import styles from './HeaderNavBar.module.css';

export const HeaderNavBar: React.FC = () => {
const { Header } = Layout;
const navigate = useNavigate();

const {
data: userData,
isLoading: isUserLoading,
error: isUserError,
} = useAuthenticatedUser();

const handleLogin = () => {
const url = `/login?to=${encodeURIComponent(location.pathname)}`;
navigate(url);
};

if (isUserLoading) {
return <LoadingSpinner />;
}

if (isUserError) {
return (
<InlineMessage type="error">
{' '}
There was an error loading your username.
</InlineMessage>
);
}

return (
<Header className={styles.root}>
<img
width="150px"
src="./src/assets/hazmapper-header-logo.png"
alt="Hazmapper Logo"
/>
{userData && userData.username ? (
<div className={styles.userName}>{userData.username}</div>
) : (
<Button type="link" className={styles.userName} onClick={handleLogin}>
Login
</Button>
)}
</Header>
);
};
export default HeaderNavBar;
1 change: 1 addition & 0 deletions react/src/components/HeaderNavBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './HeaderNavBar';
56 changes: 48 additions & 8 deletions react/src/components/Projects/ProjectListing.module.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,90 @@
.root {
display: flex;
flex-direction: column;
padding-left: 50px;
padding-right: 50px;
}
.errorMessage {
width: 100%;
padding: 10px;
}
.errorMessage p {
justify-content: center;
}

.projectList {
width: 100%;
table-layout: fixed;
flex-grow: 1;
overflow: hidden;
justify-content: center;
padding: 10px;
}
.errorMessage {

.projectList table {
width: 100%;
padding: 10px;
table-layout: fixed;
border-collapse: collapse;
}
.projectList th {

.projectList thead {
position: sticky;
top: 0;
z-index: 10;
background: #d0d0d0;
}

.projectList thead th {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
background: #d0d0d0;
}

.projectList tbody {
display: block;
max-height: 300px;
overflow-y: auto;
}
.projectList tr,
td {

.projectList tr {
display: table;
width: 100%;
table-layout: fixed;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.projectList tr:hover td {
color: white;
background-color: var(--global-color-accent--light);
}

.projectList tr:hover td button {
color: white;
}

.mapColumn {
width: 42%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.projectColumn {
width: 42%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.buttonColumn {
width: 16%;
text-align: end;
}

.buttonColumn button {
max-width: 100%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
justify-content: flex-start;
}
Loading
Loading