banner widget accepts dimensions prop
This commit is contained in:
parent
325e2f56b1
commit
7b1fafe372
@ -2,6 +2,7 @@ export interface BannerWidgetComponentProps {
|
|||||||
quizId: string;
|
quizId: string;
|
||||||
position: "topleft" | "topright" | "bottomleft" | "bottomright";
|
position: "topleft" | "topright" | "bottomleft" | "bottomright";
|
||||||
onWidgetClose?: () => void;
|
onWidgetClose?: () => void;
|
||||||
|
dialogDimensions?: { width: string; height: string; };
|
||||||
appealText?: string;
|
appealText?: string;
|
||||||
quizHeaderText?: string;
|
quizHeaderText?: string;
|
||||||
buttonTextColor?: string;
|
buttonTextColor?: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@frontend/squzanswerer",
|
"name": "@frontend/squzanswerer",
|
||||||
"version": "1.0.42",
|
"version": "1.0.43",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist-package/index.js",
|
"main": "./dist-package/index.js",
|
||||||
"module": "./dist-package/index.js",
|
"module": "./dist-package/index.js",
|
||||||
|
@ -29,6 +29,7 @@ export default function QuizBanner({
|
|||||||
bannerFullWidth = false,
|
bannerFullWidth = false,
|
||||||
pulsation = false,
|
pulsation = false,
|
||||||
autoShowWidgetTime = 0,
|
autoShowWidgetTime = 0,
|
||||||
|
dialogDimensions,
|
||||||
}: BannerWidgetComponentProps) {
|
}: BannerWidgetComponentProps) {
|
||||||
const isMobile = useMediaQuery("(max-width: 600px)");
|
const isMobile = useMediaQuery("(max-width: 600px)");
|
||||||
const [isQuizShown, setIsQuizShown] = useState<boolean>(false);
|
const [isQuizShown, setIsQuizShown] = useState<boolean>(false);
|
||||||
@ -188,6 +189,10 @@ export default function QuizBanner({
|
|||||||
quizId={quizId}
|
quizId={quizId}
|
||||||
onClose={() => setIsQuizShown(false)}
|
onClose={() => setIsQuizShown(false)}
|
||||||
disableScrollLock
|
disableScrollLock
|
||||||
|
paperSx={{
|
||||||
|
width: dialogDimensions?.width,
|
||||||
|
height: dialogDimensions?.height,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</ThemeProvider>,
|
</ThemeProvider>,
|
||||||
document.body
|
document.body
|
||||||
|
@ -7,9 +7,6 @@ import RunningStripe from "../shared/RunningStripe";
|
|||||||
import { useQuizCompletionStatus } from "../shared/useQuizCompletionStatus";
|
import { useQuizCompletionStatus } from "../shared/useQuizCompletionStatus";
|
||||||
|
|
||||||
|
|
||||||
const WIDGET_DEFAULT_WIDTH = "600px";
|
|
||||||
const WIDGET_DEFAULT_HEIGHT = "80%";
|
|
||||||
|
|
||||||
export default function OpenQuizButton({
|
export default function OpenQuizButton({
|
||||||
quizId,
|
quizId,
|
||||||
fixedSide,
|
fixedSide,
|
||||||
@ -110,8 +107,8 @@ export default function OpenQuizButton({
|
|||||||
quizId={quizId}
|
quizId={quizId}
|
||||||
onClose={() => setIsQuizShown(false)}
|
onClose={() => setIsQuizShown(false)}
|
||||||
paperSx={{
|
paperSx={{
|
||||||
width: dialogDimensions?.width ?? WIDGET_DEFAULT_WIDTH,
|
width: dialogDimensions?.width,
|
||||||
height: dialogDimensions?.height ?? WIDGET_DEFAULT_HEIGHT,
|
height: dialogDimensions?.height,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
Loading…
Reference in New Issue
Block a user