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:
@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user