removed unused files, unnecessary exports and renamed ownProps (#1225)
* remove unused files and rename ownProps * restore unused icons
This commit is contained in:
@ -1,9 +0,0 @@
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
|
||||
export function CellSkeleton() {
|
||||
return (
|
||||
<div style={{ width: '100%', alignItems: 'center' }}>
|
||||
<Skeleton />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -22,7 +22,7 @@ const StyledEditButtonContainer = styled(motion.div)`
|
||||
right: 5px;
|
||||
`;
|
||||
|
||||
export const CellBaseContainer = styled.div`
|
||||
const StyledCellBaseContainer = styled.div`
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
@ -33,7 +33,7 @@ export const CellBaseContainer = styled.div`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
type OwnProps = {
|
||||
export type EditableCellProps = {
|
||||
editModeContent: ReactElement;
|
||||
nonEditModeContent: ReactElement;
|
||||
editModeHorizontalAlign?: 'left' | 'right';
|
||||
@ -59,7 +59,7 @@ export function EditableCell({
|
||||
transparent = false,
|
||||
maxContentWidth,
|
||||
useEditButton,
|
||||
}: OwnProps) {
|
||||
}: EditableCellProps) {
|
||||
const { isCurrentCellInEditMode } = useCurrentCellEditMode();
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
|
||||
@ -88,7 +88,7 @@ export function EditableCell({
|
||||
<CellHotkeyScopeContext.Provider
|
||||
value={editHotkeyScope ?? DEFAULT_CELL_SCOPE}
|
||||
>
|
||||
<CellBaseContainer
|
||||
<StyledCellBaseContainer
|
||||
onMouseEnter={handleContainerMouseEnter}
|
||||
onMouseLeave={handleContainerMouseLeave}
|
||||
>
|
||||
@ -128,7 +128,7 @@ export function EditableCell({
|
||||
</EditableCellDisplayMode>
|
||||
</>
|
||||
)}
|
||||
</CellBaseContainer>
|
||||
</StyledCellBaseContainer>
|
||||
</CellHotkeyScopeContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { Ref } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type Props = {
|
||||
export type EditableCellDisplayContainerProps = {
|
||||
softFocus?: boolean;
|
||||
onClick?: () => void;
|
||||
scrollRef?: Ref<HTMLDivElement>;
|
||||
};
|
||||
|
||||
export const EditableCellDisplayModeOuterContainer = styled.div<
|
||||
Pick<Props, 'softFocus'>
|
||||
const StyledEditableCellDisplayModeOuterContainer = styled.div<
|
||||
Pick<EditableCellDisplayContainerProps, 'softFocus'>
|
||||
>`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
@ -22,12 +22,12 @@ export const EditableCellDisplayModeOuterContainer = styled.div<
|
||||
${(props) =>
|
||||
props.softFocus
|
||||
? `background: ${props.theme.background.transparent.secondary};
|
||||
border-radius: ${props.theme.border.radius.sm};
|
||||
box-shadow: inset 0 0 0 1px ${props.theme.font.color.extraLight};`
|
||||
border-radius: ${props.theme.border.radius.sm};
|
||||
box-shadow: inset 0 0 0 1px ${props.theme.font.color.extraLight};`
|
||||
: ''}
|
||||
`;
|
||||
|
||||
export const EditableCellDisplayModeInnerContainer = styled.div`
|
||||
const EditableCellDisplayModeInnerContainer = styled.div`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
@ -40,9 +40,9 @@ export function EditableCellDisplayContainer({
|
||||
softFocus,
|
||||
onClick,
|
||||
scrollRef,
|
||||
}: React.PropsWithChildren<Props>) {
|
||||
}: React.PropsWithChildren<EditableCellDisplayContainerProps>) {
|
||||
return (
|
||||
<EditableCellDisplayModeOuterContainer
|
||||
<StyledEditableCellDisplayModeOuterContainer
|
||||
data-testid={
|
||||
softFocus
|
||||
? 'editable-cell-soft-focus-mode'
|
||||
@ -55,6 +55,6 @@ export function EditableCellDisplayContainer({
|
||||
<EditableCellDisplayModeInnerContainer>
|
||||
{children}
|
||||
</EditableCellDisplayModeInnerContainer>
|
||||
</EditableCellDisplayModeOuterContainer>
|
||||
</StyledEditableCellDisplayModeOuterContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { overlayBackground } from '@/ui/theme/constants/effects';
|
||||
|
||||
export const EditableCellEditModeContainer = styled.div<OwnProps>`
|
||||
const StyledEditableCellEditModeContainer = styled.div<EditableCellEditModeProps>`
|
||||
align-items: center;
|
||||
border: ${({ transparent, theme }) =>
|
||||
transparent ? 'none' : `1px solid ${theme.border.color.light}`};
|
||||
@ -28,7 +28,7 @@ export const EditableCellEditModeContainer = styled.div<OwnProps>`
|
||||
z-index: 1;
|
||||
`;
|
||||
|
||||
type OwnProps = {
|
||||
export type EditableCellEditModeProps = {
|
||||
children: ReactElement;
|
||||
transparent?: boolean;
|
||||
maxContentWidth?: number;
|
||||
@ -43,9 +43,9 @@ export function EditableCellEditMode({
|
||||
children,
|
||||
transparent = false,
|
||||
maxContentWidth,
|
||||
}: OwnProps) {
|
||||
}: EditableCellEditModeProps) {
|
||||
return (
|
||||
<EditableCellEditModeContainer
|
||||
<StyledEditableCellEditModeContainer
|
||||
maxContentWidth={maxContentWidth}
|
||||
transparent={transparent}
|
||||
data-testid="editable-cell-edit-mode-container"
|
||||
@ -53,6 +53,6 @@ export function EditableCellEditMode({
|
||||
editModeVerticalPosition={editModeVerticalPosition}
|
||||
>
|
||||
{children}
|
||||
</EditableCellEditModeContainer>
|
||||
</StyledEditableCellEditModeContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user