Revert "Refacto/remaining inplace input cells" (#534)
Revert "Refacto/remaining inplace input cells (#531)"
This reverts commit 6446692f25.
This commit is contained in:
@ -3,8 +3,10 @@ import styled from '@emotion/styled';
|
||||
import { IconCurrencyDollar } from '@tabler/icons-react';
|
||||
|
||||
import { RecoilScope } from '@/recoil-scope/components/RecoilScope';
|
||||
import { InplaceDateInput } from '@/ui/components/inplace-input/types/InplaceDateInput';
|
||||
import { EditableDate } from '@/ui/components/editable-cell/types/EditableDate';
|
||||
import { InplaceTextInput } from '@/ui/components/inplace-input/types/InplaceTextInput';
|
||||
import { CellContext } from '@/ui/tables/states/CellContext';
|
||||
import { RowContext } from '@/ui/tables/states/RowContext';
|
||||
|
||||
import { Company, PipelineProgress } from '../../../generated/graphql';
|
||||
import { Checkbox } from '../../ui/components/form/Checkbox';
|
||||
@ -70,6 +72,17 @@ type PipelineProgressProp = Pick<
|
||||
'id' | 'amount' | 'closeDate'
|
||||
>;
|
||||
|
||||
// TODO: Remove when refactoring EditableCell into EditableField
|
||||
function HackScope({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<RecoilScope>
|
||||
<RecoilScope SpecificContext={RowContext}>
|
||||
<RecoilScope SpecificContext={CellContext}>{children}</RecoilScope>
|
||||
</RecoilScope>
|
||||
</RecoilScope>
|
||||
);
|
||||
}
|
||||
|
||||
export function CompanyBoardCard({
|
||||
company,
|
||||
pipelineProgress,
|
||||
@ -99,7 +112,7 @@ export function CompanyBoardCard({
|
||||
<StyledBoardCardBody>
|
||||
<span>
|
||||
<IconCurrencyDollar size={theme.icon.size.md} />
|
||||
<RecoilScope>
|
||||
<HackScope>
|
||||
<InplaceTextInput
|
||||
content={pipelineProgress.amount?.toString() || ''}
|
||||
placeholder="Opportunity amount"
|
||||
@ -110,12 +123,12 @@ export function CompanyBoardCard({
|
||||
})
|
||||
}
|
||||
/>
|
||||
</RecoilScope>
|
||||
</HackScope>
|
||||
</span>
|
||||
<span>
|
||||
<IconCalendarEvent size={theme.icon.size.md} />
|
||||
<RecoilScope>
|
||||
<InplaceDateInput
|
||||
<HackScope>
|
||||
<EditableDate
|
||||
value={new Date(pipelineProgress.closeDate || Date.now())}
|
||||
changeHandler={(value) => {
|
||||
onCardUpdate({
|
||||
@ -124,7 +137,7 @@ export function CompanyBoardCard({
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</RecoilScope>
|
||||
</HackScope>
|
||||
</span>
|
||||
</StyledBoardCardBody>
|
||||
</StyledBoardCard>
|
||||
|
||||
Reference in New Issue
Block a user