-
Notifications
You must be signed in to change notification settings - Fork 423
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
Adding of clear and cancel button in create preset form #8921
base: develop
Are you sure you want to change the base?
Adding of clear and cancel button in create preset form #8921
Conversation
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
LGTM
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.
LGTM; just curious why shadow was disabled for the cancel button
|
||
<div className="cui-form-button-group mt-4 flex w-full flex-col justify-end space-y-2 sm:flex-row sm:space-x-2 sm:space-y-0"> | ||
<Cancel | ||
shadow={false} |
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.
shadow={false} |
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.
Done the changes. I thought to maintain a simpler and cleaner design.
@rithviknishad Can you please assign 2 story points for this |
@Rishith25 for minor changes we keep it to 1. |
@nihal467 Done the changes of clear button alignment |
/> | ||
</div> | ||
|
||
<div className="cui-form-button-group mt-4 flex w-full flex-col justify-end space-y-2 sm:flex-row sm:space-x-2 sm:space-y-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.
<div className="cui-form-button-group mt-4 flex w-full flex-col justify-end space-y-2 sm:flex-row sm:space-x-2 sm:space-y-0"> | |
<div className="cui-form-button-group"> |
setCreatePreset(undefined); | ||
setPresetName(""); | ||
}} | ||
className="ml-0 w-full sm:ml-2 sm:w-auto" |
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.
className="ml-0 w-full sm:ml-2 sm:w-auto" |
@@ -417,6 +429,7 @@ export default function ConfigureCamera(props: Props) { | |||
cameraPresetsQuery.refetch(); | |||
}} | |||
disabled={!presetName} | |||
className="w-full sm:w-auto" |
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.
className="w-full sm:w-auto" |
@@ -35,30 +36,47 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => { | |||
const hasTrailing = !!(trailing || trailingFocused); | |||
const hasIcon = hasLeading || hasTrailing; | |||
const [showPassword, setShowPassword] = useState(false); | |||
const isClear = props.isClear || false; |
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.
null/undefined is falsey, it's no-op when used in conditional statements.
const isClear = props.isClear || false; |
<div className="relative w-full"> | ||
<TextFormField | ||
name="preset-name" | ||
className="w-full py-4" | ||
value={presetName} | ||
onChange={({ value }) => setPresetName(value)} | ||
errorClassName="hidden" | ||
placeholder={t("preset_name_placeholder")} | ||
suggestions={presetNameSuggestions} | ||
isClear={true} | ||
/> | ||
</div> |
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.
why wrap in a div with relative
class here? is this needed?
@@ -24,6 +24,7 @@ export type TextFormFieldProps = FormFieldBaseProps<string> & | |||
trailingPadding?: string | undefined; | |||
leadingPadding?: string | undefined; | |||
suggestions?: string[]; | |||
isClear?: boolean; |
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.
isClear
doesn't make sense. One may not understand what this prop does by simply reading it.
isClear?: boolean; | |
clearable?: boolean; |
@rithviknishad Changes are done |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist