Skip to content

Commit

Permalink
feat: made both producton-lists clickable, no need for classnames and…
Browse files Browse the repository at this point in the history
… renamed prop
  • Loading branch information
malmen237 authored and birme committed Jul 12, 2024
1 parent 2bb8c78 commit 093a3f9
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/components/productions-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { LocalError } from "./error.tsx";

const ProductionItem = styled.button`
text-align: start;
color: #ffffff;
background-color: transparent;
flex: 1 0 calc(25% - 2rem);
justify-content: start;
Expand All @@ -12,10 +13,7 @@ const ProductionItem = styled.button`
border-radius: 0.5rem;
padding: 2rem;
margin: 0 2rem 2rem 0;
&.clickableList {
cursor: pointer;
}
cursor: pointer;
`;

const ProductionName = styled.div`
Expand All @@ -32,16 +30,14 @@ const ProductionId = styled.div`

type TProductionsList = {
productions: TBasicProduction[] | undefined;
className?: string;
error: Error | null;
manageProduction?: (v: string) => void;
setProductionId: (v: string) => void;
};

export const ProductionsList = ({
productions,
className,
error,
manageProduction,
setProductionId,
}: TProductionsList) => {
return (
<>
Expand All @@ -52,12 +48,7 @@ export const ProductionsList = ({
<ProductionItem
key={p.productionId}
type="button"
className={className}
onClick={() =>
manageProduction
? manageProduction(p.productionId)
: console.log("")
}
onClick={() => setProductionId(p.productionId)}
>
<ProductionName>{p.name}</ProductionName>
<ProductionId>{p.productionId}</ProductionId>
Expand Down

0 comments on commit 093a3f9

Please sign in to comment.