Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
burger-builder-template
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нұрасыл Қайратұлы
burger-builder-template
Commits
eabf3027
Commit
eabf3027
authored
Dec 16, 2024
by
Нұрасыл Қайратұлы
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add disabled props
parent
f050a0af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
BuildControl.tsx
src/components/BuildControls/BuildControl/BuildControl.tsx
+3
-2
BuildControls.tsx
src/components/BuildControls/BuildControls.tsx
+1
-0
Burger.tsx
src/components/Burger/Burger.tsx
+1
-1
No files found.
src/components/BuildControls/BuildControl/BuildControl.tsx
View file @
eabf3027
...
@@ -5,13 +5,14 @@ interface Props {
...
@@ -5,13 +5,14 @@ interface Props {
type
:
IngredientNames
type
:
IngredientNames
lessHandler
:
VoidFunction
lessHandler
:
VoidFunction
moreHandler
:
VoidFunction
moreHandler
:
VoidFunction
disabled
:
boolean
;
}
}
const
BuildControl
=
({
type
,
moreHandler
,
lessHandler
}:
Props
)
=>
{
const
BuildControl
=
({
disabled
,
type
,
moreHandler
,
lessHandler
}:
Props
)
=>
{
return
(
return
(
<
div
className=
"BuildControl"
>
<
div
className=
"BuildControl"
>
<
div
className=
"Label"
>
{
type
}
</
div
>
<
div
className=
"Label"
>
{
type
}
</
div
>
<
button
className=
"Less"
onClick=
{
lessHandler
}
>
Less
</
button
>
<
button
className=
"Less"
disabled=
{
disabled
}
onClick=
{
lessHandler
}
>
Less
</
button
>
<
button
className=
"More"
onClick=
{
moreHandler
}
>
More
</
button
>
<
button
className=
"More"
onClick=
{
moreHandler
}
>
More
</
button
>
</
div
>
</
div
>
);
);
...
...
src/components/BuildControls/BuildControls.tsx
View file @
eabf3027
...
@@ -23,6 +23,7 @@ const BuildControls = ({ingredients, price, lessHandler, moreHandler}: Props) =>
...
@@ -23,6 +23,7 @@ const BuildControls = ({ingredients, price, lessHandler, moreHandler}: Props) =>
type=
{
ingKey
as
IngredientNames
}
type=
{
ingKey
as
IngredientNames
}
moreHandler=
{
()
=>
moreHandler
(
ingKey
as
IngredientNames
)
}
moreHandler=
{
()
=>
moreHandler
(
ingKey
as
IngredientNames
)
}
lessHandler=
{
()
=>
lessHandler
(
ingKey
as
IngredientNames
)
}
lessHandler=
{
()
=>
lessHandler
(
ingKey
as
IngredientNames
)
}
disabled=
{
!
Boolean
(
ingredients
[
ingKey
as
IngredientNames
])
}
/>
/>
))
))
}
}
...
...
src/components/Burger/Burger.tsx
View file @
eabf3027
import
{
ReactNode
}
from
'react'
;
import
{
ReactNode
,
useState
}
from
'react'
;
import
{
IngredientNames
,
Ingredients
}
from
'@/interfaces/Ingredients'
;
import
{
IngredientNames
,
Ingredients
}
from
'@/interfaces/Ingredients'
;
import
Ingredient
from
'./Ingredient/Ingredient'
;
import
Ingredient
from
'./Ingredient/Ingredient'
;
import
'./Burger.css'
;
import
'./Burger.css'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment