-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from moonstream-to/invites
Invite codes
- Loading branch information
Showing
12 changed files
with
172 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import styles from "./Roster.module.css"; | ||
import { useEffect, useRef } from "react"; | ||
|
||
const StartAtBatDialog = ({ | ||
onClick, | ||
onClose, | ||
}: { | ||
onClick: (requireSignature: boolean) => void; | ||
onClose: () => void; | ||
}) => { | ||
const dialogRef = useRef<HTMLDivElement>(null); | ||
const handleClickOutside = (event: MouseEvent) => { | ||
if (dialogRef.current && !dialogRef.current.contains(event.target as Node)) { | ||
onClose(); | ||
event.stopPropagation(); | ||
} | ||
}; | ||
useEffect(() => { | ||
document.addEventListener("click", handleClickOutside, true); | ||
return () => document.removeEventListener("click", handleClickOutside, true); | ||
}, []); | ||
|
||
return ( | ||
<div className={styles.dialog} ref={dialogRef}> | ||
<button type={"button"} className={styles.button} onClick={() => onClick(false)}> | ||
OPEN CHALLENGE | ||
</button> | ||
<button type={"button"} className={styles.button} onClick={() => onClick(true)}> | ||
BY INVITE LINK ONLY | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StartAtBatDialog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters