From 964995ea1a5b8e6039a6fe172e2153225744f9f7 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 19 Dec 2020 19:12:09 +0100 Subject: [PATCH] Adjust sui imports (non-cjs) (#4245) --- packages/page-js/src/constants.tsx | 2 +- packages/page-js/src/types.ts | 3 +-- packages/react-components/src/Dropdown.tsx | 3 +-- packages/react-components/src/Input.tsx | 2 +- packages/react-components/src/InputError.tsx | 2 +- packages/react-components/src/Menu.tsx | 3 +-- packages/react-components/src/Modal/Actions.tsx | 2 +- packages/react-components/src/Modal/index.tsx | 2 +- packages/react-components/src/Popup.tsx | 2 +- 9 files changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/page-js/src/constants.tsx b/packages/page-js/src/constants.tsx index 8dc84b89f8..666c1c3b84 100644 --- a/packages/page-js/src/constants.tsx +++ b/packages/page-js/src/constants.tsx @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StrictLabelProps } from 'semantic-ui-react/dist/commonjs/elements/Label'; +import type { StrictLabelProps } from 'semantic-ui-react'; export const STORE_EXAMPLES = 'polkadot-app-js-examples'; export const STORE_SELECTED = 'polkadot-app-js-selected'; diff --git a/packages/page-js/src/types.ts b/packages/page-js/src/types.ts index b73fa06e15..d4474b6054 100644 --- a/packages/page-js/src/types.ts +++ b/packages/page-js/src/types.ts @@ -1,8 +1,7 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { LabelProps } from 'semantic-ui-react/dist/commonjs/elements/Label'; -import type { SemanticShorthandItem } from 'semantic-ui-react/dist/commonjs/generic'; +import type { LabelProps, SemanticShorthandItem } from 'semantic-ui-react'; export type LogType = 'error' | 'log'; diff --git a/packages/react-components/src/Dropdown.tsx b/packages/react-components/src/Dropdown.tsx index 8d30af6d55..06b3aefbdc 100644 --- a/packages/react-components/src/Dropdown.tsx +++ b/packages/react-components/src/Dropdown.tsx @@ -2,8 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useEffect, useRef, useState } from 'react'; -import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button'; -import SUIDropdown, { DropdownProps } from 'semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown'; +import { Button as SUIButton, Dropdown as SUIDropdown, DropdownProps } from 'semantic-ui-react'; import styled from 'styled-components'; import { isUndefined } from '@polkadot/util'; diff --git a/packages/react-components/src/Input.tsx b/packages/react-components/src/Input.tsx index 752e4f8adf..f5ff5d4424 100644 --- a/packages/react-components/src/Input.tsx +++ b/packages/react-components/src/Input.tsx @@ -4,7 +4,7 @@ import type { VoidFn } from './types'; import React, { useCallback, useState } from 'react'; -import SUIInput from 'semantic-ui-react/dist/commonjs/elements/Input/Input'; +import { Input as SUIInput } from 'semantic-ui-react'; import { isFunction, isUndefined } from '@polkadot/util'; diff --git a/packages/react-components/src/InputError.tsx b/packages/react-components/src/InputError.tsx index f13471adf6..96e35a1bef 100644 --- a/packages/react-components/src/InputError.tsx +++ b/packages/react-components/src/InputError.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; -import Label from 'semantic-ui-react/dist/commonjs/elements/Label/Label'; +import { Label } from 'semantic-ui-react'; interface Props { className?: string; diff --git a/packages/react-components/src/Menu.tsx b/packages/react-components/src/Menu.tsx index bb24d20c2d..20e4593f9c 100644 --- a/packages/react-components/src/Menu.tsx +++ b/packages/react-components/src/Menu.tsx @@ -1,8 +1,7 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import SUIMenu from 'semantic-ui-react/dist/commonjs/collections/Menu/Menu'; -import SUIDivider from 'semantic-ui-react/dist/commonjs/elements/Divider/Divider'; +import { Divider as SUIDivider, Menu as SUIMenu } from 'semantic-ui-react'; type MenuDef = typeof SUIMenu & { Divider: typeof SUIDivider; diff --git a/packages/react-components/src/Modal/Actions.tsx b/packages/react-components/src/Modal/Actions.tsx index d033af6786..1a94cdbe3f 100644 --- a/packages/react-components/src/Modal/Actions.tsx +++ b/packages/react-components/src/Modal/Actions.tsx @@ -4,7 +4,7 @@ import type { ActionsProps } from './types'; import React from 'react'; -import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; +import { Modal as SUIModal } from 'semantic-ui-react'; import Button from '../Button'; import ButtonCancel from '../ButtonCancel'; diff --git a/packages/react-components/src/Modal/index.tsx b/packages/react-components/src/Modal/index.tsx index c2e55b69a5..a7d9daa254 100644 --- a/packages/react-components/src/Modal/index.tsx +++ b/packages/react-components/src/Modal/index.tsx @@ -5,7 +5,7 @@ import type { ThemeDef } from '@polkadot/react-components/types'; import type { ActionsProps, ColumnProps, ModalProps } from './types'; import React, { useContext } from 'react'; -import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; +import { Modal as SUIModal } from 'semantic-ui-react'; import { ThemeContext } from 'styled-components'; import Actions from './Actions'; diff --git a/packages/react-components/src/Popup.tsx b/packages/react-components/src/Popup.tsx index 07e5492af0..eb82edccee 100644 --- a/packages/react-components/src/Popup.tsx +++ b/packages/react-components/src/Popup.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; -import SUIPopup, { PopupProps } from 'semantic-ui-react/dist/commonjs/modules/Popup/Popup'; +import { Popup as SUIPopup, PopupProps } from 'semantic-ui-react'; interface Props { children: React.ReactNode;