mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
fix sync
This commit is contained in:
parent
8f9eeadb74
commit
b08267a08c
10 changed files with 318 additions and 304 deletions
|
|
@ -1,26 +1,29 @@
|
|||
export interface AnalyseMenuProps {
|
||||
sessionName: string;
|
||||
onShare: Function;
|
||||
canShare: boolean;
|
||||
isShared: boolean;
|
||||
sessionName: string;
|
||||
onShare: Function;
|
||||
canShare: boolean;
|
||||
isShared: boolean;
|
||||
}
|
||||
|
||||
export function AnalyseMenu({sessionName, onShare, canShare, isShared}:AnalyseMenuProps) {
|
||||
export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||
const loc = () => window.location.toString().replace(/\#.*/, '') + '#' + props.sessionName;
|
||||
const shareText = () => (props.isShared) ?
|
||||
<input class="share-text" value={loc()} readOnly={true}
|
||||
title="Use this link to join the current session"
|
||||
style={{width: `${(loc().length * 8)}px`}}
|
||||
onFocus={(event) => {
|
||||
(event.target as HTMLInputElement).select()
|
||||
}}/> : '';
|
||||
|
||||
const loc = window.location.toString().replace(/\#.+/, '') + '#' + sessionName;
|
||||
const shareText = (isShared) ?
|
||||
<input class="share-text" value={loc} readOnly={true}
|
||||
title="Use this link to join the current session"
|
||||
style={{width: `${(loc.length*8)}px`}}
|
||||
onFocus={(event)=>{(event.target as HTMLInputElement).select()}}/> : '';
|
||||
const shareButton = () => (props.canShare) ? <div class="analyse-menu">
|
||||
<button class="share-session" title="Start a shared session"
|
||||
onClick={() => {
|
||||
props.onShare()
|
||||
}}/>
|
||||
{shareText}
|
||||
</div> : '';
|
||||
|
||||
const shareButton = (canShare) ? <div class="analyse-menu">
|
||||
<button class="share-session" title="Start a shared session"
|
||||
onClick={()=>{onShare()}}/>
|
||||
{shareText}
|
||||
</div>: '';
|
||||
|
||||
return (<div>
|
||||
{shareButton}
|
||||
</div>)
|
||||
return (<div>
|
||||
{shareButton}
|
||||
</div>)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue