-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:chigozzdevv/spotnet into feat/Add-s…
…taking-page-for-desktop
- Loading branch information
Showing
19 changed files
with
642 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
frontend/src/components/ClosePositionModal/ClosePositionModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
import './closePositionModal.css'; | ||
import { Button } from 'components/ui/Button'; | ||
|
||
export const ClosePositionModal = ({ isOpen, onClose, handleSubmit }) => { | ||
if (!isOpen) return null; | ||
|
||
return createPortal( | ||
<div className="close-position-overlay"> | ||
<div className="close-position-wrapper"> | ||
<div className="close-position-box"> | ||
<div className="close-position-content"> | ||
<div className="close-position-title">Open New Position</div> | ||
<h2>Do you want to open new a position?</h2> | ||
<p>You have already opened a position.</p> | ||
<p>Please close active position to open a new one. </p> | ||
<p>Click the ‘Close Active Position’ button to continue.</p> | ||
</div> | ||
<div className="close-position-actions"> | ||
<Button variant="secondary" size="md" onClick={onClose}> | ||
Cancel | ||
</Button> | ||
<Button variant="primary" size="md" onClick={handleSubmit}> | ||
Close Active Position | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
</div>, | ||
document.body | ||
); | ||
}; |
160 changes: 160 additions & 0 deletions
160
frontend/src/components/ClosePositionModal/closePositionModal.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
.close-position-overlay { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: var(--spinner-bgn); | ||
z-index: 9999; | ||
} | ||
|
||
.close-position-wrapper { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
max-width: 800px; | ||
width: 90%; | ||
box-shadow: var(--primary-color); | ||
overflow: hidden; | ||
} | ||
|
||
.close-position-box { | ||
border-radius: 16px; | ||
max-width: 642px; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
text-align: center; | ||
} | ||
|
||
.close-position-content { | ||
text-align: center; | ||
padding: 24px; | ||
border: var(--nav-divider-bg) 1px solid; | ||
background-color: var(--header-button-bg); | ||
border-radius: 48px; | ||
} | ||
|
||
.close-position-title { | ||
color: var(--text-gray); | ||
text-align: center; | ||
font-size: 16px; | ||
padding-bottom: 10px; | ||
border-bottom: 1px solid rgba(255, 255, 255, 0.1); | ||
margin-bottom: 24px; | ||
} | ||
|
||
.close-position-content h2 { | ||
color: var(--primary); | ||
font-size: 24px; | ||
font-weight: 500; | ||
margin-bottom: 16px; | ||
line-height: 1.3; | ||
} | ||
|
||
.close-position-content p { | ||
color: var(--text-gray); | ||
font-size: 14px; | ||
line-height: 1.5; | ||
max-width: 380px; | ||
margin: 0 auto; | ||
} | ||
|
||
.close-position-actions { | ||
display: flex; | ||
gap: 16px; | ||
} | ||
|
||
.close-position-btn { | ||
flex: 1; | ||
padding: 20px 16px; | ||
border-radius: 40px; | ||
font-size: 16px; | ||
font-weight: bold; | ||
background-color: var(--plain-button-bg); | ||
cursor: pointer; | ||
} | ||
|
||
.close-position-cancel-btn { | ||
color: var(--primary); | ||
position: relative; | ||
border: none; | ||
} | ||
|
||
.close-position-cancel-btn::before { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
border-radius: 40px; | ||
padding: 1px; | ||
background: var(--button-gradient); | ||
mask: | ||
linear-gradient(#fff 0 0) content-box, | ||
linear-gradient(#fff 0 0); | ||
-webkit-mask: | ||
linear-gradient(#fff 0 0) content-box, | ||
linear-gradient(#fff 0 0); | ||
-webkit-mask-composite: xor; | ||
mask-composite: exclude; | ||
} | ||
|
||
.close-position-confirm-btn { | ||
color: var(--primary); | ||
background: var(--second-gradient); | ||
border: none; | ||
} | ||
|
||
/* Mobile Styles */ | ||
@media screen and (max-width: 768px) { | ||
.close-position-content { | ||
padding: 16px; | ||
border-radius: 16px; | ||
} | ||
|
||
.close-position-wrapper { | ||
max-width: 390px; | ||
width: 100%; | ||
padding: 20px; | ||
} | ||
|
||
.close-position-title { | ||
font-size: 14px; | ||
padding-block: 12px; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.close-position-content h2 { | ||
font-size: 16px; | ||
margin-bottom: 12px; | ||
} | ||
|
||
.close-position-content p { | ||
font-size: 14px; | ||
max-width: 320px; | ||
} | ||
|
||
.close-position-actions { | ||
gap: 8px; | ||
} | ||
|
||
.close-position-btn { | ||
padding: 20px 8px; | ||
border-radius: 16px; | ||
font-size: 14px; | ||
} | ||
|
||
.close-position-cancel-btn::before { | ||
border-radius: 16px; | ||
} | ||
|
||
.close-position-confirm-btn { | ||
font-size: 14px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.