* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
38 lines
995 B
TypeScript
38 lines
995 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
const StyledEditableFieldEditModeContainer = styled.div<OwnProps>`
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
height: 24px;
|
|
|
|
margin-left: -${({ theme }) => theme.spacing(1)};
|
|
position: relative;
|
|
z-index: 10;
|
|
`;
|
|
|
|
const StyledEditableFieldInput = styled.div`
|
|
align-items: center;
|
|
background: ${({ theme }) => theme.background.transparent.secondary};
|
|
border: 1px solid ${({ theme }) => theme.border.color.medium};
|
|
border-radius: ${({ theme }) => theme.border.radius.sm};
|
|
box-shadow: ${({ theme }) => theme.boxShadow.strong};
|
|
display: flex;
|
|
|
|
margin-left: -1px;
|
|
min-height: 32px;
|
|
width: inherit;
|
|
|
|
z-index: 10;
|
|
`;
|
|
|
|
type OwnProps = {
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
export const EditableFieldEditMode = ({ children }: OwnProps) => (
|
|
<StyledEditableFieldEditModeContainer data-testid="editable-field-edit-mode-container">
|
|
<StyledEditableFieldInput>{children}</StyledEditableFieldInput>
|
|
</StyledEditableFieldEditModeContainer>
|
|
);
|