mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 18:02:13 +00:00
feat(Settings): add button to copy remote url to clipboard
This commit is contained in:
parent
5df432c220
commit
7ede08f11f
2 changed files with 14 additions and 1 deletions
|
|
@ -121,6 +121,16 @@ const Settings = () => {
|
|||
}
|
||||
});
|
||||
}, []);
|
||||
const onCopyRemoteUrlClick = React.useCallback(() => {
|
||||
if (streamingServer.remoteUrl) {
|
||||
navigator.clipboard.writeText(streamingServer.remoteUrl);
|
||||
toast.show({
|
||||
type: 'success',
|
||||
title: 'Successfully copied remote url to clipboard',
|
||||
timeout: 2500,
|
||||
});
|
||||
}
|
||||
}, [streamingServer.remoteUrl]);
|
||||
const sectionsContainerRef = React.useRef(null);
|
||||
const generalSectionRef = React.useRef(null);
|
||||
const playerSectionRef = React.useRef(null);
|
||||
|
|
@ -552,6 +562,9 @@ const Settings = () => {
|
|||
</div>
|
||||
<div className={classnames(styles['option-input-container'], styles['configure-input-container'])}>
|
||||
<div className={styles['label']} title={streamingServerRemoteUrlInput.value}>{streamingServerRemoteUrlInput.value}</div>
|
||||
<Button className={styles['configure-button-container']} title={'Copy remote url'} onClick={onCopyRemoteUrlClick}>
|
||||
<Icon className={styles['icon']} name={'link'} />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const useStreamingServerSettingsInputs = (streamingServer) => {
|
|||
value: streamingServer.remoteUrl,
|
||||
}), [streamingServer.remoteUrl]);
|
||||
|
||||
const remoteEndpointSelect= React.useMemo(() => {
|
||||
const remoteEndpointSelect = React.useMemo(() => {
|
||||
if (streamingServer.settings?.type !== 'Ready' || streamingServer.networkInfo?.type !== 'Ready') {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue