From 1e91cc23f3da31602c03d2d62f8da2cd2ef418e2 Mon Sep 17 00:00:00 2001 From: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:29:14 -0400 Subject: [PATCH] chore(admin): simplify `@strapi` imports (#10) * chore(admin): simplify `@strapi` imports * chore(playground): remove plugin generated types --- admin/src/components/NoteCreateModal/index.js | 14 +++++++------- admin/src/components/NoteListItem/index.js | 8 ++------ .../components/NoteListLayoutContent/index.js | 2 +- .../components/NoteListLayoutFooter/index.js | 4 ++-- .../components/NoteListLayoutHeader/index.js | 4 +--- admin/src/components/NoteListLayout/index.js | 2 +- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/admin/src/components/NoteCreateModal/index.js b/admin/src/components/NoteCreateModal/index.js index 520598c..5e0ee4b 100644 --- a/admin/src/components/NoteCreateModal/index.js +++ b/admin/src/components/NoteCreateModal/index.js @@ -5,13 +5,13 @@ import { ModalBody, ModalHeader, ModalFooter, -} from '@strapi/design-system/ModalLayout'; -import { TextInput } from '@strapi/design-system/TextInput'; -import { Textarea } from '@strapi/design-system/Textarea'; -import { Button } from '@strapi/design-system/Button'; -import { Typography } from '@strapi/design-system/Typography'; -import { Stack } from '@strapi/design-system/Stack'; -import Check from '@strapi/icons/Check'; + TextInput, + Textarea, + Button, + Typography, + Stack, +} from '@strapi/design-system'; +import { Check } from '@strapi/icons'; import { useNote } from '../../hooks/useNote'; const NoteModalCreate = ({ toggleModal, note = {}, entity }) => { diff --git a/admin/src/components/NoteListItem/index.js b/admin/src/components/NoteListItem/index.js index c1c00b2..35160c7 100644 --- a/admin/src/components/NoteListItem/index.js +++ b/admin/src/components/NoteListItem/index.js @@ -1,11 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Box } from '@strapi/design-system/Box'; -import { Flex } from '@strapi/design-system/Flex'; -import Trash from '@strapi/icons/Trash'; -import Pencil from '@strapi/icons/Pencil'; -import { Typography } from '@strapi/design-system/Typography'; -import { IconButton, IconButtonGroup } from '@strapi/design-system/IconButton'; +import { Box, Flex, Typography, IconButton, IconButtonGroup } from '@strapi/design-system'; +import { Trash, Pencil } from '@strapi/icons'; import { useNote } from '../../hooks/useNote'; const NoteListItem = ({ note, setActiveNote, toggleModal }) => { diff --git a/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js b/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js index 340c126..9d92d92 100644 --- a/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js +++ b/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; -import { Stack } from '@strapi/design-system/Stack'; +import { Stack } from '@strapi/design-system'; import { NoteModalCreate } from '../../../NoteCreateModal'; import { NoteListItem } from '../../../NoteListItem'; import { useNote } from '../../../../hooks/useNote'; diff --git a/admin/src/components/NoteListLayout/components/NoteListLayoutFooter/index.js b/admin/src/components/NoteListLayout/components/NoteListLayoutFooter/index.js index 2df575d..8ddbaf2 100644 --- a/admin/src/components/NoteListLayout/components/NoteListLayoutFooter/index.js +++ b/admin/src/components/NoteListLayout/components/NoteListLayoutFooter/index.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; -import { TextButton } from '@strapi/design-system/TextButton'; -import Plus from '@strapi/icons/Plus'; +import { TextButton } from '@strapi/design-system'; +import { Plus } from '@strapi/icons'; import { NoteModalCreate } from '../../../NoteCreateModal'; const NoteListLayoutFooter = ({ entity }) => { const [isVisible, setIsVisible] = useState(false); diff --git a/admin/src/components/NoteListLayout/components/NoteListLayoutHeader/index.js b/admin/src/components/NoteListLayout/components/NoteListLayoutHeader/index.js index 6d1ca67..df49f45 100644 --- a/admin/src/components/NoteListLayout/components/NoteListLayoutHeader/index.js +++ b/admin/src/components/NoteListLayout/components/NoteListLayoutHeader/index.js @@ -1,7 +1,5 @@ import React from 'react'; -import { Box } from '@strapi/design-system/Box'; -import { Divider } from '@strapi/design-system/Divider'; -import { Typography } from '@strapi/design-system/Typography'; +import { Box, Divider, Typography } from '@strapi/design-system'; const NoteListLayoutHeader = () => { return ( diff --git a/admin/src/components/NoteListLayout/index.js b/admin/src/components/NoteListLayout/index.js index 0f91f6d..17f7060 100644 --- a/admin/src/components/NoteListLayout/index.js +++ b/admin/src/components/NoteListLayout/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { useCMEditViewDataManager } from '@strapi/helper-plugin'; -import { Box } from '@strapi/design-system/Box'; +import { Box } from '@strapi/design-system'; import { NoteListLayoutHeader } from './components/NoteListLayoutHeader'; import { NoteListLayoutFooter } from './components/NoteListLayoutFooter'; import { NoteListLayoutContent } from './components/NoteListLayoutContent';