Skip to content

Commit

Permalink
final migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Dec 17, 2024
1 parent fc934d9 commit d616170
Show file tree
Hide file tree
Showing 44 changed files with 69 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export default function _getStatusComponent({ isHydrated, onStatusClick }) {

switch (isHydrated) {
case true:
StatusIcon = () => <Icons.Legacy name="status-alert" />;
StatusIcon = () => <Icons.ByName name="status-alert" />;

ToolTipMessage = () => <div>This Segmentation is loaded in the segmentation panel</div>;
break;
case false:
StatusIcon = () => (
<Icons.Legacy
<Icons.ByName
className="text-aqua-pale"
name="status-untracked"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export default function _getStatusComponent({ isHydrated, onStatusClick }) {

switch (isHydrated) {
case true:
StatusIcon = () => <Icons.Legacy name="status-alert" />;
StatusIcon = () => <Icons.ByName name="status-alert" />;

ToolTipMessage = () => <div>This Segmentation is loaded in the segmentation panel</div>;
break;
case false:
StatusIcon = () => (
<Icons.Legacy
<Icons.ByName
className="text-aqua-pale"
name="status-untracked"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function _getStatusComponent({

switch (state) {
case 1:
StatusIcon = () => <Icons.Legacy name="status-alert" />;
StatusIcon = () => <Icons.ByName name="status-alert" />;

ToolTipMessage = () => (
<div>
Expand All @@ -444,7 +444,7 @@ function _getStatusComponent({
);
break;
case 2:
StatusIcon = () => <Icons.Legacy name="status-locked" />;
StatusIcon = () => <Icons.ByName name="status-locked" />;

ToolTipMessage = () => (
<div>
Expand All @@ -458,7 +458,7 @@ function _getStatusComponent({
break;
case 3:
StatusIcon = () => (
<Icons.Legacy
<Icons.ByName
className="text-aqua-pale"
name="status-untracked"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Header = ({ title, tooltip }) => (
tight={true}
tooltipBoxClassName="max-w-xs p-2"
>
<Icons.Legacy
<Icons.ByName
name="info-link"
className="text-primary-active h-[14px] w-[14px]"
/>
Expand Down Expand Up @@ -201,7 +201,7 @@ function FrameControls({
className="bg-customblue-30 h-[26px] w-[58px] rounded-[4px]"
onClick={() => onPlayPauseChange(!isPlaying)}
>
<Icons.Legacy
<Icons.ByName
name={getPlayPauseIconName()}
className="active:text-primary-light hover:bg-customblue-300 h-[24px] w-[24px] cursor-pointer text-white"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ function DicomUploadProgress({
<div className="ml-auto flex w-6 justify-center">
{numFails > 0 && (
<div onClick={() => setShowFailedOnly(currentShowFailedOnly => !currentShowFailedOnly)}>
<Icons.Legacy
<Icons.ByName
className="cursor-pointer"
name="icon-status-alert"
></Icons.Legacy>
></Icons.ByName>
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ const DicomUploadProgressItem = memo(
switch (dicomFileUploader.getStatus()) {
case UploadStatus.Success:
return (
<Icons.Legacy
<Icons.ByName
name="status-tracked"
className="text-primary-light"
/>
);
case UploadStatus.InProgress:
return <Icons.Legacy name="icon-transferring" />;
return <Icons.ByName name="icon-transferring" />;
case UploadStatus.Failed:
return <Icons.Legacy name="icon-alert-small" />;
return <Icons.ByName name="icon-alert-small" />;
case UploadStatus.Cancelled:
return <Icons.Legacy name="icon-alert-outline" />;
return <Icons.ByName name="icon-alert-outline" />;
default:
return <></>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function VolumeRenderingPresets({
<AllInOneMenu.Item
label="Rendering Presets"
icon={<Icons.VolumeRendering />}
rightIcon={<Icons.Legacy name="action-new-dialog" />}
rightIcon={<Icons.ByName name="action-new-dialog" />}
onClick={onClickPresets}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function VolumeRenderingPresetsContent({
handleApply({ preset: preset.name, viewportId });
}}
>
<Icons.Legacy
<Icons.ByName
name={preset.name}
className={
selectedPreset?.name === preset.name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ReactElement, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Icons, useModal } from '@ohif/ui';
import { useModal } from '@ohif/ui';
import { Icons } from '@ohif/ui-next';
import { Types } from '@ohif/core';
import DataSourceConfigurationModalComponent from './DataSourceConfigurationModalComponent';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ function DataSourceConfigurationModalComponent({
>
<div className="text- flex items-center gap-2">
{itemLabelIndex < selectedItems.length ? (
<Icons.Legacy name="status-tracked" />
<Icons.ByName name="status-tracked" />
) : (
<Icons.Legacy name="status-untracked" />
<Icons.ByName name="status-untracked" />
)}
<div className={classNames(NO_WRAP_ELLIPSIS_CLASS_NAMES)}>{t(itemLabel)}</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion extensions/default/src/Components/ItemListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ItemListComponent({
<Button
onClick={() => onItemClicked(item)}
className="invisible group-hover:visible"
endIcon={<Icons.Legacy name="arrow-left" />}
endIcon={<Icons.ByName name="arrow-left" />}
>
{t('Select')}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion platform/app/src/routes/Debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Debug() {
<p className="text-primary-active mt-4 text-xl font-semibold">Debug Information</p>
<div className="mt-4 flex items-center space-x-2">
<p className="text-md text-white">Cross Origin Isolated (COOP/COEP)</p>
<Icons.Legacy
<Icons.ByName
name={
window.crossOriginIsolated ? 'notifications-success' : 'notifications-error'
}
Expand Down
2 changes: 1 addition & 1 deletion platform/ui-next/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function Header({
>
{IconComponent && (
<span className="flex h-4 w-4 items-center justify-center">
<Icons.Legacy name={IconComponent.name} />
<Icons.ByName name={IconComponent.name} />
</span>
)}
<span className="flex-1">{option.title}</span>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui-next/src/components/Icons/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ export const Icons = {
Icons[name] = icon;
},

Legacy: ({ name, className, ...props }: { name: string; className?: string }) => {
ByName: ({ name, className, ...props }: { name: string; className?: string }) => {
const IconComponent = Icons[name];

if (!IconComponent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const AdvancedToolbox = ({ title, items }) => {
'hover:bg-primary-light cursor-pointer hover:cursor-pointer hover:text-black'
)}
>
<Icons.Legacy name={item.icon} />
<Icons.ByName name={item.icon} />
</div>
</div>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/AllInOneMenu/BackItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BackItem = ({ backLabel, onBackClick }: BackItemProps) => {
className="all-in-one-menu-item all-in-one-menu-item-effects"
onClick={onBackClick}
>
<Icons.Legacy name="content-prev"></Icons.Legacy>
<Icons.ByName name="content-prev"></Icons.ByName>

<div className="pl-2">{backLabel || 'Back to Display Options'}</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/AllInOneMenu/IconMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function IconMenu({
className={iconClassName}
onClick={toggleMenuVisibility}
>
<Icons.Legacy name={icon} />
<Icons.ByName name={icon} />
</div>
<AllInOneMenu.Menu
key={menuKey}
Expand Down
6 changes: 3 additions & 3 deletions platform/ui/src/components/AllInOneMenu/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ const SubMenu = (props: SubMenuProps) => {
onClick={onClickHandler}
>
{props.itemIcon && (
<Icons.Legacy
<Icons.ByName
name={props.itemIcon}
className="mr-2"
></Icons.Legacy>
></Icons.ByName>
)}
<div className="mr-auto">{props.itemLabel}</div>
<Icons.Legacy name="content-next"></Icons.Legacy>
<Icons.ByName name="content-next"></Icons.ByName>
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions platform/ui/src/components/CheckBox/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const CheckBox: React.FC<{
onClick={handleClick}
>
{isChecked ? (
<Icons.Legacy name="checkbox-checked" />
<Icons.ByName name="checkbox-checked" />
) : (
<Icons.Legacy name="checkbox-unchecked" />
<Icons.ByName name="checkbox-unchecked" />
)}
<Typography
variant={labelVariant ?? 'subtitle'}
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/CinePlayer/CinePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CinePlayer: React.FC<CinePlayerProps> = ({
'border-secondary-light/60 bg-primary-dark inline-flex select-none items-center gap-2 rounded border px-2 py-2'
}
>
<Icons.Legacy
<Icons.ByName
name={getPlayPauseIconName()}
className="active:text-primary-light hover:bg-customblue-300 cursor-pointer text-white hover:rounded"
onClick={() => onPlayPauseChange(!isPlaying)}
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/ContextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ContextMenu = ({ items, ...props }) => {
>
<Typography>{item.label}</Typography>
{item.iconRight && (
<Icons.Legacy
<Icons.ByName
name={item.iconRight}
className="inline"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DisplaySetMessageListTooltip = ({ messages, id }): React.ReactNode => {
if (messages?.size()) {
return (
<>
<Icons.Legacy
<Icons.ByName
id={id}
onMouseOver={() => setIsOpen(true)}
onFocus={() => setIsOpen(true)}
Expand Down
4 changes: 2 additions & 2 deletions platform/ui/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Dropdown = ({
data-cy={id}
>
{!!icon && (
<Icons.Legacy
<Icons.ByName
name={icon}
className="mr-2 w-4 text-white"
/>
Expand Down Expand Up @@ -96,7 +96,7 @@ const Dropdown = ({
<div className="flex items-center">
{children}
{showDropdownIcon && (
<Icons.Legacy
<Icons.ByName
name="chevron-down"
className="ml-1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ExpandableToolbarButton = ({
onClick={onClickHandler}
key={id}
>
<Icons.Legacy name={icon} />
<Icons.ByName name={icon} />
</IconButton>
<div className="absolute z-10 pt-4">
<div className={classnames('ExpandableToolbarButton__content w-48', className)}>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Header({
size="initial"
className="text-primary-active hover:bg-primary-dark h-full w-full"
>
<Icons.Legacy name="icon-settings" />
<Icons.ByName name="icon-settings" />
</IconButton>
</Dropdown>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function HeaderPatientInfo({ servicesManager, appConfig }: withAppTypes) {
className="hover:bg-primary-dark flex cursor-pointer items-center justify-center gap-1 rounded-lg"
onClick={handleOnClick}
>
<Icons.Legacy
<Icons.ByName
name={isMixedPatients ? 'icon-multiple-patients' : 'icon-patient'}
className="text-primary-active"
/>
Expand Down
6 changes: 3 additions & 3 deletions platform/ui/src/components/InputNumber/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const InputNumber: React.FC<{
className={arrowHorizontalClassName}
onClick={() => decrement()}
>
<Icons.Legacy name="arrow-left" />
<Icons.ByName name="arrow-left" />
</div>
)}
<input
Expand All @@ -148,7 +148,7 @@ const InputNumber: React.FC<{
className={arrowHorizontalClassName}
onClick={() => increment()}
>
<Icons.Legacy name="arrow-right" />
<Icons.ByName name="arrow-right" />
</div>
)}
{showAdjustmentArrows && arrowsDirection === 'vertical' && (
Expand Down Expand Up @@ -177,7 +177,7 @@ const ArrowButton = ({ onClick, rotate = false }: { onClick: () => void; rotate?
className={`text-[#726f7e] ${rotate ? 'rotate-180 transform' : ''}`}
onClick={onClick}
>
<Icons.Legacy name="arrow-down" />
<Icons.ByName name="arrow-down" />
</IconButton>
);

Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/LayoutPreset/LayoutPreset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function LayoutPreset({
}}
data-cy={title}
>
<Icons.Legacy
<Icons.ByName
name={icon}
className="group-hover:text-primary-light"
/>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/Notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Notification = ({
tabIndex={0}
>
<div className="flex grow items-center">
<Icons.Legacy
<Icons.ByName
name={icon}
className={classnames('h-6 w-6', color)}
/>
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/PanelSection/PanelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PanelSection = ({ title, children, actionIcons = [], childrenClassName })
<div className="text-aqua-pale">{title}</div>
<div className="flex items-center space-x-1">
{actionIcons.map((icon, index) => (
<Icons.Legacy
<Icons.ByName
key={index}
name={icon.name}
onClick={e => {
Expand Down
2 changes: 1 addition & 1 deletion platform/ui/src/components/PatientInfo/PatientInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function PatientInfo({
isOpen && (
<div className="flex py-2">
<div className="flex pt-1">
<Icons.Legacy
<Icons.ByName
name="info-link"
className="text-primary-main w-4"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ProgressItemDetail = ({ option }: { option: ProgressDropdownOption }): Rea
<>
{icon && (
<div>
<Icons.Legacy
<Icons.ByName
name={icon}
className={iconClassNames}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const SegmentationConfig = ({
onClick={() => setIsMinimized(!isMinimized)}
className="flex cursor-pointer items-center pl-2 pb-[9px]"
>
<Icons.Legacy
<Icons.ByName
name="panel-group-open-close"
className={classNames('h-5 w-5 cursor-pointer text-white transition duration-300', {
'rotate-90 transform': !isMinimized,
Expand Down
Loading

0 comments on commit d616170

Please sign in to comment.