Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge deploy #1

Merged
merged 2 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Container, Sidebar } from '@/layouts';
import { useAvatarOption } from '@/hooks';
import { Container, Sidebar } from '@layouts';
import { useAvatarOption } from '@hooks';
import './App.less';

export default function App() {
Expand Down
11 changes: 5 additions & 6 deletions src/components/action-bar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useDispatch } from 'react-redux';
import { ActionType } from '@/enums';
import IconBack from '../../assets/icons/icon-back.svg';
import IconFlip from '../../assets/icons/icon-flip.svg';
import IconNext from '../../assets/icons/icon-next.svg';
// import { AppState } from '../../types';
import './style.less'
import { ActionType } from '@enums';
import IconBack from '@assets/icons/icon-back.svg';
import IconFlip from '@assets/icons/icon-flip.svg';
import IconNext from '@assets/icons/icon-next.svg';
import './style.less';

interface IProps {
flipped: boolean
Expand Down
4 changes: 2 additions & 2 deletions src/components/color-list-item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SETTINGS } from '@/constants';
import { AvatarOption } from '@/types';
import { SETTINGS } from '@constants';
import { AvatarOption } from '@types';

interface IProps {
avatarOption: AvatarOption
Expand Down
2 changes: 1 addition & 1 deletion src/components/configurator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PerfectScrollbar from '../perfect-scrollbar';
import { AvatarOption } from '@/types';
import { AvatarOption } from '@types';
import './style.less';

interface IProps {
Expand Down
3 changes: 1 addition & 2 deletions src/components/logo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// import React from 'react';
import logoSvg from '../../assets/logo.svg';
import logoSvg from '@assets/logo.svg';

export default function Logo() {
return <img src={logoSvg} alt="logo" />;
Expand Down
10 changes: 5 additions & 5 deletions src/components/perfect-scrollbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect, useRef, useState } from 'react';
import { SectionWrapper, ColorListItem, WrapperShapeItem } from '@/components';
import { AvatarOption } from '@/types';
import { BeardShape, WidgetShape, WidgetType } from '@/enums';
import { getWidgets } from '@/utils';
import { AVATAR_LAYER, SETTINGS } from '@/constants';
import { ColorListItem, SectionWrapper, WrapperShapeItem } from '@components';
import { AvatarOption } from '@types';
import { BeardShape, WidgetShape, WidgetType } from '@enums';
import { getWidgets } from '@utils';
import { AVATAR_LAYER, SETTINGS } from '@constants';

interface IProps {
avatarOption: AvatarOption
Expand Down
10 changes: 5 additions & 5 deletions src/components/react-color-avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CSSProperties, RefObject, useEffect, useState } from 'react';
import { Background } from '@/components/widgets';
import { WidgetShape, WidgetType, WrapperShape } from '@/enums';
import { AvatarOption, Widget } from '@/types';
import { AVATAR_LAYER, NONE } from '@/constants';
import { widgetData } from '@/utils/dynamic-data';
import { Background } from '@components/widgets';
import { WidgetShape, WidgetType, WrapperShape } from '@enums';
import { AvatarOption, Widget } from '@types';
import { AVATAR_LAYER, NONE } from '@constants';
import { widgetData } from '@utils/dynamic-data';
import './style.less';

interface IReactColorAvatarProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/section-wrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import './style.less'
import './style.less';

interface IProps {
title?: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/background/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AvatarOption } from '@/types';
import { AvatarOption } from '@types';
import './style.less';

interface BackgroundProps {
Expand Down
6 changes: 3 additions & 3 deletions src/components/wrapper-shape-item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SETTINGS } from '@/constants';
import { WrapperShape } from '@/enums';
import { AvatarOption } from '@/types';
import { SETTINGS } from '@constants';
import { WrapperShape } from '@enums';
import { AvatarOption } from '@types';

interface IProps {
avatarOption: AvatarOption
Expand Down
4 changes: 2 additions & 2 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AvatarOption, AvatarSettings } from '@/types';
import { AvatarOption, AvatarSettings } from '@types';
import {
BeardShape,
ClothesShape,
Expand All @@ -14,7 +14,7 @@ import {
TopsShape,
WidgetType,
WrapperShape
} from '@/enums';
} from '@enums';

export const AVATAR_LAYER: Readonly<{
[key in `${WidgetType}`]: { zIndex: number }
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useAvatarOption/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDispatch, useSelector } from 'react-redux';
import { SET_AVATAR_OPTION } from '@/store/mutation-type';
import type { AppState, AvatarOption } from '@/types';
import { SET_AVATAR_OPTION } from '@store/mutation-type';
import type { AppState, AvatarOption } from '@types';

export default function useAvatarOption() {
const avatarOption = useSelector((state: AppState) => state.history.present);
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSideBar/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDispatch, useSelector } from 'react-redux';
import { SET_SIDER_STATUS } from '@/store/mutation-type';
import { AppState } from '@/types';
import { SET_SIDER_STATUS } from '@store/mutation-type';
import { AppState } from '@types';

export default function useSideBar() {
const isCollapsed = useSelector((state: AppState) => state.isCollapsed);
Expand Down
10 changes: 5 additions & 5 deletions src/layouts/container/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRef, useState } from 'react';
import { ActionBar, ReactColorAvatar } from '@/components';
import { Header, Footer } from '@/layouts';
import { AvatarOption } from '@/types';
import { getRandomAvatarOption, getSpecialAvatarOption } from '@/utils';
import { DOWNLOAD_DELAY, NOT_COMPATIBLE_AGENTS, TRIGGER_PROBABILITY } from '@/constants';
import { ActionBar, ReactColorAvatar } from '@components';
import { Footer, Header } from '@layouts';
import { AvatarOption } from '@types';
import { getRandomAvatarOption, getSpecialAvatarOption } from '@utils';
import { DOWNLOAD_DELAY, NOT_COMPATIBLE_AGENTS, TRIGGER_PROBABILITY } from '@constants';
import { name } from '../../../package.json';
import './style.less';

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { version } from '../../../package.json';
import './style.less'
import './style.less';

export default function Footer() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logo } from '@/components';
import IconGitHub from '../../assets/icons/icon-github.svg';
import './style.less'
import { Logo } from '@components';
import IconGitHub from '@assets/icons/icon-github.svg';
import './style.less';

export default function Header() {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Container from '@/layouts/container';
import Footer from '@/layouts/footer';
import Header from '@/layouts/header';
import Sidebar from '@/layouts/sidebar';
import Container from '@layouts/container';
import Footer from '@layouts/footer';
import Header from '@layouts/header';
import Sidebar from '@layouts/sidebar';

export {
Container,
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Configurator } from '@/components';
import { AvatarOption } from '@/types';
import { useSideBar } from '@/hooks';
import IconRight from '../../assets/icons/icon-right.svg';
import { Configurator } from '@components';
import { AvatarOption } from '@types';
import { useSideBar } from '@hooks';
import IconRight from '@assets/icons/icon-right.svg';
import './style.less';

interface IProps {
Expand Down
8 changes: 4 additions & 4 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { combineReducers, legacy_createStore } from 'redux';
import { getRandomAvatarOption } from '@/utils';
import { WrapperShape } from '@/enums';
import { SCREEN } from '@/constants';
import { ActionTypes } from '@/types';
import { getRandomAvatarOption } from '@utils';
import { WrapperShape } from '@enums';
import { SCREEN } from '@constants';
import { ActionTypes } from '@types';
import { REDO, SET_AVATAR_OPTION, SET_SIDER_STATUS, UNDO } from './mutation-type';


Expand Down
8 changes: 4 additions & 4 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type NONE } from '@/constants'
import { REDO, SET_AVATAR_OPTION, SET_SIDER_STATUS, UNDO } from '@/store/mutation-type';
import { type NONE } from '@constants';
import { REDO, SET_AVATAR_OPTION, SET_SIDER_STATUS, UNDO } from '@store/mutation-type';
import {
type BeardShape,
type ClothesShape,
Expand All @@ -13,8 +13,8 @@ import {
type MouthShape,
type NoseShape,
type TopsShape,
type WrapperShape,
} from '@/enums'
type WrapperShape
} from '@enums';

export type None = typeof NONE

Expand Down
4 changes: 2 additions & 2 deletions src/utils/dynamic-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
MouthShape,
NoseShape,
TopsShape,
WidgetType,
} from '@/enums'
WidgetType
} from '@enums';

