Skip to content

Commit

Permalink
Update settings back button redirect link (calcom#7403)
Browse files Browse the repository at this point in the history
* fix(schedule): close on click calcom#7143

* fix(EventSetupTab): validLocations length will always match validLocations length calcom#7138

* fix(SettingsLayout): go back to right route calcom#7379
  • Loading branch information
esau-morais authored and dmkav committed Mar 6, 2023
1 parent 8abb147 commit 57333fc
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/features/settings/layouts/SettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,18 @@ const useTabs = () => {
};

const BackButtonInSidebar = ({ name }: { name: string }) => {
const router = useRouter();

return (
<Link
href="/event-types"
<button
className="group my-6 flex h-6 max-h-6 w-64 flex-row items-center rounded-md py-2 px-3 text-sm font-medium leading-4 text-black hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900"
data-testid={`vertical-tab-${name}`}>
data-testid={`vertical-tab-${name}`}
onClick={() => router.back()}>
<FiArrowLeft className="h-4 w-4 stroke-[2px] ltr:mr-[10px] rtl:ml-[10px] md:mt-0" />
<Skeleton title={name} as="p" className="max-w-36 min-h-4 truncate">
{name}
</Skeleton>
</Link>
</button>
);
};

Expand Down Expand Up @@ -243,7 +245,7 @@ const SettingsSidebarContainer = ({
}>
<CollapsibleTrigger>
<div
className="flex h-9 w-64 flex-row items-center rounded-md px-3 py-[10px] text-sm font-medium leading-none hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900 text-left"
className="flex h-9 w-64 flex-row items-center rounded-md px-3 py-[10px] text-left text-sm font-medium leading-none hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900"
onClick={() =>
setTeamMenuState([
...teamMenuState,
Expand Down Expand Up @@ -337,6 +339,7 @@ const SettingsSidebarContainer = ({

const MobileSettingsContainer = (props: { onSideContainerOpen?: () => void }) => {
const { t } = useLocale();
const router = useRouter();

return (
<>
Expand All @@ -346,12 +349,12 @@ const MobileSettingsContainer = (props: { onSideContainerOpen?: () => void }) =>
<span className="sr-only">{t("show_navigation")}</span>
</Button>

<a
href="/"
className="flex items-center space-x-2 rounded-md px-3 py-1 hover:bg-gray-200 rtl:space-x-reverse">
<button
className="flex items-center space-x-2 rounded-md px-3 py-1 hover:bg-gray-200 rtl:space-x-reverse"
onClick={() => router.back()}>
<FiArrowLeft className="text-gray-700" />
<p className="font-semibold text-black">{t("settings")}</p>
</a>
</button>
</div>
</nav>
</>
Expand Down

0 comments on commit 57333fc

Please sign in to comment.