Improve design of fields menu (#5729)

Improve design of field options menu and redirect to the right object
edit page



<img width="215" alt="Screenshot 2024-06-04 at 12 15 43"
src="https://github.com/twentyhq/twenty/assets/6399865/a8da18a1-49d4-40e3-b2cd-3a1a384366b2">
This commit is contained in:
Félix Malfait
2024-06-04 12:16:47 +02:00
committed by GitHub
parent d964f656f9
commit 719cce1ea2
2 changed files with 42 additions and 15 deletions

View File

@ -1,4 +1,19 @@
import { SettingsPath } from '@/types/SettingsPath';
import { isDefined } from '~/utils/isDefined';
export const getSettingsPagePath = <Path extends SettingsPath>(path: Path) =>
`/settings/${path}` as const;
type PathParams = {
objectSlug?: string;
};
export const getSettingsPagePath = <Path extends SettingsPath>(
path: Path,
params?: PathParams,
) => {
let resultPath = `/settings/${path}`;
if (isDefined(params?.objectSlug)) {
resultPath = resultPath.replace(':objectSlug', params.objectSlug);
}
return resultPath;
};