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

Button component #711

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open

Conversation

dzonidoo
Copy link
Contributor

NHUB-464

Checklist

  • This pull request is not adding new forms that use redux
  • This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
  • This pull request is replacing lodash.get with optional chaining for modified code segments

@petrjasek petrjasek added this to the v2.6 milestone Dec 22, 2023
@dzonidoo dzonidoo requested review from MarkLark86, petrjasek and thecalcc and removed request for petrjasek, MarkLark86 and thecalcc January 4, 2024 10:35
@dzonidoo dzonidoo changed the title Create a Button component and replace old button instances with the newly created component Button component Jan 11, 2024
@petrjasek petrjasek modified the milestones: v2.6, v2.7 Jan 15, 2024
@petrjasek
Copy link
Member

hi @dzonidoo can you update the PR so we can merge it?

@petrjasek petrjasek changed the base branch from develop to new-components April 10, 2024 11:26
@petrjasek petrjasek modified the milestones: v2.7, v2.8 May 8, 2024
fritzSF and others added 3 commits August 21, 2024 12:59
@petrjasek petrjasek removed this from the v2.8 milestone Aug 22, 2024
@dzonidoo dzonidoo changed the base branch from new-components to develop September 5, 2024 11:30
@petrjasek petrjasek added this to the v2.9 milestone Sep 6, 2024
@petrjasek petrjasek modified the milestones: v2.9, v3.0 Jan 22, 2025
@dzonidoo dzonidoo requested a review from petrjasek January 30, 2025 11:04
Copy link
Member

Choose a reason for hiding this comment

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

would rename this so it matches the component name like all the other files

export type IPropsSize = 'small' | 'medium' | 'large';

export interface IPropsButtonBase {
value: string;
Copy link
Member

Choose a reason for hiding this comment

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

imo would be better to work with children so it's more like regular button, or call this label because there is no value really like on an input

}

interface IPropsReset extends IPropsButtonBase {
type?: 'reset',
Copy link
Member

Choose a reason for hiding this comment

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

I guess here the type must be reset so should be probably just type: 'reset',
I'm also wondering if we have a usecase where we wouldn't use it with onClick, might be better to make it mandatory if not to get this checked.
same applies to submit

import PropTypes from 'prop-types';
import {gettext} from 'utils';

function CloseModalButton({onClick}: any) {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder what's the usecase for having this one and CloseButton which seems to handle modals as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants