Skip to content

Commit

Permalink
Merge pull request #93 from SWM-FIRE/FIRE-406-fe-방-입장-버튼-클릭시-api-요청
Browse files Browse the repository at this point in the history
add axios request for room current num
  • Loading branch information
haryung-lee authored Aug 4, 2022
2 parents 5b39a55 + aff87f9 commit 513b19a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/main/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import blockInterface from '../../interface/block.interface';
import MyAvatar from '../../assets/avatar/MyAvatar';
import ThemeImage from '../atoms/ThemeImages';
import { ReactComponent as Bar } from '../../assets/svg/Room/Bar.svg';
import useRoom from '../../hooks/useRoom';

export default function Block({
isMain,
Expand All @@ -20,12 +21,20 @@ export default function Block({
}: blockInterface) {
const navigate = useNavigate();
const { nickname } = UserStore();
const { data } = useRoom(itemId);

const enterRoom = (event: React.MouseEvent<HTMLButtonElement>) => {
event.preventDefault();
if (!nickname) {
alert('로그인이 필요합니다.');
return;
}

if (data.current === data.total) {
alert('방이 이미 초과되었습니다.');
return;
}

navigate(`/ready/${itemId}`);
};
return (
Expand Down

1 comment on commit 513b19a

@vercel
Copy link

@vercel vercel bot commented on 513b19a Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haryung-lee is attempting to deploy a commit to a Personal Account on Vercel that is not owned by them.

In order for the commit to be deployed, @haryung-lee must be granted access to the connected Vercel project.

If you're the owner of the Personal Account, transfer the project to a Vercel Team and start collaborating, or learn more.

Please sign in to comment.