/** @internal */
type Data = Readonly<{
Expand Down
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AvatarOption, None } from '@/types';
import { AVATAR_LAYER, NONE, SETTINGS, SPECIAL_AVATARS } from '@/constants';
import { BeardShape, EarringsShape, Gender, GlassesShape, TopsShape, WidgetType } from '@/enums';
import { AvatarOption, None } from '@types';
import { AVATAR_LAYER, NONE, SETTINGS, SPECIAL_AVATARS } from '@constants';
import { BeardShape, EarringsShape, Gender, GlassesShape, TopsShape, WidgetType } from '@enums';
import { previewData } from './dynamic-data';

function getRandomValue<Item = unknown>(
Expand Down
20 changes: 19 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,25 @@

/* Path */
"paths": {
"@/*": ["./src/*"]
"@": ["./src"],
"@assets/*": ["./src/assets/*"],
"@assets": ["./src/assets"],
"@utils/*": ["./src/utils/*"],
"@utils": ["./src/utils"],
"@hooks/*": ["./src/hooks/*"],
"@hooks": ["./src/hooks"],
"@components/*": ["./src/components/*"],
"@components": ["./src/components"],
"@constants/*": ["./src/constants/*"],
"@constants": ["./src/constants"],
"@types/*": ["./src/types/*"],
"@types": ["./src/types"],
"@layouts/*": ["./src/layouts/*"],
"@layouts": ["./src/layouts"],
"@enums/*": ["./src/enums/*"],
"@enums": ["./src/enums"],
"@store/*": ["./src/store/*"],
"@store": ["./src/store"],
}
},
"include": ["src"],
Expand Down
21 changes: 20 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@ export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': '/src'
'@': '/src',
'@assets': '/src/assets',
'@assets/*': '/src/assets/*',
'assets/*': '/src/assets/*',
'@utils': '/src/utils',
'@utils/*': '/src/utils/*',
'@hooks': '/src/hooks',
'@hooks/*': '/src/hooks/*',
'@components': '/src/components',
'@components/*': '/src/components/*',
'@constants': '/src/constants',
'@constants/*': '/src/constants/*',
'@types': '/src/types',
'@types/*': '/src/types/*',
'@layouts': '/src/layouts',
'@layouts/*': '/src/layouts/*',
'@store': '/src/store',
'@store/*': '/src/store/*',
'@enums': '/src/enums',
'@enums/*': '/src/enums/*',
}
}
})
Loading