From 3549b6e54292b3d6fe456025cefc397ba0aa070d Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 12 Aug 2024 12:32:36 +0300 Subject: [PATCH] fix: toggle --- src/components/MarkFormField/index.tsx | 22 ++++++++++++++++-- .../MarkFormField/style.module.scss | 23 ++++++++++++++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/components/MarkFormField/index.tsx b/src/components/MarkFormField/index.tsx index 15ecc2a..2fa2780 100644 --- a/src/components/MarkFormField/index.tsx +++ b/src/components/MarkFormField/index.tsx @@ -7,6 +7,7 @@ import { isCurrentUserMarksComplete, isCurrentValueLast } from '../../utils' +import { useState } from 'react' interface MarkFormFieldProps { handleSubmit: (event: any) => void @@ -28,6 +29,7 @@ const MarkFormField = ({ currentUserMarks, handleCurrentUserMarkChange }: MarkFormFieldProps) => { + const [displayActions, setDisplayActions] = useState(true) const getSubmitButtonText = () => (isReadyToSign() ? SIGN : NEXT) const isReadyToSign = () => isCurrentUserMarksComplete(currentUserMarks) || @@ -49,12 +51,28 @@ const MarkFormField = ({ ? handleSubmit(event) : handleCurrentUserMarkChange(findNext()!) } + const toggleActions = () => setDisplayActions(!displayActions) return (
- +
-
+
diff --git a/src/components/MarkFormField/style.module.scss b/src/components/MarkFormField/style.module.scss index e4e76ea..f3fa5d5 100644 --- a/src/components/MarkFormField/style.module.scss +++ b/src/components/MarkFormField/style.module.scss @@ -14,12 +14,16 @@ width: 100%; border-radius: 4px; padding: 10px 20px; - display: flex; + display: none; flex-direction: column; align-items: center; grid-gap: 15px; box-shadow: 0 -2px 4px 0 rgb(0,0,0,0.1); max-width: 750px; + + &.expanded { + display: flex; + } } .actionsWrapper { @@ -186,3 +190,20 @@ button:active { width: 100%; background: #4c82a3; } + +.trigger { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: relative; +} + +.triggerBtn { + background: white; + color: #434343; + padding: 5px 30px; + box-shadow: 0px -3px 4px 0 rgb(0,0,0,0.1); + position: absolute; + top: -25px; +}