Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
cmvanb committed Sep 29, 2024
1 parent 6d8122f commit 218a63f
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 49 deletions.
5 changes: 3 additions & 2 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { createSignal } from 'solid-js';

import TopBar from './components/TopBar';
import DrawerMenu from './components/DrawerMenu';
import { RecipeProvider } from './contexts/RecipeContext';

function App(props) {
const [menuOpen, setMenuOpen] = createSignal(false);

return (
<div>
<RecipeProvider>
<header>
<TopBar menuOpen={menuOpen} setMenuOpen={setMenuOpen} />
<DrawerMenu menuOpen={menuOpen} setMenuOpen={setMenuOpen} />
Expand All @@ -17,7 +18,7 @@ function App(props) {
</main>
<footer>
</footer>
</div>
</RecipeProvider>
);
}

Expand Down
48 changes: 48 additions & 0 deletions frontend/src/assets/dummy-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const chicken_korma = {
title: 'Chicken Korma',
author: 'Izzah',
description: 'Looking for a Chicken Korma recipe that’s the real deal? This one-pot chicken korma is made in the Pakistani and North Indian way but without the fuss. All the mind-blowing flavor of korma – yet ready in much less time. After making & testing this korma for years, I’ve perfected it to the point that I can confidently call it the BEST chicken korma.',
source_url: 'https://www.teaforturmeric.com/authentic-chicken-korma/',
servings: 6,
prep_time: 15,
cook_time: 45,
ingredients: [
'1/3 cup neutral oil',
'2 tbsp ghee, or sub more oil',
'2 (~500 g) large onions, sliced*',
'2 lbs bone-in, cut up, skinless chicken (or sub chicken thighs), cleaned and excess skin removed',
'2 bay leaves',
'1 tsp cumin seeds',
'1/8 tsp whole black peppercorns',
'3 green cardamom pods',
'5 whole cloves',
'1 1-inch cinnamon stick',
'8-10 cloves garlic, crushed',
'1 inch piece ginger, crushed',
'2 small tomatoes* (optional), quartered',
'3/4 cup plain, whole-milk yogurt',
'2 tsp coriander powder',
'1 tsp cumin powder',
'1 tsp red chili powder or to taste',
'1/2 tsp turmeric powder',
'1/2 tsp paprika powder or Kashmiri red chili powder, optional – for color',
'2 1/8 tsp salt, or to taste depending on amount of chicken',
'2-3 green chili peppers, chopped',
'1-2 black cardamom pods (optional)',
'1 piece whole mace, or sub pinch ground mace or cinnamon',
'½ tsp garam masala',
'pinch nutmeg powder',
'1/2 tsp diluted kewra essence, or sub rose water',
'1/4 cup cilantro leaves, chopped, optional – for garnish',
'10-12 blanched almonds, for garnish',
],
instructions: [
'Heat a large, heavy-bottomed pan over high heat. Once hot, add the oil and onions and sauté the onions until they are golden brown (~20-25 minutes depending on quantity). Remove the onions from the pan and transfer them to a food processor. Add tomatoes (if using) and yogurt to the food processor and process until mostly smooth.',
'In the same pan used to brown onions, heat ghee (or oil) and add the whole spices, garlic, and ginger. Sauté for 30 seconds or until the garlic and ginger begin to darken. Add the chicken and fry it until it changes color (~5 minutes).',
'Add the yogurt mixture to chicken along with the ground spices, salt, and green chili peppers and sauté until the mixture comes to a light simmer (~2-3 minutes).',
'Lower the heat to medium-low, cover, and allow it to cook for 15 minutes. Uncover and stir in the black cardamom (if using), mace, garam masala, and nutmeg powder. Cover and cook again for 10 minutes.',
'Raise the heat to high. Add 1/2 to 3/4 cup of water (depending on how thin you\'d like the curry) and bring to a boil. Lower the heat and allow chicken to simmer for another 2-3 minutes. The oil will have risen to the top. Sprinkle the kewra essence and stir. Turn off the heat and garnish with cilantro and blanched almonds.',
],
};

export { chicken_korma };
23 changes: 23 additions & 0 deletions frontend/src/contexts/RecipeContext.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { createContext, useContext } from 'solid-js';

import { recipeStore } from '../stores/RecipeStore';

const RecipeContext = createContext();

function RecipeProvider(props) {
return (
<RecipeContext.Provider
value={{
recipeStore,
}}
>
{props.children}
</RecipeContext.Provider>
);
}

function useRecipeContext() {
return useContext(RecipeContext);
}

export { RecipeProvider, useRecipeContext };
2 changes: 1 addition & 1 deletion frontend/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { render } from 'solid-js/web';
import { Router, Route } from '@solidjs/router';

// NOTE: Ordered so local styles will override global styles.
// Local styles will override global styles.
import 'beercss';
import './index.css';

Expand Down
50 changes: 4 additions & 46 deletions frontend/src/pages/Recipe.jsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
import './Recipe.css';

import { useRecipeContext } from '../contexts/RecipeContext';

function Recipe() {
const recipe = {
title: 'Chicken Korma',
author: 'Izzah',
description: 'Looking for a Chicken Korma recipe that’s the real deal? This one-pot chicken korma is made in the Pakistani and North Indian way but without the fuss. All the mind-blowing flavor of korma – yet ready in much less time. After making & testing this korma for years, I’ve perfected it to the point that I can confidently call it the BEST chicken korma.',
source_url: 'https://www.teaforturmeric.com/authentic-chicken-korma/',
servings: 6,
prep_time: 15,
cook_time: 45,
ingredients: [
'1/3 cup neutral oil',
'2 tbsp ghee, or sub more oil',
'2 (~500 g) large onions, sliced*',
'2 lbs bone-in, cut up, skinless chicken (or sub chicken thighs), cleaned and excess skin removed',
'2 bay leaves',
'1 tsp cumin seeds',
'1/8 tsp whole black peppercorns',
'3 green cardamom pods',
'5 whole cloves',
'1 1-inch cinnamon stick',
'8-10 cloves garlic, crushed',
'1 inch piece ginger, crushed',
'2 small tomatoes* (optional), quartered',
'3/4 cup plain, whole-milk yogurt',
'2 tsp coriander powder',
'1 tsp cumin powder',
'1 tsp red chili powder or to taste',
'1/2 tsp turmeric powder',
'1/2 tsp paprika powder or Kashmiri red chili powder, optional – for color',
'2 1/8 tsp salt, or to taste depending on amount of chicken',
'2-3 green chili peppers, chopped',
'1-2 black cardamom pods (optional)',
'1 piece whole mace, or sub pinch ground mace or cinnamon',
'½ tsp garam masala',
'pinch nutmeg powder',
'1/2 tsp diluted kewra essence, or sub rose water',
'1/4 cup cilantro leaves, chopped, optional – for garnish',
'10-12 blanched almonds, for garnish',
],
instructions: [
'Heat a large, heavy-bottomed pan over high heat. Once hot, add the oil and onions and sauté the onions until they are golden brown (~20-25 minutes depending on quantity). Remove the onions from the pan and transfer them to a food processor. Add tomatoes (if using) and yogurt to the food processor and process until mostly smooth.',
'In the same pan used to brown onions, heat ghee (or oil) and add the whole spices, garlic, and ginger. Sauté for 30 seconds or until the garlic and ginger begin to darken. Add the chicken and fry it until it changes color (~5 minutes).',
'Add the yogurt mixture to chicken along with the ground spices, salt, and green chili peppers and sauté until the mixture comes to a light simmer (~2-3 minutes).',
'Lower the heat to medium-low, cover, and allow it to cook for 15 minutes. Uncover and stir in the black cardamom (if using), mace, garam masala, and nutmeg powder. Cover and cook again for 10 minutes.',
'Raise the heat to high. Add 1/2 to 3/4 cup of water (depending on how thin you\'d like the curry) and bring to a boil. Lower the heat and allow chicken to simmer for another 2-3 minutes. The oil will have risen to the top. Sprinkle the kewra essence and stir. Turn off the heat and garnish with cilantro and blanched almonds.',
],
};
const { recipeStore } = useRecipeContext();
const recipe = recipeStore.recipeList[0];

const closeRecipe = () => {
console.warn('Not implemented yet.')
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/stores/RecipeStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createStore } from 'solid-js/store';

import { chicken_korma } from '../assets/dummy-data';

const [ recipeStore, setRecipeStore ] = createStore({
recipeList: [
chicken_korma,
],
});

export { recipeStore, setRecipeStore };

0 comments on commit 218a63f

Please sign in to comment.