Skip to content

Commit

Permalink
feat: ✨ add ant redux
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Nov 27, 2022
1 parent f487d99 commit af754fb
Show file tree
Hide file tree
Showing 21 changed files with 789 additions and 118 deletions.
42 changes: 24 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = {
root: true,
settings: {
react: {
version: 'detect',
},
},

extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
Expand All @@ -15,24 +21,24 @@ module.exports = {
},
],
'react/display-name': 0,
'react/jsx-props-no-spreading': 0,
'react/state-in-constructor': 0,
'react/static-property-placement': 0,
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': 'off',
'react/no-array-index-key': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/require-default-props': 0,
'react/jsx-fragments': 0,
'react/jsx-wrap-multilines': 0,
'react/prop-types': 0,
'react/forbid-prop-types': 0,
'react/sort-comp': 0,
// 'react/jsx-props-no-spreading': 0,
// 'react/state-in-constructor': 0,
// 'react/static-property-placement': 0,
// // Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
// 'react/destructuring-assignment': 'off',
// 'react/jsx-filename-extension': 'off',
// 'react/no-array-index-key': 'warn',
// 'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
// 'react/require-default-props': 0,
// 'react/jsx-fragments': 0,
// 'react/jsx-wrap-multilines': 0,
// 'react/prop-types': 0,
// 'react/forbid-prop-types': 0,
// 'react/sort-comp': 0,
'react/react-in-jsx-scope': 0,
'react/jsx-one-expression-per-line': 0,
'react/self-closing-comp': 1,
'react/jsx-key': 1,
// 'react/jsx-one-expression-per-line': 0,
// 'react/self-closing-comp': 1,
// 'react/jsx-key': 1,
},
};
148 changes: 147 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,153 @@
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<div id="root">
<style>
* {
margin: 0;
padding: 0;
}

html,
body {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.loading {
display: block;
font-size: 0;
color: #409eff;
width: 82px;
height: 72px;
}

.loading,
.loading > div {
position: relative;
box-sizing: border-box;
}

.loading.la-dark {
color: #333;
}

.loading > div {
display: inline-block;
float: none;
background-color: currentcolor;
border: 0 solid currentcolor;
}

.loading > div:nth-child(1) {
position: absolute;
bottom: 32%;
left: 18%;
width: 24px;
height: 24px;
border-radius: 100%;
transform-origin: center bottom;
animation: ball-climbing-dot-jump 0.6s ease-in-out infinite;
}

.loading > div:not(:nth-child(1)) {
position: absolute;
top: 0;
right: 0;
width: 24px;
height: 2px;
border-radius: 0;
transform: translate(60%, 0);
animation: ball-climbing-dot-steps 1.8s linear infinite;
}

.loading > div:not(:nth-child(1)):nth-child(2) {
animation-delay: 0ms;
}

.loading > div:not(:nth-child(1)):nth-child(3) {
animation-delay: -600ms;
}

.loading > div:not(:nth-child(1)):nth-child(4) {
animation-delay: -1200ms;
}

@keyframes ball-climbing-dot-jump {
0% {
transform: scale(1, 0.7);
}

20% {
transform: scale(0.7, 1.2);
}

40% {
transform: scale(1, 1);
}

50% {
bottom: 125%;
}

46% {
transform: scale(1, 1);
}

80% {
transform: scale(0.7, 1.2);
}

90% {
transform: scale(0.7, 1.2);
}

100% {
transform: scale(1, 0.7);
}
}

@keyframes ball-climbing-dot-steps {
0% {
top: 0;
right: 0;
opacity: 0;
}

50% {
opacity: 1;
}

100% {
top: 100%;
right: 100%;
opacity: 0;
}
}
@media (prefers-color-scheme: dark) {
html,
body {
background-color: #000;
}
}

@media (prefers-color-scheme: light) {
html,
body {
background-color: #fff;
}
}
</style>
<div id="html_loding" class="loading">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-xs-admin",
"private": true,
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand All @@ -16,11 +16,13 @@
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"antd": "^5.0.0",
"@reduxjs/toolkit": "^1.9.0",
"antd": "^5.0.1",
"localforage": "^1.10.0",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.4.3",
"sort-by": "^1.2.0"
},
Expand Down
Loading

0 comments on commit af754fb

Please sign in to comment.