Skip to content

Commit

Permalink
fix: remove ghost prop for form elements, #641
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Feb 28, 2023
1 parent 5c0f17c commit e844f84
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/components/EstimateComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Input } from './Input';
const ComboBox = dynamic(() => import('./ComboBox'));

interface EstimateComboBoxProps {
text: React.ComponentProps<typeof Button>['text'];
text?: React.ComponentProps<typeof Button>['text'];
mask: string;
value?: {
date: string;
Expand Down Expand Up @@ -110,7 +110,7 @@ const createValue = (date: string | Date, locale: TLocale) => {
};

export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBoxProps>(
({ text, value, defaultValuePlaceholder, placeholder, mask, disabled, error, onChange }, ref) => {
({ text = '', value, defaultValuePlaceholder, placeholder, mask, disabled, error, onChange }, ref) => {
const { locale } = usePageContext();
const inputVal = parseLocaleDate(value?.date || defaultValuePlaceholder?.date, { locale });
const [inputState, setInputState] = useState(inputVal ? createLocaleDate(inputVal, { locale }) : '');
Expand Down Expand Up @@ -176,6 +176,7 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
value={value}
disabled={disabled}
error={error}
placement="top-start"
items={['Q1', 'Q2', 'Q3', 'Q4']}
maxWidth={100}
minWidth={100}
Expand All @@ -184,7 +185,6 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
<StyledTriggerContainer>
{changed && <StyledCleanButton onClick={onCleanClick}>+</StyledCleanButton>}
<Button
ghost
disabled={props.disabled}
ref={props.ref}
text={buttonText}
Expand Down
3 changes: 2 additions & 1 deletion src/components/GoalParentComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ export const GoalParentComboBox = React.forwardRef<HTMLDivElement, GoalParentCom
visible={completionVisible}
error={error}
disabled={disabled}
placement="top-start"
items={items}
onChange={onChange}
renderTrigger={(props) => (
<Button ghost disabled={props.disabled} ref={props.ref} text={props.text} onClick={props.onClick} />
<Button disabled={props.disabled} ref={props.ref} text={props.text} onClick={props.onClick} />
)}
renderInput={(props) => (
<StyledInput
Expand Down
1 change: 0 additions & 1 deletion src/components/PriorityDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const PriorityDropdown = React.forwardRef<HTMLDivElement, PriorityDropdow
renderTrigger={(props) => (
<Button
ref={props.ref}
ghost
onClick={props.onClick}
disabled={props.disabled}
iconLeft={
Expand Down
1 change: 0 additions & 1 deletion src/components/ReactionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const ReactionsButton = React.memo(

return (
<StyledButton
ghost
ref={ref}
text={count && count > 1 ? String(count) : undefined}
iconLeft={
Expand Down
1 change: 0 additions & 1 deletion src/components/StateDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const StateDropdown = React.forwardRef<HTMLDivElement, StateDropdownProps
disabled={!flowId || disabled}
renderTrigger={(props) => (
<Button
ghost
ref={props.ref}
text={props.text}
onClick={props.onClick}
Expand Down
3 changes: 1 addition & 2 deletions src/components/TagComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Input } from './Input';
const ComboBox = dynamic(() => import('./ComboBox'));

interface TagComboBoxProps {
text: React.ComponentProps<typeof Button>['text'];
text?: React.ComponentProps<typeof Button>['text'];
query?: string;
value?: Array<Partial<TagModel>>;
disabled?: boolean;
Expand Down Expand Up @@ -124,7 +124,6 @@ export const TagComboBox = React.forwardRef<HTMLDivElement, TagComboBoxProps>(
items={items}
renderTrigger={(props) => (
<Button
ghost
ref={props.ref}
text={props.text}
disabled={props.disabled}
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ export const UserComboBox = React.forwardRef<HTMLDivElement, UserComboBoxProps>(
visible={completionVisible}
disabled={disabled}
error={error}
placement="top-start"
items={data?.findActivity}
onChange={onChange}
renderTrigger={(props) => (
<Button
ghost
ref={props.ref}
text={props.text}
disabled={props.disabled}
Expand Down

0 comments on commit e844f84

Please sign in to comment.