-
Notifications
You must be signed in to change notification settings - Fork 49
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
Convert 'contact', 'team', and 'whoami' to app router; partially convert '404' [#134] #1032
base: master
Are you sure you want to change the base?
Conversation
dea7987
to
163efe8
Compare
163efe8
to
91dede0
Compare
91dede0
to
65263b2
Compare
65263b2
to
1f5099a
Compare
Is that level of whitespace variation worth trying to nail down, IyourO? |
Maybe not? Though if I were doing the work I'd probably still try. It also might have more impact on mobile viewports? Would be good to check. The logo position change seems like it'll have more impact when navigating between a page like the contact page and an Auspice page. |
Oh believe me, there has been some previous effort in this direction, I assure you. On first blush, I think I would push further effort getting the header alignment perfect to after adding the login/user tracking bit, as I suspect some of the delta is due to that.
Yeah, fair; I haven't done a lot of checking around mobile viewport sizes. |
BTW, what browser is this, and do you happen to remember the rough viewport size? |
@tsibley this was a question for you, about that comparison GIF — I'm having trouble reproducing some of the differences visible there with Firefox v131 on macOS. |
Firefox 113.0.2 on Linux (specifically |
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.
I really like the direction this is heading, thank you for simplifying the styling ❤️
@media (min-width: 1200px) { | ||
.container, .container-sm, .container-md, .container-lg, .container-xl { | ||
max-width: 1140px; | ||
} | ||
} |
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.
I noticed some additional whitespace on a wider screen and traced it back to the container
class. The App router layout is respecting the bootstrap.css max-width of 1140px while the Pages router styled component Container
has an additional @media rule
nextstrain.org/static-site/src/components/splash/styles.tsx
Lines 20 to 22 in 7617c38
@media (min-width: 1550px) { | |
width: 1500px; | |
} |
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.
I'll have to dig and see where I got that 1500px rule from and how it's working on the current prod site...
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.
Ah, sorry I wasn't clear. I meant the 1500px rule is included in the current prod site but is not here.
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.
@joverlee521 Actually, it is there, unless I'm still misunderstanding you.
I do see a layout difference on a larger screen, but it's only in the width of the divs starting with the team avatar icons -- from what I see, the layout from the top of the page down to and including "The core Nextstrain team is" matches exactly; stuff after that is clamped to 1140 ...
but yeah that's because the @media(min-width: 1550px)
rule isn't cascading down from the html
selector... 🤔
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.
ugh, nvm, stupid bootstrap.
1f5099a
to
8d1e000
Compare
8d1e000
to
2104fe7
Compare
If folks want to take another look at this, I've addressed the feedback about the basic layout (I think! 🤞 ) and also finished the Heroku seems to be having some deployment issues at the moment; when a review app finally builds, I'll link a preview. Next stage: dealing with the user context. |
2104fe7
to
b3216b1
Compare
b3216b1
to
d07e6ea
Compare
cba088b
to
6c2f71b
Compare
6c2f71b
to
12d68b3
Compare
_Largely_ derived from material in Pages Router pages and components, but with a number of redundant or otherwise unneeded styling elements excised for minimalism. Does not yet implement logged in state, and explicitly drops "minimized" as a nav-bar concept, at least for the moment.
Note: this includes some updates to the FocusParagraph component which required some knock-on changes in the 'contact' page, due to the exports of FocusParagraph changing.
Note: the '404' page uses the same `<Splash />` component as the home page. I currently need to port the '404' page to the App Router, to resolve some test failures, but I do not want to get bogged down into porting the `<Splash />` component right now. Instead, I am adding this stub, which should allow the 404 page to load and (most importantly) satisfy the test suite. The full `<Splash />` component will be fully ported later, at which point the older version of the component will be removed.
Also updates the 404 content test to match the new behavior of not returning the full page. Note: file renaming (`404.jsx` -> `not-found.tsx`) is because Next.js App Router requires the latter name. Note: old `pages/404.jsx` and `src/pages/404.jsx` are left in place because the `ListResources` component depends on the `ErrorContainer` style being exported from them. This will be addressed in a subsequent commit.
12d68b3
to
db15727
Compare
db15727
to
4007ac1
Compare
4007ac1
to
0e36145
Compare
0e36145
to
167a7c5
Compare
* Add <UserDataWrapper> component to base layout to provide access to logged in user via React Context * Wrap username or login link display into <UserOrLoginLink> Client Component; add to <Nav> component
Note: updates the page to use the default layout with the toolbar and team avatars, in addition to the sponsor logos.
167a7c5
to
c15a78d
Compare
|
||
.userGroupList { | ||
display: table; | ||
margin: 0 auto !important; |
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.
note to self: see if you can remove the !important
@@ -0,0 +1,46 @@ | |||
.siteMap { | |||
/* Center contents */ | |||
margin: 0 auto !important; |
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.
note to self: another !important
to try removing.
margin: 0 auto !important; | ||
|
||
/* Ensure that, on wide screens, 4 sections renders to roughly align | ||
with the width of IconParagraph (rendered below this element) */ |
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.
note to self: check if IconParagraph
is still the correct label here.
href: string; | ||
imgSrc: string; | ||
width: number; |
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.
note to self: can probably re-use the Logo
type here
const rainbowTitle = siteTitle | ||
.split("") | ||
.map((letter, i) => ( | ||
<span key={i} style={{ color: "var(--titleColor" + i + ")" }}>{letter}</span> |
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.
note to self: can you use variable interpolation here and make this string a little cleaner?
Description of proposed changes
This converts the global/shared layout and navigation bits, the
/contact
,/team
, and/whoami
pages (including login state display in that page and the global nav), and the general outline of the404/not-found
page over to using the App Router. The404
page is currently only loading a "stub" version of the<Splash />
component; it will be fully ported over soon.This also required converting all
styled-components
usage in those parts over to either regular CSS, or to CSS Modules, depending on the scope of the usage. In general, I have tried to keep things scoped either very tightly (i.e., in specific CSS Modules imported into a single component) or put them in a global CSS file that is imported in the root layout.I have elected to migrate components to
/static-site/components
as they are converted over for use with App Router; that felt like the cleanest option. I also elected to put page content directly into theapp/*/pages.tsx
files, rather than propagating the "page content is actually understatic-site/src/pages/*.jsx
" pattern, reasoning that this reduces the number of moving parts and makes it more clear where the content is relative to the the URL it is displayed at.To be explicit: when this conversion work is done, I expect the contents of
/static-site
to be:Related issue(s)
#1052
#134
Checklist