generated from allen-cell-animated/github-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor: Header component #257
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fd9f74f
Merge branch 'feat/public-layout' into refactor/header-component
ShrimpCryptid cebd637
refactor: Moved logo components into a new file
ShrimpCryptid cdf5096
refactor: Moved header bar styling to a styled component
ShrimpCryptid 21dc388
fix: Fix missing basename for routing
ShrimpCryptid 0c4540e
refactor: Reorganized header components
ShrimpCryptid 9af437b
Merge branch 'refactor/app-router' into refactor/header-component
ShrimpCryptid 277ee21
refactor: Header file rename
ShrimpCryptid e0e8f42
feat: Added header to error page
ShrimpCryptid bbf27fd
fix: Changed AICS logo to open website in new tab
ShrimpCryptid 8afd81e
fix: Removed basename to fix GitHub page loading as empty
ShrimpCryptid 9a9e8c0
Merge branch 'main' into refactor/header-component
ShrimpCryptid 3ee09cf
Merge branch 'refactor/app-router' into refactor/header-component
ShrimpCryptid 2d49653
refactor: Code cleanup
ShrimpCryptid 0d69677
Merge branch 'main' into refactor/header-component
ShrimpCryptid f16e37b
refactor: Code cleanup
ShrimpCryptid 2aa8797
refactor: Merged Header content back into single styled header file
ShrimpCryptid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edited the SVG's title attribute to say "Allen Institute for Cell Science" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from "styled-components"; | ||
|
||
/** | ||
* Top title bar for the app, which will stick to the top of the page. | ||
* Child components will be spaced apart evenly. | ||
* */ | ||
const Header = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: auto; | ||
height: fit-content; | ||
min-height: var(--header-content-height); | ||
padding: 12px 30px; | ||
border-bottom: 1px solid var(--color-borders); | ||
gap: 10px; | ||
position: sticky; | ||
background-color: var(--color-background); | ||
z-index: 100; | ||
top: 0; | ||
left: 0; | ||
`; | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { ReactElement } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import styled from "styled-components"; | ||
|
||
import { AicsLogoSVG } from "../../assets"; | ||
import { FlexRowAlignCenter, VisuallyHidden } from "../../styles/utils"; | ||
|
||
const AicsLogoLink = styled.a` | ||
position: relative; | ||
width: 180px; | ||
height: 46px; | ||
`; | ||
|
||
const StyledAicsLogo = styled(AicsLogoSVG)` | ||
left: 0; | ||
top: 0; | ||
position: absolute; | ||
`; | ||
|
||
const VerticalDivider = styled.div` | ||
height: 24px; | ||
width: 1px; | ||
background-color: var(--color-dividers); | ||
display: inline-block; | ||
`; | ||
|
||
/** | ||
* The logo for the header, with links for the | ||
* @returns | ||
*/ | ||
export default function HeaderLogo(): ReactElement { | ||
return ( | ||
<FlexRowAlignCenter $gap={20}> | ||
<AicsLogoLink href="https://www.allencell.org/" rel="noopener noreferrer" target="_blank"> | ||
<StyledAicsLogo title={"https://www.allencell.org"} /> | ||
</AicsLogoLink> | ||
<VerticalDivider /> | ||
<Link to="/"> | ||
<h1 style={{ whiteSpace: "nowrap" }}>Timelapse Colorizer</h1> | ||
<VisuallyHidden>(go to home page)</VisuallyHidden> | ||
</Link> | ||
</FlexRowAlignCenter> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Header from "./Header"; | ||
import HeaderLogo from "./HeaderLogo"; | ||
|
||
export { HeaderLogo, Header }; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to
Header.tsx