Skip to content

Commit

Permalink
feat: app loading spinner error fixed - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
devwoodie committed Jul 28, 2023
1 parent e360011 commit 4043654
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/pages/main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import {useNavigate} from "react-router-dom";
import Spinner from "../../components/common/Spinner";

const Main = () => {
let key = RootStore.userStore.getJwtKey;
// let key = RootStore.userStore.getJwtKey;
let navigate = useNavigate();

const [key, setKey] = useState<string>();
// 리스트 비었을 때 분기처리
const [isEmptyList, setIsEmptyList] = useState<boolean>(true);
const [registerBtn, setRegisterBtn] = useState<boolean>(false);
Expand All @@ -26,11 +27,13 @@ const Main = () => {
const [isLoading, setIsLoading] = useState<boolean>(false);

useEffect(() => {
setKey(RootStore.userStore.getJwtKey);

const isFirstVisit = sessionStorage.getItem('isFirstVisit');
if (isFirstVisit !== null) {
setIsLoading(false);
}else{
setIsLoading(true)
setIsLoading(true);
sessionStorage.setItem('isFirstVisit', 'true');
}
setTimeout(() => {
Expand Down Expand Up @@ -92,8 +95,7 @@ const Main = () => {

return (
<>
{isLoading ?
<Spinner /> :
{isLoading ? <Spinner /> :
<div className="Main inner">
<div className="main-header">
<span className="setting-btn" onClick={() => navigate(`/page/setting?nick=${RootStore.userStore.getUserName}`)}><img src={IcSettingBtn} alt="setting-btn" /></span>
Expand Down
4 changes: 3 additions & 1 deletion src/styles/abstracts/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@
}

.spinner-wrap{
position: relative;
position: fixed;
left: 0; top: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
z-index: 999;
.spinner-bg{
width: 100%;
filter: blur(3px);
Expand Down

0 comments on commit 4043654

Please sign in to comment.