Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed May 7, 2024
1 parent e5d71d8 commit a1a28b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
49 changes: 27 additions & 22 deletions fronts-client/src/components/feed/RecipeFeedItem.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
import {Recipe} from "../../types/Recipe";
import {FeedItem} from "./FeedItem";
import React from "react";
import {State} from "../../types/State";
import {dragOffsetX, dragOffsetY} from "../FrontsEdit/CollectionComponents/ArticleDrag";
import noop from "lodash/noop";
import {selectFeatureValue} from "../../selectors/featureSwitchesSelectors";
import {connect} from "react-redux";
import { Recipe } from '../../types/Recipe';
import { FeedItem } from './FeedItem';
import React from 'react';
import { State } from '../../types/State';
import {
dragOffsetX,
dragOffsetY,
} from '../FrontsEdit/CollectionComponents/ArticleDrag';
import noop from 'lodash/noop';
import { selectFeatureValue } from '../../selectors/featureSwitchesSelectors';
import { connect } from 'react-redux';

interface ComponentProps {
recipe: Recipe,
shouldObscureFeed: boolean
recipe: Recipe;
shouldObscureFeed: boolean;
}

export const RecipeFeedItemComponent = ({ recipe, shouldObscureFeed }: ComponentProps) => {
const handleDragStart = (event: React.DragEvent<HTMLDivElement>, dragNode: HTMLDivElement) => {
export const RecipeFeedItemComponent = ({
recipe,
shouldObscureFeed,
}: ComponentProps) => {
const handleDragStart = (
event: React.DragEvent<HTMLDivElement>,
dragNode: HTMLDivElement
) => {
event.dataTransfer.setData('recipe', JSON.stringify(recipe));
if (dragNode) {
event.dataTransfer.setDragImage(
dragNode,
dragOffsetX,
dragOffsetY
);
event.dataTransfer.setDragImage(dragNode, dragOffsetX, dragOffsetY);
}
};

Expand All @@ -35,12 +40,12 @@ export const RecipeFeedItemComponent = ({ recipe, shouldObscureFeed }: Component
handleDragStart={handleDragStart}
onAddToClipboard={noop}
shouldObscureFeed={shouldObscureFeed}
/>
)
}
/>
);
};

const mapStateToProps = (state: State) => ({
shouldObscureFeed: selectFeatureValue(state, 'obscure-feed'),
})
});

export const RecipeFeedItem = connect(mapStateToProps)(RecipeFeedItemComponent)
export const RecipeFeedItem = connect(mapStateToProps)(RecipeFeedItemComponent);
4 changes: 2 additions & 2 deletions fronts-client/src/util/collectionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ThunkResult, Dispatch } from 'types/Store';
import { PosSpec } from 'lib/dnd';
import { insertCardWithCreate } from 'actions/Cards';
import { CapiArticle } from 'types/Capi';
import {Recipe} from "../types/Recipe";
import { Recipe } from '../types/Recipe';

export interface RefDrop {
type: 'REF';
Expand All @@ -29,7 +29,7 @@ const dropToCard = (e: React.DragEvent): MappableDropType | null => {
}),
recipe: (data: string): RecipeDrop => ({
type: 'RECIPE',
data: JSON.parse(data)
data: JSON.parse(data),
}),
text: (url: string): RefDrop => ({ type: 'REF', data: url }),
};
Expand Down

0 comments on commit a1a28b8

Please sign in to comment.