Skip to content

Commit

Permalink
Merge pull request #39 from MateuszKitzol/hints-improvement
Browse files Browse the repository at this point in the history
Add more direct hints
  • Loading branch information
MateuszKitzol authored Dec 15, 2023
2 parents 53f287e + aa4663d commit 514bcd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React, { useState, UseContext, useEffect } from 'react';
import * as S from './styles.js'
import { recipesAsObj } from '../../../../../public/recipes.js';

export const WindowSolutionButton = ({item, stateChanger}) => {
const createStrBasedOnObj = (obj, item) => {
return Object.keys(recipesAsObj[item]).map(key => `${recipesAsObj[item][key]}*${key}`).join(" + ")
}

export const WindowSolutionButton = ({item, stateChanger}) => {

const onClickEventHandler = () => {
stateChanger(x => false);
}

console.log(JSON.stringify(recipesAsObj[item]))

return (
<S.WindowSolutionButton onClick={onClickEventHandler} name='key' item={item}>
<S.WindowSolutionButton onClick={onClickEventHandler} name='key' item={createStrBasedOnObj(recipesAsObj, item)}>
</S.WindowSolutionButton>
)
}
1 change: 1 addition & 0 deletions src/App/MainPage/Window/WindowShowSolutionButton/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const WindowSolutionButton = styled(Button)`
&:hover {
animation-name: widthAnimation;
animation-duration: 1000ms;
animation-delay: -500ms;
animation-fill-mode: forwards;
background: none;
Expand Down

0 comments on commit 514bcd5

Please sign in to comment.