-
Notifications
You must be signed in to change notification settings - Fork 4
Lex Pages Data Handlers #293
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
Conversation
davenquinn
left a comment
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.
Looks like a decent start but you need to update the `IndividualPage' function to be a proper React component.
Also it's worth noting that server-side loading won't be fully achieved until you switch Pages from +Page.client.ts to +Page.ts. This may require making the map and other page elements load lazily – see the columns page for how to do this.
pages/lex/index.ts
Outdated
| if (type === "concept_id") { | ||
| type = "strat_name_concept_id"; | ||
| } | ||
| export function IndividualPage(id, header, res, fossilRes, colData, taxaData) { |
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.
This has some architectural challenges:
- The
IndividualPageshould be a React component but it is not. Make all of the arguments into props instead, and create a Typescript type to guide the user on what the props should be. Having this as a function that returns React elements based on arguments is a sketchy design IndividualPageis not a very descriptive name- This is a subsidiary problem, at least for now, but this component suffers from a little bit of bloat in trying to create a "one size fits all" approach to rendering a lexicon page
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.
First two points fixed in new commits
|
All page.client.ts pages changes to regular page.ts |
All
lexiconmain pages and individual pages use a+data.tshandler to allow for better web search crawlabilityAlso, fixing linking issue with new
strat-namespage