Remote dom twenty UI POC (#17652)
Create a proof of concept which allows us to use twenty-ui in the remote-dom. For now only the button is allowed. https://github.com/user-attachments/assets/e5441d2c-eb63-4b99-931b-86ee14621393 Known limitation: The icons are not yet available
This commit is contained in:
+7
-7
@@ -1,12 +1,10 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { getMockFrontComponentUrl } from '@/front-components/utils/mockFrontComponent';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useState } from 'react';
|
||||
import { FrontComponentRenderer as SharedFrontComponentRenderer } from 'twenty-sdk/front-component';
|
||||
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
type FrontComponentRendererProps = {
|
||||
frontComponentId: string;
|
||||
};
|
||||
@@ -14,6 +12,7 @@ type FrontComponentRendererProps = {
|
||||
export const FrontComponentRenderer = ({
|
||||
frontComponentId: _frontComponentId,
|
||||
}: FrontComponentRendererProps) => {
|
||||
const theme = useTheme();
|
||||
const [hasError, setHasError] = useState(false);
|
||||
|
||||
const { enqueueErrorSnackBar } = useSnackBar();
|
||||
@@ -35,6 +34,7 @@ export const FrontComponentRenderer = ({
|
||||
|
||||
return (
|
||||
<SharedFrontComponentRenderer
|
||||
theme={theme}
|
||||
componentUrl={getMockFrontComponentUrl()}
|
||||
onError={handleError}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user