Skip to content

Commit

Permalink
feat(#491): wire up WineRecipeList
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Apr 19, 2024
1 parent bc26548 commit 523955e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/Cellar/WinemakingTabPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent'
import ReactMarkdown from 'react-markdown'

import { WineRecipeList } from '../WineRecipeList/WineRecipeList'

import { TabPanel } from './TabPanel'

export const WinemakingTabPanel = ({ index, currentTab }) => (
<TabPanel value={currentTab} index={index}>
<WineRecipeList />
<Divider />
<ul className="card-list">
<li>
Expand Down
16 changes: 16 additions & 0 deletions src/components/WineRecipeList/WineRecipeList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { useContext } from 'react'

import { getWineVarietiesAvailableToMake } from '../../utils/getWineVarietiesAvailableToMake'
import FarmhandContext from '../Farmhand/Farmhand.context'

export const WineRecipeList = () => {
const {
gameState: { itemsSold },
} = useContext(FarmhandContext)

const winesVarietiesAvailableToMake = getWineVarietiesAvailableToMake(
itemsSold
)

return <>{JSON.stringify(winesVarietiesAvailableToMake)}</>
}
1 change: 0 additions & 1 deletion src/utils/getWineVarietiesAvailableToMake.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const getGrapesSold = itemsSold => {
return grapesSold
}

// FIXME: Test this
/**
* @param {itemsSold} itemsSold
* @returns {grapeVariety[]}
Expand Down

0 comments on commit 523955e

Please sign in to comment.