-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eadfd4c
commit fe910a8
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import { RouterProvider } from 'react-router/dom'; | ||
|
||
import { useLoadingStore } from '@/store'; | ||
|
||
import { Loading } from '@/components'; | ||
|
||
import router from './router'; | ||
|
||
function App() { | ||
return <RouterProvider router={router} />; | ||
const { isLoading } = useLoadingStore(); | ||
return ( | ||
<> | ||
<RouterProvider router={router} /> | ||
{isLoading && <Loading />} | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { default as AutoScrollToTop } from './auto-scroll-to-top'; | ||
export { default as HighLight } from './high-light'; | ||
export { default as NotFount } from './not-fount'; | ||
export { default as Loading } from './loading'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.pub-loading { | ||
position: fixed; | ||
inset: 0; | ||
z-index: 9999999; | ||
display: flex; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba($color: #000, $alpha: 20%); | ||
justify-content: center; | ||
align-items: center; | ||
|
||
svg { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { memo } from 'react'; | ||
|
||
import './index.scss'; | ||
|
||
function Loading() { | ||
return ( | ||
<div className="pub-loading"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"> | ||
<path | ||
fill="none" | ||
stroke="#4579FF" | ||
strokeDasharray="15" | ||
strokeDashoffset="15" | ||
strokeLinecap="round" | ||
strokeWidth="2" | ||
d="M12 3C16.9706 3 21 7.02944 21 12" | ||
> | ||
<animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0" /> | ||
<animateTransform | ||
attributeName="transform" | ||
dur="1.5s" | ||
repeatCount="indefinite" | ||
type="rotate" | ||
values="0 12 12;360 12 12" | ||
/> | ||
</path> | ||
</svg> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(Loading); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters