removed unused files, unnecessary exports and renamed ownProps (#1225)

* remove unused files and rename ownProps

* restore unused icons
This commit is contained in:
Weiko
2023-08-15 17:02:02 -07:00
committed by GitHub
parent c9549c3833
commit aa1f9bcab3
41 changed files with 117 additions and 543 deletions

View File

@ -5,7 +5,7 @@ import { formatToHumanReadableDate } from '~/utils';
import DatePicker from './DatePicker';
export type StyledCalendarContainerProps = {
type StyledCalendarContainerProps = {
editModeHorizontalAlign?: 'left' | 'right';
};
@ -31,7 +31,7 @@ const StyledCalendarContainer = styled.div<StyledCalendarContainerProps>`
type DivProps = React.HTMLProps<HTMLDivElement>;
export const DateDisplay = forwardRef<HTMLDivElement, DivProps>(
const DateDisplay = forwardRef<HTMLDivElement, DivProps>(
({ value, onClick }, ref) => (
<StyledInputContainer onClick={onClick} ref={ref}>
{value && formatToHumanReadableDate(new Date(value as string))}
@ -43,16 +43,16 @@ type DatePickerContainerProps = {
children: React.ReactNode;
};
export const DatePickerContainer = ({ children }: DatePickerContainerProps) => {
const DatePickerContainer = ({ children }: DatePickerContainerProps) => {
return <StyledCalendarContainer>{children}</StyledCalendarContainer>;
};
type OwnProps = {
export type DateInputEditProps = {
value: Date | null | undefined;
onChange: (newDate: Date) => void;
};
export function DateInputEdit({ onChange, value }: OwnProps) {
export function DateInputEdit({ onChange, value }: DateInputEditProps) {
return (
<DatePicker
date={value ?? new Date()}

View File

@ -3,7 +3,7 @@ import styled from '@emotion/styled';
import { StyledInput } from '@/ui/table/editable-cell/type/components/TextCellEdit';
type OwnProps = {
export type DoubleTextInputEditProps = {
firstValue: string;
secondValue: string;
firstValuePlaceholder: string;
@ -11,7 +11,7 @@ type OwnProps = {
onChange: (firstValue: string, secondValue: string) => void;
};
export const StyledDoubleTextContainer = styled.div`
const StyledDoubleTextContainer = styled.div`
align-items: center;
display: flex;
justify-content: center;
@ -30,7 +30,7 @@ export function DoubleTextInputEdit({
firstValuePlaceholder,
secondValuePlaceholder,
onChange,
}: OwnProps) {
}: DoubleTextInputEditProps) {
return (
<StyledDoubleTextContainer>
<StyledNameInput

View File

@ -13,15 +13,10 @@ import { isDefined } from '~/utils/isDefined';
import { useEntitySelectSearch } from '../hooks/useEntitySelectSearch';
import { EntityForSelect } from '../types/EntityForSelect';
import { SingleEntitySelectBase } from './SingleEntitySelectBase';
export type EntitiesForSingleEntitySelect<
CustomEntityForSelect extends EntityForSelect,
> = {
loading: boolean;
selectedEntity: CustomEntityForSelect;
entitiesToSelect: CustomEntityForSelect[];
};
import {
EntitiesForSingleEntitySelect,
SingleEntitySelectBase,
} from './SingleEntitySelectBase';
export function SingleEntitySelect<
CustomEntityForSelect extends EntityForSelect,

View File

@ -4,13 +4,13 @@ import { textInputStyle } from '@/ui/theme/constants/effects';
import { TextInputContainer } from './TextInputContainer';
export const InplaceInputTextInput = styled.input`
const InplaceInputTextInput = styled.input`
margin: 0;
width: 100%;
${textInputStyle}
`;
type OwnProps = {
export type TextInputEditProps = {
placeholder?: string;
value?: string;
onChange?: (newValue: string) => void;
@ -22,7 +22,7 @@ export function TextInputEdit({
value,
onChange,
autoFocus,
}: OwnProps) {
}: TextInputEditProps) {
return (
<TextInputContainer>
<InplaceInputTextInput