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

collapsible trade/single form #134

Merged
merged 12 commits into from
May 15, 2024
Merged

collapsible trade/single form #134

merged 12 commits into from
May 15, 2024

Conversation

aslink87
Copy link
Member

@aslink87 aslink87 commented Oct 3, 2023

All current forms collapse on submit, hiding optional inputs. This reduces noise in the UI so the user can better access the results of their form submissions. An arrow icon next to form submit buttons allow user to expand the form if they'd like to change values.

@aslink87 aslink87 added the enhancement New feature or request label Oct 3, 2023
@aslink87 aslink87 self-assigned this Oct 3, 2023
app/_components/commodities/Form.tsx Outdated Show resolved Hide resolved
app/_components/commodities/Form.tsx Outdated Show resolved Hide resolved
@aslink87
Copy link
Member Author

aslink87 commented May 3, 2024

Been a while! I'm returning to this and looking for some eyes on. I've resolved the conversations above to simplify future discussion, but feel free to look over what we talked about last fall.

At any rate, I've caught this branch up to the current development branch. Then I focused only on adding a collapse feature to one form at the moment so we can focus better. Once we get it set, we can apply the feature to other routes in future PRs.

So let's talk about the trade/single route.

  • I've opted for a button labeled Options to toggle expanding extra form elements that aren't required and/or have defaults and may not be used much.
  • It no longer reacts to what inputs the user interacts with, it's hard-coded as to what elements are included in the toggle state
  • I'll comment on some of the code directly that may need a reminder as we haven't looked at it in quite a while

Here are some photos to paint the big picture:

1920px not expanded
Selection_020

1200px expanded
Selection_021

500px not expanded
Selection_022

@aslink87 aslink87 changed the title collapsible forms collapsible trade/single form May 3, 2024
@@ -9,7 +9,7 @@ interface Props {

const Checkbox = ({ register, label, checked }: Props) => (
<ChakraCheckbox {...register} defaultChecked={checked}>
{label}
<Text fontSize="sm">{label}</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the styles here as well as in the CheckboxGroup, Radio, RadioGroup files to adjust these inputs so that their height was the same as other inputs in our forms. This involved reducing the font size a bit. Here's a pic...

Selection_023

@@ -4,6 +4,7 @@ import { PropsWithChildren } from 'react';

const CheckboxGroup = ({ children }: PropsWithChildren<{}>) => (
<Stack
height={{ base: 'inherit', md: '40px', lg: '40px' }}
Copy link
Member Author

Choose a reason for hiding this comment

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

The input needs to wrap on mobile

Selection_024

@aslink87 aslink87 merged commit 90e7b59 into development May 15, 2024
2 checks passed
@aslink87
Copy link
Member Author

merged after waiting for review, >2 weeks

@aslink87 aslink87 deleted the gamify-comm-form branch May 18, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants