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

@ -8,7 +8,7 @@ import { BoardColumnHotkeyScope } from '../types/BoardColumnHotkeyScope';
import { BoardColumnMenu } from './BoardColumnMenu';
export const StyledColumn = styled.div<{ isFirstColumn: boolean }>`
const StyledColumn = styled.div<{ isFirstColumn: boolean }>`
background-color: ${({ theme }) => theme.background.primary};
border-left: 1px solid
${({ theme, isFirstColumn }) =>
@ -33,27 +33,6 @@ const StyledHeader = styled.div`
width: 100%;
`;
export const StyledColumnTitle = styled.h3<{
colorHexCode?: string;
colorName?: string;
}>`
align-items: center;
border-radius: ${({ theme }) => theme.border.radius.sm};
color: ${({ colorHexCode, colorName, theme }) =>
colorName ? theme.tag.text[colorName] : colorHexCode};
display: flex;
flex-direction: row;
font-size: ${({ theme }) => theme.font.size.md};
font-style: normal;
font-weight: ${({ theme }) => theme.font.weight.medium};
gap: ${({ theme }) => theme.spacing(2)};
margin: 0;
padding-bottom: ${({ theme }) => theme.spacing(1)};
padding-left: ${({ theme }) => theme.spacing(2)};
padding-right: ${({ theme }) => theme.spacing(2)};
padding-top: ${({ theme }) => theme.spacing(1)};
`;
const StyledAmount = styled.div`
color: ${({ theme }) => theme.font.color.tertiary};
margin-left: ${({ theme }) => theme.spacing(2)};
@ -72,7 +51,7 @@ const StyledNumChildren = styled.div`
width: 16px;
`;
type OwnProps = {
export type BoardColumnProps = {
color: string;
title: string;
onTitleEdit: (title: string, color: string) => void;
@ -90,7 +69,7 @@ export function BoardColumn({
children,
isFirstColumn,
numChildren,
}: OwnProps) {
}: BoardColumnProps) {
const [isBoardColumnMenuOpen, setIsBoardColumnMenuOpen] =
React.useState(false);

View File

@ -7,7 +7,7 @@ import { DropdownMenuSeparator } from '@/ui/dropdown/components/DropdownMenuSepa
import { textInputStyle } from '@/ui/theme/constants/effects';
import { debounce } from '~/utils/debounce';
export const StyledEditTitleContainer = styled.div`
const StyledEditTitleContainer = styled.div`
--vertical-padding: ${({ theme }) => theme.spacing(1)};
align-items: center;
@ -28,7 +28,7 @@ const StyledEditModeInput = styled.input`
width: 100%;
`;
type OwnProps = {
export type BoardColumnEditTitleMenuProps = {
onClose: () => void;
title: string;
onTitleEdit: (title: string, color: string) => void;
@ -64,7 +64,7 @@ export function BoardColumnEditTitleMenu({
onTitleEdit,
title,
color,
}: OwnProps) {
}: BoardColumnEditTitleMenuProps) {
const [internalValue, setInternalValue] = useState(title);
const debouncedOnUpdateTitle = debounce(
(newTitle) => onTitleEdit(newTitle, color),

View File

@ -1,17 +0,0 @@
import { createContext } from 'react';
import { FieldDefinition } from '@/ui/editable-field/types/FieldDefinition';
import {
FieldMetadata,
FieldType,
} from '@/ui/editable-field/types/FieldMetadata';
export const FieldDefinitionContext = createContext<
FieldDefinition<FieldMetadata>
>({
id: '',
label: '',
icon: undefined,
type: 'unknown' satisfies FieldType,
metadata: {} as FieldMetadata,
});

View File

@ -1,27 +0,0 @@
import { useRecoilCallback } from 'recoil';
import { boardCardIdsByColumnIdFamilyState } from '../states/boardCardIdsByColumnIdFamilyState';
import { boardColumnsState } from '../states/boardColumnsState';
import { isCardSelectedFamilyState } from '../states/isCardSelectedFamilyState';
export function useResetCardSelection() {
return useRecoilCallback(
({ snapshot, set }) =>
() => {
const boardColumns = snapshot
.getLoadable(boardColumnsState)
.valueOrThrow();
const cardIds = boardColumns.flatMap((boardColumn) =>
snapshot
.getLoadable(boardCardIdsByColumnIdFamilyState(boardColumn.id))
.valueOrThrow(),
);
for (const cardId of cardIds) {
set(isCardSelectedFamilyState(cardId), false);
}
},
[],
);
}