-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Recall Information FOR-849 #1673
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
…ed on dummy options
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionFormInput.tsxWhile the implementation of the MentionsInput component is a great addition, the hardcoded data array for the mentions could be improved. If the data for the mentions is static and won't change, it's fine to leave it as is. However, if the data is dynamic and could change, it would be better to fetch this data from a source (like an API or a state management store) and update it accordingly. // If the data is dynamic, fetch it from the appropriate source
const data = fetchDataFromSource();The new code introduces inline styles for the MentionsInput component. While this works, it can lead to performance issues in React as the object will be recreated on every render. It's recommended to use CSS classes or styled-components for better performance. // Use CSS classes or styled-components for better performance
const StyledMentionsInput = styled(MentionsInput)`
width: 100%;
border: 1px rgb(203 213 225) solid;
border-radius: 4px;
textArea: {
border: none;
marginBottom: 1rem;
};
suggestions: {
list: {
backgroundColor: white;
fontSize: 14;
};
item: {
padding: 5px 15px;
"&focused": {
backgroundColor: #cee4e5;
};
};
};
`; |
| const data = [ | ||
| { id: "question 1", display: "question 1" }, | ||
| { id: "question 2", display: "question 2" }, | ||
| { id: "question 3", display: "question 3" }, | ||
| { id: "question 4", display: "question 4" }, | ||
| { id: "question 5", display: "question 5" }, | ||
| ]; |
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.
The hardcoded data array for the mentions is replaced with a function call to fetch data from a source. This is beneficial if the data is dynamic and could change over time.
| const data = [ | |
| { id: "question 1", display: "question 1" }, | |
| { id: "question 2", display: "question 2" }, | |
| { id: "question 3", display: "question 3" }, | |
| { id: "question 4", display: "question 4" }, | |
| { id: "question 5", display: "question 5" }, | |
| ]; | |
| const data = fetchDataFromSource(); |
…ed on dummy options
What does this PR do?
Fixes # (issue)
Type of change
How should this be tested?
Checklist
Required
pnpm buildconsole.logsgit pull origin mainAppreciated