-
Notifications
You must be signed in to change notification settings - Fork 26
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
Builds the usability survey page #315
base: main
Are you sure you want to change the base?
Conversation
Preview uploaded to https://preview.dashboard.test.threshold.network/usability-survey/index.html. |
…nto usability-survey
Preview uploaded to https://preview.dashboard.test.threshold.network/usability-survey/index.html. |
…nto usability-survey
…oken-dashboard into usability-survey
Preview uploaded to https://preview.dashboard.test.threshold.network/usability-survey/index.html. |
Preview uploaded to https://preview.dashboard.test.threshold.network/usability-survey/index.html. |
{range(numberOfButtons, 1).map((n) => ( | ||
<Button | ||
size={size} | ||
variant="sequence" |
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.
Let's bump the components
package- the PR that adds new variant has been merged threshold-network/components#37.
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.
@r-czajkowski doesn't the development
version cover this case? Is it just a yarn.lock
update we need? or do you suggest we install "@threshold-network/components": "^1.0.0-dev.0",
?
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 round of review done
rows.map((row) => { | ||
if (row.id === rowId) { | ||
return { | ||
...row, | ||
value, | ||
} | ||
} | ||
return row | ||
}) | ||
) |
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.
Can we simplify?
setRows(rows => rows.map(row => row.id === rowId ? { ...row, value } : row))
Preview uploaded to https://preview.dashboard.test.threshold.network/usability-survey/index.html. |
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 we have 0 additions but 25k deletions in yarn.lock
. Are we sure everything is OK with yarn.lock
?
import { FC } from "react" | ||
import { Button, HStack } from "@threshold-network/components" | ||
import { range } from "../utils/range" | ||
import { StackProps } from "@chakra-ui/react" |
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.
Can we import from @threshold-network/components
?
numberOfButtons: number | ||
selectedButtonNum?: number | ||
onButtonClick: (n: number) => void | ||
size?: ThemeTypings["components"]["Button"]["sizes"] |
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 think we can ButtonProps["size"]
and import the ButtonProps
from @threshold-network/components
Tr, | ||
} from "@threshold-network/components" | ||
import { Row, RowID, RowValue } from "./types" | ||
import { useColorModeValue } from "@chakra-ui/react" |
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.
Let's import from @threshold-network/components
.
value, | ||
})) | ||
|
||
console.log("Payload ", payload) |
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.
Do we need console.log
?
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 can remove it. just added to prevent an unused var warning. I still need to implement the post function, but waiting for code from other branches.
Builds the usability survey form. There are a few TODOs to implement in future pull requests: