-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: Input now support refs #123
Changes from all commits
abc7936
1de8722
236681b
f4c6f0e
8e808b8
35df00c
65917fc
65d3846
1c82b57
2f111d5
273fd0f
746eb3f
f03f4f4
7cc7e90
f719332
1d38bff
3862fe2
155b0fe
7f7fb5c
5793d41
a8b0668
f4a9a95
361d2ab
b956008
d4dbfc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,4 +138,4 @@ export const LightTheme: IMpThemeConfig = { | |
mpColorBorderDisabled: '#dcdcd8', | ||
}, | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { type ForwardRefExoticComponent, type RefAttributes } from 'react' | ||
import { Input as AntInput, type InputRef } from 'antd' | ||
import { InternalInput, type IInputProps } from 'src/components/data-entry/Input/Input' | ||
|
||
type CompoundedComponent = ForwardRefExoticComponent<IInputProps & RefAttributes<InputRef>> & { | ||
Group: typeof AntInput.Group | ||
Search: typeof AntInput.Search | ||
TextArea: typeof AntInput.TextArea | ||
Password: typeof AntInput.Password | ||
} | ||
|
||
const Input = InternalInput as CompoundedComponent | ||
|
||
Input.Group = AntInput.Group | ||
Input.Password = AntInput.Password | ||
Input.Search = AntInput.Search | ||
Input.TextArea = AntInput.TextArea | ||
|
||
export { Input, type InputRef, type IInputProps } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious why we need an index for Input only, cant this go in src/components/index? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm testing these to see if we can use the already present index |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ export function SuiteLogo(props: IGlobalNavigationLogo) { | |
{props.label} | ||
</Center> | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { | |
type INavigationOrg, | ||
type INavigationWorkspace, | ||
type IWorkspaceSelectorDisplayItem, | ||
type InputRef, | ||
Popover, | ||
} from 'src/components' | ||
import { Flex } from 'src/components' | ||
|
@@ -17,10 +18,6 @@ import { useEffect } from 'react' | |
import { useMemo } from 'react' | ||
import { debounce, hasImageAtSrc } from 'src/utils/utils' | ||
import { getInitials } from 'src/utils/utils' | ||
|
||
// TODO: Need to make our Input component comply with forwardRef to be able to import it from src/components | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise TODONE! |
||
// As soon as https://github.com/mParticle/aquarium/pull/123 is merged | ||
import { type InputRef } from 'antd' | ||
import { WorkspaceSelectorContent } from 'src/components/navigation/GlobalNavigation/WorkspaceSelector/WorkspaceSelectorContent' | ||
import { useMount } from 'src/hooks/useMount' | ||
import { PaddingXxs } from 'src/styles/style' | ||
|
@@ -151,12 +148,14 @@ export function WorkspaceSelector(props: IWorkspaceSelectorProps) { | |
signoutOptions={props.signoutOptions} | ||
menuItems={menuItems} | ||
/> | ||
}> | ||
} | ||
> | ||
<div | ||
className="globalNavigation__item workspaceSelector__menuItem" | ||
onClick={e => { | ||
focusOnInput(true) | ||
}}> | ||
}} | ||
> | ||
<Avatar {...props.avatarOptions} className="workspaceSelector__avatar"> | ||
{getInitialsIfNoImage(hasImage, workspaceInitials)} | ||
</Avatar> | ||
|
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.
Try to keep this in the Input file if we can.