[CAL-462] Team settings dropdown menu should be open when you navigate from Teams (#5868)

Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: niteshsingh1357 <[email protected]>
Co-authored-by: Rafael Toledo <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Rafael <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Matheus Benini Ferreira <[email protected]>
Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com>
Co-authored-by: gitstart_bot <[email protected]>
Co-authored-by: Thiago Nascimbeni <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>

Co-authored-by: gitstart <[email protected]>
Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: niteshsingh1357 <[email protected]>
Co-authored-by: Rafael Toledo <[email protected]>
Co-authored-by: Rafael <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Matheus Benini Ferreira <[email protected]>
Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com>
Co-authored-by: gitstart_bot <[email protected]>
Co-authored-by: Thiago Nascimbeni <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
This commit is contained in:
1 file changed
+12 -2
+12 -2
View File
@@ -102,6 +102,7 @@ const useTabs = () => {
const SettingsSidebarContainer = ({ className = "" }) => {
const { t } = useLocale();
const router = useRouter();
const tabsWithPermissions = useTabs();
const [teamMenuState, setTeamMenuState] =
useState<{ teamId: number | undefined; teamMenuOpen: boolean }[]>();
@@ -110,10 +111,19 @@ const SettingsSidebarContainer = ({ className = "" }) => {
useEffect(() => {
if (teams) {
const teamStates = teams?.map((team) => ({ teamId: team.id, teamMenuOpen: false }));
const teamStates = teams?.map((team) => ({
teamId: team.id,
teamMenuOpen: String(team.id) === router.query.id,
}));
setTeamMenuState(teamStates);
setTimeout(() => {
const tabMembers = Array.from(document.getElementsByTagName("a")).filter(
(bottom) => bottom.dataset.testid === "vertical-tab-Members"
)[1];
tabMembers?.scrollIntoView({ behavior: "smooth" });
}, 100);
}
}, [teams]);
}, [router.query.id, teams]);
return (
<nav