Skip to content

Commit ceaba3f

Browse files
committed
fix: optimize import
2 parents 5bdc859 + 6bcb905 commit ceaba3f

26 files changed

Lines changed: 110 additions & 62 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import Container from './layouts/container';
2-
import Sidebar from './layouts/sidebar';
3-
import { useAvatarOption } from './hooks';
1+
import { Container, Sidebar } from '@/layouts';
2+
import { useAvatarOption } from '@/hooks';
43
import './App.less';
54

65
export default function App() {

src/assets/react.svg

Lines changed: 2 additions & 1 deletion
Loading

src/components/action-bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useDispatch } from 'react-redux';
2-
import { ActionType } from '../../enums';
2+
import { ActionType } from '@/enums';
33
import IconBack from '../../assets/icons/icon-back.svg';
44
import IconFlip from '../../assets/icons/icon-flip.svg';
55
import IconNext from '../../assets/icons/icon-next.svg';

src/components/color-list-item/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { SETTINGS } from '../../constants';
2-
import { AvatarOption } from '../../types';
1+
import { SETTINGS } from '@/constants';
2+
import { AvatarOption } from '@/types';
33

44
interface IProps {
55
avatarOption: AvatarOption

src/components/configurator/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import PerfectScrollbar from '../perfect-scrollbar';
2+
import { AvatarOption } from '@/types';
23
import './style.less';
3-
import { AvatarOption } from '../../types';
4+
45
interface IProps {
56
avatarOption: AvatarOption
67
setAvatarOption: (newOption: AvatarOption) => void

src/components/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import ActionBar from './action-bar';
2+
import ColorListItem from './color-list-item';
3+
import Configurator from './configurator';
4+
import Logo from './logo';
5+
import PerfectScrollbar from './perfect-scrollbar';
6+
import ReactColorAvatar from './react-color-avatar';
7+
import SectionWrapper from './section-wrapper';
8+
import WrapperShapeItem from './wrapper-shape-item';
9+
10+
export {
11+
ActionBar,
12+
ColorListItem,
13+
Configurator,
14+
Logo,
15+
PerfectScrollbar,
16+
ReactColorAvatar,
17+
SectionWrapper,
18+
WrapperShapeItem
19+
}

src/components/perfect-scrollbar/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { useEffect, useRef, useState } from 'react';
2-
import SectionWrapper from '../section-wrapper';
3-
import ColorListItem from '../color-list-item';
4-
import WrapperShapeItem from '../wrapper-shape-item';
5-
import { AvatarOption } from '../../types';
6-
import { BeardShape, WidgetShape, WidgetType } from '../../enums';
7-
import { getWidgets } from '../../utils';
8-
import { AVATAR_LAYER, SETTINGS } from '../../constants';
2+
import { SectionWrapper, ColorListItem, WrapperShapeItem } from '@/components';
3+
import { AvatarOption } from '@/types';
4+
import { BeardShape, WidgetShape, WidgetType } from '@/enums';
5+
import { getWidgets } from '@/utils';
6+
import { AVATAR_LAYER, SETTINGS } from '@/constants';
97

108
interface IProps {
119
avatarOption: AvatarOption

src/components/react-color-avatar/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { CSSProperties, useEffect, useState } from 'react';
2-
import Background from '../widgets/background';
3-
import { WidgetType, WrapperShape } from '../../enums';
4-
import { AvatarOption } from '../../types';
5-
import { AVATAR_LAYER, NONE } from '../../constants';
6-
import { widgetData } from '../../utils/dynamic-data';
2+
import { Background } from '@/components/widgets';
3+
import { WidgetType, WrapperShape } from '@/enums';
4+
import { AvatarOption } from '@/types';
5+
import { AVATAR_LAYER, NONE } from '@/constants';
6+
import { widgetData } from '@/utils/dynamic-data';
77
import './style.less';
88

99
interface IReactColorAvatarProps {

src/components/section-wrapper/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2+
import './style.less'
23

34
interface IProps {
45
title?: string
56
children: React.ReactNode
67
}
7-
import './style.less'
88

99
export default function SectionWrapper(props: IProps) {
1010
const { title, children } = props;

src/components/widgets/background/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AvatarOption } from '../../../types';
1+
import { AvatarOption } from '@/types';
22
import './style.less';
33

44
interface BackgroundProps {

0 commit comments

Comments
 (0)