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

[next] Issue 1470 - Port SearchBar to NEXT.js #1581

Merged
merged 5 commits into from
Jan 22, 2021

Conversation

PedroFonsecaDEV
Copy link
Contributor

@PedroFonsecaDEV PedroFonsecaDEV commented Jan 21, 2021

Issue This PR Addresses

Fixes #1470

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

I don't know if we need to merge something else related to our styles and theme or if I need to work on this particular style, but this is the result that I'm getting followed by the messages on the console.

Screen Shot 2021-01-21 at 5 26 42 AM

Console:
Warning: Prop `className` did not match. Server: "MuiSvgIcon-root makeStyles-infoButton-11" Client: "MuiSvgIcon-root makeStyles-infoButton-12"
    in svg (created by ForwardRef(SvgIcon))
    in ForwardRef(SvgIcon) (created by WithStyles(ForwardRef(SvgIcon)))
    in WithStyles(ForwardRef(SvgIcon)) (created by ForwardRef(InfoOutlinedIcon))
    in ForwardRef(InfoOutlinedIcon)
    in ForwardRef(InfoOutlinedIcon) (at SearchHelp.tsx:68)
    in ForwardRef(Tooltip) (created by WithStyles(ForwardRef(Tooltip)))
    in WithStyles(ForwardRef(Tooltip)) (created by WithStyles(WithStyles(ForwardRef(Tooltip))))
    in WithStyles(WithStyles(ForwardRef(Tooltip))) (at SearchHelp.tsx:27)
    in SearchHelp (at SearchBar.tsx:111)
    in div (created by ForwardRef(Grid))
    in ForwardRef(Grid) (created by WithStyles(ForwardRef(Grid)))
    in WithStyles(ForwardRef(Grid)) (at SearchBar.tsx:98)
    in form (created by ForwardRef(Paper))
    in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
    in WithStyles(ForwardRef(Paper)) (at SearchBar.tsx:97)
    in div (created by Styled(MuiBox))
    in Styled(MuiBox) (at SearchBar.tsx:96)
    in SearchBar (at pages/index.tsx:20)
    in Home (at _app.tsx:21)
    in UserProvider (at _app.tsx:20)
    in App
    in ErrorBoundary (created by ReactDevOverlay)
    in ReactDevOverlay (created by Container)
    in Container (created by AppContainer)
    in AppContainer
    in Root
    in StrictMode
printWarning @ react-dom.development.js?61bb:88
error @ react-dom.development.js?61bb:60
warnForPropDifference @ react-dom.development.js?61bb:5720
diffHydratedProperties @ react-dom.development.js?61bb:6515
hydrateInstance @ react-dom.development.js?61bb:7691
prepareToHydrateHostInstance @ react-dom.development.js?61bb:16611
completeWork @ react-dom.development.js?61bb:18964
completeUnitOfWork @ react-dom.development.js?61bb:22192
performUnitOfWork @ react-dom.development.js?61bb:22165
workLoopSync @ react-dom.development.js?61bb:22130
performSyncWorkOnRoot @ react-dom.development.js?61bb:21756
scheduleUpdateOnFiber @ react-dom.development.js?61bb:21188
updateContainer @ react-dom.development.js?61bb:24373
eval @ react-dom.development.js?61bb:24758
unbatchedUpdates @ react-dom.development.js?61bb:21903
legacyRenderSubtreeIntoContainer @ react-dom.development.js?61bb:24757
hydrate @ react-dom.development.js?61bb:24823
renderReactElement @ index.tsx?8abf:518
doRender @ index.tsx?8abf:776
_callee2$ @ index.tsx?8abf:413
tryCatch @ runtime.js?96cf:63
invoke @ runtime.js?96cf:293
eval @ runtime.js?96cf:118
asyncGeneratorStep @ asyncToGenerator.js?c973:3
_next @ asyncToGenerator.js?c973:25
eval @ asyncToGenerator.js?c973:32
eval @ asyncToGenerator.js?c973:21
_render @ index.js:515
render @ index.js:452
eval @ next-dev.js?53bc:85
eval @ fouc.js?937a:14
requestAnimationFrame (async)
displayContent @ fouc.js?937a:5
eval @ next-dev.js?53bc:84
Promise.then (async)
eval @ next-dev.js?53bc:31
eval @ next-dev.js?53bc:31
./node_modules/next/dist/client/next-dev.js @ main.js?ts=1611224705998:956
__webpack_require__ @ webpack.js?ts=1611224705998:873
checkDeferredModules @ webpack.js?ts=1611224705998:46
webpackJsonpCallback @ webpack.js?ts=1611224705998:33
(anonymous) @ webpack.js?ts=1611224705998:1015
(anonymous) @ webpack.js?ts=1611224705998:1023

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)


type searchBarProps = {
text: string;
onTextChange: Function;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for onTextChange should we be clearer than just Function. It is an onChange event handler and I believe in TS you have ChangeEventHandler/EventHandler type too. Whats your thought?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be changed to a ChangeEvent function that returns void
Since it's for an input element, we can type it to HTMLInputElement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it in a follow-up PR, because we are drilling a lot of stuff here. After getting everything working we will need to create an interface to SearchPage's components and a context. These functions are connected to how we build the URL query of a search. So I believe that we need to be care full with that. It's working now. Let's keep this for now.

I'm opening an issue for the next step (interface and context) now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tonyvugithub
Copy link
Contributor

@PedroFonsecaDEV : Your error is surprising as I got it deal with in this PR #1550

text: string;
onTextChange: Function;
filter: string;
onFilterChange: Function;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar thing here, we should probably be more specific by specifying any parameters it may take or "()" for nothing, as well as the return type for this function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is for the FilterChange and TextChange functions, text and filter are fine

Copy link
Contributor

@HyperTHD HyperTHD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once SearchInput gets merged, you should probably rebase this so you can pick it up, would prefer to avoid duplicate components in 2 PRs

@HyperTHD HyperTHD self-requested a review January 22, 2021 17:47
Copy link
Contributor

@HyperTHD HyperTHD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3ho is gonna rebase this PR and as per your comment here, we'll see what we can do to fix this

@HyperTHD HyperTHD merged commit 0c9c86e into Seneca-CDOT:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: nextjs Nextjs related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[next] Port SearchBar from Gatsby to NextJS
3 participants