Commit 12c642ee authored by Kim, Chaerin's avatar Kim, Chaerin
Browse files

merge byoungyun

parent 7c53066a
...@@ -23,3 +23,5 @@ yarn-debug.log* ...@@ -23,3 +23,5 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
.env .env
kakao.config.json
\ No newline at end of file
...@@ -6,12 +6,12 @@ import catchErrors from "../context/catchError"; ...@@ -6,12 +6,12 @@ import catchErrors from "../context/catchError";
const INIT_invite = { const INIT_invite = {
id: "", id: "",
name:"", name: "",
} };
const KakaoShareButton = (porps) => { const KakaoShareButton = (porps) => {
const [inviteperson, setProfile] = useState(INIT_invite); const [inviteperson, setProfile] = useState(INIT_invite);
const [error,setError]=useState(""); const [error, setError] = useState("");
const { roomId } = useParams(); const { roomId } = useParams();
const invitepersonId = localStorage.getItem("user"); const invitepersonId = localStorage.getItem("user");
...@@ -33,14 +33,14 @@ const KakaoShareButton = (porps) => { ...@@ -33,14 +33,14 @@ const KakaoShareButton = (porps) => {
}, []); }, []);
useEffect(() => { useEffect(() => {
const script = document.createElement('script') const script = document.createElement("script");
script.src = 'https://developers.kakao.com/sdk/js/kakao.js' script.src = "https://developers.kakao.com/sdk/js/kakao.js";
script.async = true script.async = true;
document.body.appendChild(script) document.body.appendChild(script);
return () => { return () => {
document.body.removeChild(script) document.body.removeChild(script);
} };
}, []) }, []);
const createKakaoButton = () => { const createKakaoButton = () => {
// kakao sdk script이 정상적으로 불러와졌으면 window.Kakao로 접근이 가능합니다 // kakao sdk script이 정상적으로 불러와졌으면 window.Kakao로 접근이 가능합니다
...@@ -52,15 +52,12 @@ const KakaoShareButton = (porps) => { ...@@ -52,15 +52,12 @@ const KakaoShareButton = (porps) => {
kakao.init(kakao_key[0].kakao_key); kakao.init(kakao_key[0].kakao_key);
} }
kakao.Link.createDefaultButton({ kakao.Link.createDefaultButton({
container: '#kakao-link-btn', container: "#kakao-link-btn",
objectType: 'text', objectType: "text",
text: text: `${inviteperson.name}님이 당신을 화상회의에 초대했습니다! 초대된 방 코드:${roomId}`,
`${inviteperson.name}님이 당신을 화상회의에 초대했습니다! 초대된 방 코드:${roomId}`,
link: { link: {
mobileWebUrl: mobileWebUrl: `http://localhost:3000/invite/${roomId}`,
`http://localhost:3000/invite/${roomId}`, webUrl: `http://localhost:3000/invite/${roomId}`,
webUrl:
`http://localhost:3000/invite/${roomId}`,
}, },
}); });
} }
...@@ -75,7 +72,9 @@ const KakaoShareButton = (porps) => { ...@@ -75,7 +72,9 @@ const KakaoShareButton = (porps) => {
className="col-2 p-1 btn btn-primary" className="col-2 p-1 btn btn-primary"
data-bs-dismiss="modal" data-bs-dismiss="modal"
style={{ width: "120px" }} style={{ width: "120px" }}
>카카오로 초대 onClick={() => console.log("안녕")}
>
카카오로 초대
</button> </button>
</div> </div>
); );
......
...@@ -7,8 +7,8 @@ const ChannelSingle = (props) => { ...@@ -7,8 +7,8 @@ const ChannelSingle = (props) => {
return ( return (
<div> <div>
<div className="overflow-auto" style={{ height: '610px' }}> <div className="overflow-auto" style={{ height: '610px' }}>
{props.channel.map((el) => ( {props.channel.map((el,i) => (
<div className="mb-3"> <div className="mb-3" key={`channel${i}`}>
<Link to={`/room/${roomId}/${el.channelName}`}> <Link to={`/room/${roomId}/${el.channelName}`}>
<div <div
className="m-3 p-1 row" className="m-3 p-1 row"
...@@ -36,8 +36,8 @@ const ChannelSingle = (props) => { ...@@ -36,8 +36,8 @@ const ChannelSingle = (props) => {
</Link> </Link>
{el.joinName && {el.joinName &&
el.joinName.map((e) => ( el.joinName.map((e,i) => (
<div> <div key={`member${i}`}>
<ul className="mx-5" style={{ color: '#76D079' }}> <ul className="mx-5" style={{ color: '#76D079' }}>
<li> <li>
<p style={{ color: 'black' }}>{e}</p> <p style={{ color: 'black' }}>{e}</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment