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

merge byoungyun

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