@ -1,5 +1,7 @@
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import React from 'react';
|
||||
import { getImageAbsoluteURI } from 'twenty-shared';
|
||||
@ -105,6 +107,7 @@ export const ImageInput = ({
|
||||
disabled = false,
|
||||
className,
|
||||
}: ImageInputProps) => {
|
||||
const { t } = useLingui();
|
||||
const theme = useTheme();
|
||||
const hiddenFileInput = React.useRef<HTMLInputElement>(null);
|
||||
const onUploadButtonClick = () => {
|
||||
@ -151,7 +154,7 @@ export const ImageInput = ({
|
||||
Icon={IconX}
|
||||
onClick={onAbort}
|
||||
variant="secondary"
|
||||
title="Abort"
|
||||
title={t`Abort`}
|
||||
disabled={!pictureURI || disabled}
|
||||
/>
|
||||
) : (
|
||||
@ -159,7 +162,7 @@ export const ImageInput = ({
|
||||
Icon={IconUpload}
|
||||
onClick={onUploadButtonClick}
|
||||
variant="secondary"
|
||||
title="Upload"
|
||||
title={t`Upload`}
|
||||
disabled={disabled}
|
||||
/>
|
||||
)}
|
||||
@ -167,7 +170,7 @@ export const ImageInput = ({
|
||||
Icon={IconTrash}
|
||||
onClick={onRemove}
|
||||
variant="secondary"
|
||||
title="Remove"
|
||||
title={t`Remove`}
|
||||
disabled={!pictureURI || disabled}
|
||||
/>
|
||||
</StyledButtonContainer>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
import { i18nDecoratorFront } from '~/testing/decorators/i18nDecoratorFront';
|
||||
import { workspaceLogoUrl } from '~/testing/mock-data/users';
|
||||
|
||||
import { ImageInput } from '../ImageInput';
|
||||
@ -8,7 +9,7 @@ import { ImageInput } from '../ImageInput';
|
||||
const meta: Meta<typeof ImageInput> = {
|
||||
title: 'UI/Input/ImageInput/ImageInput',
|
||||
component: ImageInput,
|
||||
decorators: [ComponentDecorator],
|
||||
decorators: [ComponentDecorator, i18nDecoratorFront],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
Reference in New Issue
Block a user