work on team enrollment
This commit is contained in:
@@ -22,10 +22,10 @@ const Page = ({ children, noPadding, fullWidth, ...props }: PageProps) => {
|
||||
{...props}
|
||||
>
|
||||
{header.collapsed && header.withBackButton && (
|
||||
<BackButton offsetY={0} />
|
||||
<BackButton />
|
||||
)}
|
||||
{header.collapsed && header.settingsLink && (
|
||||
<SettingsButton to={header.settingsLink} offsetY={0} />
|
||||
<SettingsButton to={header.settingsLink} />
|
||||
)}
|
||||
{children}
|
||||
</Container>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Text, UnstyledButton, Flex, Stack } from "@mantine/core";
|
||||
import { CaretRightIcon } from "@phosphor-icons/react";
|
||||
import { ComponentType, useContext } from "react";
|
||||
import React, { ComponentType, useContext } from "react";
|
||||
import { SlidePanelContext } from "./slide-panel-context";
|
||||
|
||||
interface SlidePanelFieldProps {
|
||||
@@ -11,7 +11,7 @@ interface SlidePanelFieldProps {
|
||||
title: string;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
formatValue?: (value: any) => string;
|
||||
formatValue?: (value: any) => string | React.ReactNode;
|
||||
componentProps?: Record<string, any>;
|
||||
withAsterisk?: boolean;
|
||||
error?: string;
|
||||
|
||||
@@ -167,14 +167,11 @@ const SlidePanel = ({
|
||||
bg="var(--mantine-color-dimmed)"
|
||||
my="xs"
|
||||
/>
|
||||
|
||||
<Box>
|
||||
<panelConfig.Component
|
||||
value={tempValue}
|
||||
onChange={setTempValue}
|
||||
{...(panelConfig.componentProps || {})}
|
||||
/>
|
||||
</Box>
|
||||
<panelConfig.Component
|
||||
value={tempValue}
|
||||
onChange={setTempValue}
|
||||
{...(panelConfig.componentProps || {})}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -86,7 +86,7 @@ function SwipeableTabs({
|
||||
}
|
||||
}, [search?.tab]);
|
||||
|
||||
useEffect(() => {
|
||||
const updateHeight = useCallback(() => {
|
||||
const activeSlideRef = slideRefs.current[activeTab];
|
||||
if (activeSlideRef) {
|
||||
const height = activeSlideRef.scrollHeight;
|
||||
@@ -94,6 +94,32 @@ function SwipeableTabs({
|
||||
}
|
||||
}, [activeTab]);
|
||||
|
||||
useEffect(() => {
|
||||
updateHeight();
|
||||
}, [activeTab, updateHeight]);
|
||||
|
||||
// Update height when content changes (after render)
|
||||
useEffect(() => {
|
||||
const timeoutId = setTimeout(updateHeight, 0);
|
||||
return () => clearTimeout(timeoutId);
|
||||
});
|
||||
|
||||
// Use ResizeObserver to watch for content size changes
|
||||
useEffect(() => {
|
||||
const activeSlideRef = slideRefs.current[activeTab];
|
||||
if (!activeSlideRef) return;
|
||||
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
updateHeight();
|
||||
});
|
||||
|
||||
resizeObserver.observe(activeSlideRef);
|
||||
|
||||
return () => {
|
||||
resizeObserver.disconnect();
|
||||
};
|
||||
}, [activeTab, updateHeight]);
|
||||
|
||||
const setControlRef = useCallback(
|
||||
(index: number) => (node: HTMLSpanElement | null) => {
|
||||
controlsRefs.current[index] = node;
|
||||
|
||||
Reference in New Issue
Block a user