Files
twenty/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsx
Gabriel Utzig c73feb513a fix: Center Functions Empty state (#7378)
## Description
- This PR fix #7012
- It changes the logic behind the rendering of `SettingsPageContainer`
component. Now, the component is only rendered when the page content is
not blank.
## Changes
| Before | After |
|--------|--------|
|
![image](https://github.com/user-attachments/assets/98b64370-f145-41a2-a829-f86ae9687f73)
|
![image](https://github.com/user-attachments/assets/4cb0cc32-a669-4151-9444-4bc734bd2909)
|

<details><summary>Details</summary>
<p>
This change aligns the behavior of the settings page with the existing
logic found on the `/rockets` page
<img
src="https://github.com/user-attachments/assets/d2b80fbc-83e4-4823-a708-6775e19a153a"/>
</p>
</details>

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-05 01:23:02 +02:00

43 lines
1.3 KiB
TypeScript

import { SettingsServerlessFunctionsTable } from '@/settings/serverless-functions/components/SettingsServerlessFunctionsTable';
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath';
import { SettingsPath } from '@/types/SettingsPath';
import { Button } from '@/ui/input/button/components/Button';
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
import { Section } from '@/ui/layout/section/components/Section';
import { UndecoratedLink } from '@/ui/navigation/link/components/UndecoratedLink';
import { IconFunction, IconPlus } from 'twenty-ui';
export const SettingsServerlessFunctions = () => {
return (
<SubMenuTopBarContainer
Icon={IconFunction}
title="Functions"
actionButton={
<UndecoratedLink
to={getSettingsPagePath(SettingsPath.NewServerlessFunction)}
>
<Button
Icon={IconPlus}
title="New Function"
accent="blue"
size="small"
/>
</UndecoratedLink>
}
links={[
{
children: 'Workspace',
href: getSettingsPagePath(SettingsPath.Workspace),
},
{
children: 'Functions',
},
]}
>
<Section>
<SettingsServerlessFunctionsTable />
</Section>
</SubMenuTopBarContainer>
);
};