-
-
Notifications
You must be signed in to change notification settings - Fork 69
Volunteer Activity Reporting Q2 #1141
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
base: VAR
Are you sure you want to change the base?
Conversation
ddfridley
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.
Besides these two comments, I have updated the VAR branch. Can you pull that and merge it. This has the changes to master that use npm instead of yarn. After the merge, you will need to run npm install and then npm run storybook
Also, for future PRs I want to investigate if you can push branches directly to democracyLab. On my end, Its harder to fetch, and I can't push changes to your branches - like if I merged changes myself. But we need to see if you have permission yet.
...n/components/componentsBySection/VolunteerActivityReporting/VolunteerActivityReportingQ2.jsx
Outdated
Show resolved
Hide resolved
...n/components/componentsBySection/VolunteerActivityReporting/VolunteerActivityReportingQ2.jsx
Outdated
Show resolved
Hide resolved
… dynamic error display
… dynamic error display
|
Hello @ddfridley |
ddfridley
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.
Thanks for merging in the latest changes. I was able to run storybook and see it work. See the comments. Thanks.
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 understand this is the guidance for uncontrolled inputs, but too much functionality is being separated out of this "component". We need to wrap the functionality implemented in the Story Template, and the functionality of VolunteerActivityReportingQ2() into a single file, with the top component that just taking value as a prop. It's just about where to divide the code.
Can you pull the Template code into VolunteerActivityReportingQ2.jsx and name that VolunteerActivityReportingQ2 and then rename the current VolunteerActivityReportingQ2 to something else.
But the other thing that has to be delt with is that value could change, when new data is fetched. The line
const [value, setValue] = useState(args.value);
won't allow value to change after the initial render.
We will need to add something like
useEffect(()=>setValue(args.value),[args.value])
so that if args.value changes, the state changes.
also, args should be changed to props when implementing a component - just to match the component style.
| <div | ||
| className={`VARQ2-input-container | ||
| ${isOverLimit ? 'over-limit' : ''} | ||
| ${isFocused ? 'input-focused' : ''}`} |
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.
For focus, the :focus pseudo class in the styles, and not have to create a separate state to apply a className for it. And then you won't need to mess with onBlur.
Issue: #1124 - "Volunteer Activity Reporting Q2 Component"
Description
This pull request introduces a new React component, VolunteerActivityReportingQ2, to address the requirements of issue #1124. The component provides a single-line expandable text input for users to summarize their weekly activity, including a real-time character count and validation for a 150-character limit.
Key Changes
New Component:
Added VolunteerActivityReportingQ2.jsx to the
common/components/componentsBySection/VolunteerActivityReporting/
Storybook Integration:
Created VolunteerActivityReportingQ2.stories.jsx with test cases for the idle, filled, and error states.
Styles:
Implemented dedicated styling for the component in _VolunteerActivityReportingQ2.scss to match the design specifications from Figma.
Error Handling:
The component now correctly displays an error message when the character count exceeds 150.
Testing
The component has been verified through Storybook to ensure it works as expected across all specified states.
Additional Changes:
Screenshots
Below are screenshots of the component in different states (idle, filled, error) to provide a visual reference .