fix: Have an addIcon that adds to both ui and ui-next (#4490)
This commit is contained in:
parent
a5f03764d1
commit
4a125236dd
@ -35,6 +35,7 @@ import colorPickerDialog from './utils/colorPickerDialog';
|
||||
import promptSaveReport from './utils/promptSaveReport';
|
||||
import promptLabelAnnotation from './utils/promptLabelAnnotation';
|
||||
import usePatientInfo from './hooks/usePatientInfo';
|
||||
import * as utils from './utils';
|
||||
|
||||
const defaultExtension: Types.Extensions.Extension = {
|
||||
/**
|
||||
@ -98,4 +99,5 @@ export {
|
||||
promptLabelAnnotation,
|
||||
colorPickerDialog,
|
||||
usePatientInfo,
|
||||
utils,
|
||||
};
|
||||
|
||||
8
extensions/default/src/utils/addIcon.ts
Normal file
8
extensions/default/src/utils/addIcon.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { addIcon as addIconUI } from '@ohif/ui';
|
||||
import { Icons } from '@ohif/ui-next';
|
||||
|
||||
/** Adds the icon to both ui and ui-next */
|
||||
export function addIcon(name, icon) {
|
||||
addIconUI(name, icon);
|
||||
Icons.addIcon(name, icon);
|
||||
}
|
||||
1
extensions/default/src/utils/index.ts
Normal file
1
extensions/default/src/utils/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export { addIcon } from './addIcon';
|
||||
@ -26,3 +26,8 @@ Find and replace
|
||||
@ohif/extension-default.panelModule.measurements
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## addIcon from ui
|
||||
|
||||
The addIcon from the ui package has had a version added in the default extension as
|
||||
`utils.addIcon` which adds to both `ui` and `ui-next`.
|
||||
|
||||
@ -2866,4 +2866,12 @@ export const Icons = {
|
||||
'icon-chevron-patient': (props: IconProps) => Icons.ChevronPatient(props),
|
||||
info: (props: IconProps) => Icons.Info(props),
|
||||
settings: (props: IconProps) => Icons.Settings(props),
|
||||
|
||||
/** Adds an icon to the set of icons */
|
||||
addIcon: (name: string, icon) => {
|
||||
if (Icons[name]) {
|
||||
console.warn('Replacing icon', name);
|
||||
}
|
||||
Icons[name] = icon;
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user