diff --git a/src/components/mainScreen/mobileAddPart/addPartUserItem.tsx b/src/components/mainScreen/mobileAddPart/addPartUserItem.tsx index 3161ab1..2043af5 100644 --- a/src/components/mainScreen/mobileAddPart/addPartUserItem.tsx +++ b/src/components/mainScreen/mobileAddPart/addPartUserItem.tsx @@ -1,8 +1,9 @@ -import React from "react"; +import React, { useState } from "react"; import { ToolbarButton } from "../toolbar/toolbarButton"; import { TypeToolbarButtons } from "../toolbar/typeButtons"; import { BorderLine } from "./borderLine"; import { CaptionToolbarButtons } from "../toolbar/typeCaptionButtons"; +import { ControlButton } from "../toolbar/controlButton"; type TProps = { typeUser: TypeToolbarButtons @@ -12,6 +13,16 @@ type TProps = { } export const AddPartUserItem:React.FC = React.memo((props) => { + const controlStates = ['default', 'questing', 'return', 'questing'];// temp + const [currentControlState, setCurrentControlState] = useState(0); // temp + + // temp + function nextControlState() { + if(currentControlState + 1 < controlStates.length) + setCurrentControlState(currentControlState + 1); + else setCurrentControlState(0); + } + return
props?.onClickItem ? props?.onClickItem() : null}> = React.memo((props) => { caption='' isCaption={false} onClick={() => props?.onClickMicro ? props?.onClickMicro() : null} - /> - props?.onClickControl ? props?.onClickControl() : null } - /> + /> + { + // temp + currentControlState === 0 + ? nextControlState()} + state={"default"} + userType={'admin'} + /> + : currentControlState === 1 + ? <> + nextControlState()} + type={"no"} + caption={''} + isCaption={false} + size={"medium"} + /> + nextControlState()} + type={"yes"} + caption={''} + isCaption={false} + size={"medium"} + /> + + : currentControlState === 2 + ? nextControlState()} + state={"waiting"} + userType={'admin'} + /> + : currentControlState === 3 + ? <> + nextControlState()} + type={"no"} + caption={''} + isCaption={false} + size={"medium"} + /> + nextControlState()} + type={"yes"} + caption={''} + isCaption={false} + size={"medium"} + /> + + : null + }
: null } diff --git a/src/components/mainScreen/toolbar/buttonContainer.tsx b/src/components/mainScreen/toolbar/buttonContainer.tsx index 33738d2..302ae7e 100644 --- a/src/components/mainScreen/toolbar/buttonContainer.tsx +++ b/src/components/mainScreen/toolbar/buttonContainer.tsx @@ -15,15 +15,17 @@ type TProps = { active?: boolean, isSelected?: boolean }> + isOpenToolbar: boolean isBorderLineTop?: 'hide' | 'show' isBorderLineBottom?: 'hide' | 'show' } export const ButtonContainer:React.FC = React.memo((props) => { + const windowHeight = useContext(ContextWindowHeight); const [openedAddButtons, setOpenedAddButtons] = useState(''); const controlStates = ['default', 'questing', 'return', 'questing'];// temp const [currentControlState, setCurrentControlState] = useState(0); // temp - const windowHeight = useContext(ContextWindowHeight); + const typeUser = 'admin' // 'user' // temp // temp function nextControlState() { @@ -63,7 +65,7 @@ export const ButtonContainer:React.FC = React.memo((props) => { /> { button.type.includes('user') && windowHeight > 700 ? -
+
onClick()} @@ -86,7 +88,7 @@ export const ButtonContainer:React.FC = React.memo((props) => { ? nextControlState()} state={"default"} - userType={'admin'} + userType={typeUser} /> : currentControlState === 1 ? <> @@ -108,8 +110,8 @@ export const ButtonContainer:React.FC = React.memo((props) => { : currentControlState === 2 ? nextControlState()} - state={"return"} - userType={'admin'} + state={"waiting"} + userType={typeUser} /> : currentControlState === 3 ? <> @@ -136,7 +138,7 @@ export const ButtonContainer:React.FC = React.memo((props) => { } { button.type.includes('language') && windowHeight > 700 ? -
+
{onClick(); button.onClick()}} type={button.type} diff --git a/src/components/mainScreen/toolbar/toolbar.css b/src/components/mainScreen/toolbar/toolbar.css index 871452a..c4d4247 100644 --- a/src/components/mainScreen/toolbar/toolbar.css +++ b/src/components/mainScreen/toolbar/toolbar.css @@ -367,7 +367,7 @@ box-sizing: border-box; display: flex; width: 196px; - height: 44px; + height: 40px; border-radius: 50px; justify-content: center; align-items: center; @@ -446,4 +446,8 @@ .toolbar-button:active { opacity: .7; } + + .control-button { + height: 44px; + } } \ No newline at end of file diff --git a/src/components/mainScreen/toolbar/toolbar.tsx b/src/components/mainScreen/toolbar/toolbar.tsx index 2a45a0b..eb4f87d 100644 --- a/src/components/mainScreen/toolbar/toolbar.tsx +++ b/src/components/mainScreen/toolbar/toolbar.tsx @@ -48,6 +48,7 @@ export const Toolbar:React.FC = React.memo((props) => { isSelected: props?.isOpenUsersMobilePart } ]} + isOpenToolbar={props.isOpen} />
@@ -66,6 +67,7 @@ export const Toolbar:React.FC = React.memo((props) => { isCaption: false } ]} + isOpenToolbar={props.isOpen} /> {/* */} = React.memo((props) => { isCaption: true } ]} + isOpenToolbar={props.isOpen} />
@@ -140,6 +143,7 @@ export const Toolbar:React.FC = React.memo((props) => { isCaption: true } ]} + isOpenToolbar={props.isOpen} /> = React.memo((props) => { } ]} isBorderLineTop={"hide"} + isOpenToolbar={props.isOpen} /> {/*