убран плюс при открытии логики ветвления добавлена быстрая ссылка на опрос в карточках квизов
This commit is contained in:
parent
737cc61cf7
commit
c73027e2d3
@ -43,12 +43,13 @@ import VidjetInstall from "./VidjetInstall";
|
||||
import InstallQzCode from "./InstallQzCode";
|
||||
import { incrementCurrentStep, updateQuiz } from "@root/quizes/actions";
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||
import { useDomainDefine } from "@utils/hooks/useDomainDefine";
|
||||
|
||||
type BackgroundType = "text" | "video";
|
||||
|
||||
export default function InstallQuiz() {
|
||||
const quiz = useCurrentQuiz();
|
||||
|
||||
const { isTestServer } = useDomainDefine();
|
||||
const [display, setDisplay] = React.useState("1");
|
||||
const handleChange = (event: SelectChangeEvent) => {
|
||||
setDisplay(event.target.value);
|
||||
@ -194,8 +195,9 @@ export default function InstallQuiz() {
|
||||
<TextField
|
||||
disabled
|
||||
id={"inputLinkone"}
|
||||
value="https://s.hbpn.link/"
|
||||
// value="https://pena.com/"
|
||||
value={
|
||||
isTestServer ? "https://s.hbpn.link/" : "https://hbpn.link/"
|
||||
}
|
||||
sx={{
|
||||
"& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {
|
||||
border: "none",
|
||||
|
@ -98,19 +98,20 @@ export default function QuestionsPage({
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
createUntypedQuestion(quiz.backendId);
|
||||
}}
|
||||
sx={{
|
||||
position: "fixed",
|
||||
bottom: "103px",
|
||||
}}
|
||||
data-cy="create-question"
|
||||
>
|
||||
<AddPlus />
|
||||
</IconButton>
|
||||
|
||||
{!openBranchingPage && (
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
createUntypedQuestion(quiz.backendId);
|
||||
}}
|
||||
sx={{
|
||||
position: "fixed",
|
||||
bottom: "103px",
|
||||
}}
|
||||
data-cy="create-question"
|
||||
>
|
||||
<AddPlus />
|
||||
</IconButton>
|
||||
)}
|
||||
<Box sx={{ display: "flex", gap: "8px", marginLeft: "auto" }}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
|
@ -14,10 +14,11 @@ import {
|
||||
Popover,
|
||||
} from "@mui/material";
|
||||
import { deleteQuiz, setEditQuizId } from "@root/quizes/actions";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { inCart } from "../../pages/Tariffs/Tariffs";
|
||||
import { makeRequest } from "@frontend/kitui";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { useDomainDefine } from "@utils/hooks/useDomainDefine";
|
||||
|
||||
interface Props {
|
||||
quiz: Quiz;
|
||||
@ -37,7 +38,7 @@ export default function QuizCard({
|
||||
const navigate = useNavigate();
|
||||
const [subMenuOpen, setSubMenuOpen] = useState<boolean>(false);
|
||||
const subMenuRef = useRef<HTMLButtonElement | null>(null);
|
||||
|
||||
const { isTestServer } = useDomainDefine();
|
||||
function handleEditClick() {
|
||||
setEditQuizId(quiz.backendId);
|
||||
navigate("/edit");
|
||||
@ -108,8 +109,25 @@ export default function QuizCard({
|
||||
}}
|
||||
>
|
||||
<LinkIcon bgcolor="#EEE4FC" color={theme.palette.brightPurple.main} />
|
||||
<Typography color={theme.palette.grey3.main}>
|
||||
быстрая ссылка ...
|
||||
<Typography
|
||||
color={theme.palette.grey3.main}
|
||||
sx={{
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
maxWidth: "300px",
|
||||
}}
|
||||
component={Link}
|
||||
target="_blank"
|
||||
to={
|
||||
isTestServer
|
||||
? "https://s.hbpn.link/" + quiz.qid
|
||||
: "https://hbpn.link/" + quiz.qid
|
||||
}
|
||||
>
|
||||
{isTestServer
|
||||
? `https://s.hbpn.link/${quiz.qid}`
|
||||
: `https://hbpn.link/${quiz.qid}`}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
|
@ -6,7 +6,6 @@ export function useDomainDefine(): { isTestServer: boolean } {
|
||||
useEffect(() => {
|
||||
const host = window.location.hostname;
|
||||
let isTest = host.includes("s");
|
||||
console.log("эта консольложь в хуке", isTest);
|
||||
setIsTestServer(isTest);
|
||||
}, []);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user