55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import "../../styles/styles.css";
|
|
import "./popupConnect.css";
|
|
import { useHistory } from "react-router-dom";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
export const PopupConnectEx: React.FC<any> = ({
|
|
setVisible,
|
|
logo,
|
|
setValue,
|
|
value,
|
|
}) => {
|
|
const history = useHistory();
|
|
const { t } = useTranslation();
|
|
|
|
const handleConnect = () => {
|
|
history.push(`/stream/${value}`);
|
|
};
|
|
|
|
return (
|
|
<div className="popup__container">
|
|
<div className="popup__content">
|
|
<img alt="logoRC" className="logo__popup_ex" src={logo}></img>
|
|
<p className="popup__title">{t("popup-connect-title")}</p>
|
|
<input
|
|
value={value}
|
|
onChange={(e) => setValue(e.target.value)}
|
|
className="popup__input"
|
|
></input>
|
|
<button
|
|
onClick={handleConnect}
|
|
disabled={!!!value}
|
|
type="submit"
|
|
className={
|
|
!!value ? "button" : "button button__disabled"
|
|
}
|
|
>
|
|
{t("popup-connect-btn-continue")}
|
|
</button>
|
|
<span className="line"></span>
|
|
<button
|
|
onClick={() =>
|
|
setVisible({
|
|
popup1: true,
|
|
popup2: false,
|
|
})
|
|
}
|
|
className="popup__caption"
|
|
>
|
|
{t("popup-connect-btn-mode")}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|