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

Skeleton directory 내 typescript 전환 #420

Merged
merged 7 commits into from
Dec 2, 2022
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef } from "react";
import React, { useRef, ReactNode } from "react";
import Modal from "components/common/modal/Modal";
import { useRecoilState } from "recoil";
import alertAtom from "recoil/alert";
Expand All @@ -9,7 +9,7 @@ import DottedLine from "components/common/DottedLine";
import WbIncandescentRoundedIcon from "@material-ui/icons/WbIncandescentRounded";

const AlertProvider = () => {
const messageCache = useRef("");
const messageCache = useRef<ReactNode>("");
const [message, setMessage] = useRecoilState(alertAtom);

const onClickClose = () => setMessage(null);
Expand Down Expand Up @@ -51,7 +51,7 @@ const AlertProvider = () => {
<Button
type="purple_inset"
padding="9px 10px"
radius="8px"
radius={8}
font={theme.font14_bold}
onClick={onClickClose}
>
Expand Down
11 changes: 0 additions & 11 deletions src/components/Skeleton/Footer.jsx

This file was deleted.

7 changes: 7 additions & 0 deletions src/components/Skeleton/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Footer = () => (
<div style={{ height: "calc(88px + env(safe-area-inset-bottom))" }} />
);

export default Footer;
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
import React, { useState, useEffect, useCallback, useRef } from "react";
import React, {
useState,
useEffect,
useCallback,
useRef,
ReactNode,
} from "react";
import { useLocation, Redirect } from "react-router-dom";
// import { useCookies } from "react-cookie";
import reactGA from "react-ga4";
import PropTypes from "prop-types";
import axios from "tools/axios";
import { gaTrackingId, nodeEnv } from "serverconf";

import { useRecoilState, useSetRecoilState } from "recoil";
import taxiLocationAtom from "recoil/taxiLocation";
import loginInfoDetailAtom from "recoil/loginInfoDetail";
import myRoomAtom from "recoil/myRoom";
import alertAtom from "recoil/alert";
// import alertAtom from "recoil/alert";

import HeaderBar from "components/common/HeaderBar";
import Navigation from "components/Skeleton/Navigation";
import Footer from "components/Skeleton/Footer";
import PopupPolicy from "components/Mypage/PopupPolicy";
import useWindowInnerHeight from "hooks/useWindowInnerHeight";
import betaNotice from "static/betaNotice";
// import betaNotice from "static/betaNotice";

const Container = (props) => {
type ContainerProps = {
children: ReactNode;
};

type SkeletonProps = {
children: ReactNode;
};

const Container = (props: ContainerProps) => {
return (
<div
id="skeleton-container" // For useDisableScroll
Expand All @@ -35,18 +48,15 @@ const Container = (props) => {
</div>
);
};
Container.propTypes = {
children: PropTypes.node,
};

const Skeleton = (props) => {
const Skeleton = (props: SkeletonProps) => {
const [userId, setUserId] = useState(undefined);
const [showAgree, setShowAgree] = useState(false);
const [taxiLocation, setTaxiLocation] = useRecoilState(taxiLocationAtom);
const [loginInfoDetail, setLoginInfoDetail] =
useRecoilState(loginInfoDetailAtom);
const setMyRoom = useSetRecoilState(myRoomAtom);
const setAlert = useSetRecoilState(alertAtom);
// const setAlert = useSetRecoilState(alertAtom);
const location = useLocation();
const pathname = location.pathname;
const currentPath = location.pathname + location.search;
Expand Down Expand Up @@ -164,8 +174,4 @@ const Skeleton = (props) => {
);
};

Skeleton.propTypes = {
children: PropTypes.node,
};

export default Skeleton;