Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderBook added in footer #814

Merged
merged 9 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/BitcoinAmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ const BitcoinAmountInput = forwardRef(
inputMode={inputType.inputMode}
className={classNames('slashed-zeroes', className)}
value={
inputType.type === 'text'
? (field.value?.displayValue ?? '')
: String(field.value?.userRawInputValue ?? '')
inputType.type === 'text' ? field.value?.displayValue ?? '' : String(field.value?.userRawInputValue ?? '')
}
placeholder={placeholder}
min={displayInputUnit === 'BTC' ? '0.00000001' : '1'}
Expand Down
38 changes: 37 additions & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { InfoModal } from './Modal'
import { isDebugFeatureEnabled, isDevMode } from '../constants/debugFeatures'
import { routes } from '../constants/routes'
import { toSemVer } from '../utils'
import { OrderbookOverlay } from './Orderbook'
import packageInfo from '../../package.json'

const APP_DISPLAY_VERSION = (() => {
const version = toSemVer(packageInfo.version)
return !isDevMode() ? version.raw : `${version.major}.${version.minor}.${version.patch + 1}dev`
Expand All @@ -29,6 +29,7 @@ export default function Footer() {

const [showBetaWarning, setShowBetaWarning] = useState(false)
const [showCheatsheet, setShowCheatsheet] = useState(false)
const [isShowOrderbook, setIsShowOrderbook] = useState(false)

const cheatsheetEnabled = useMemo(() => !!currentWallet, [currentWallet])
const websocketConnected = useMemo(() => websocketState === WebSocket.OPEN, [websocketState])
Expand Down Expand Up @@ -82,6 +83,26 @@ export default function Footer() {
</Trans>
</div>
</div>
<rb.Col className="d-flex justify-content-center">
<OrderbookOverlay
show={isShowOrderbook}
onHide={() => setIsShowOrderbook(false)}
nickname={serviceInfo?.nickname ?? undefined}
/>
<rb.Button
variant="outline-dark"
className="border-0 d-inline-flex align-items-center"
onClick={() => setIsShowOrderbook(true)}
style={{
backgroundColor: 'transparent',
borderColor: 'transparent',
color: 'inherit',
}}
>
<Sprite symbol="globe" width="24" height="24" className="me-2" />
{t('footer.orderbook')}
</rb.Button>
</rb.Col>
<div className="d-flex order-1 flex-1 flex-grow-0 justify-content-center align-items-center">
{cheatsheetEnabled && (
<>
Expand All @@ -102,6 +123,21 @@ export default function Footer() {
</>
)}
</div>
<rb.Col className="d-flex justify-content-center">
<OrderbookOverlay
show={isShowOrderbook}
onHide={() => setIsShowOrderbook(false)}
nickname={serviceInfo?.nickname ?? undefined}
/>
<rb.Button
variant="outline-dark"
className="border-0 d-inline-flex align-items-center"
onClick={() => setIsShowOrderbook(true)}
>
<Sprite symbol="globe" width="24" height="24" className="me-2" />
{t('earn.button_show_orderbook')}
</rb.Button>
</rb.Col>
<div className="d-flex flex-1 order-2 justify-content-end align-items-center gap-1">
{isDebugFeatureEnabled('devSetupPage') && (
<div className="d-none d-md-block text-small text-start mx-1">
Expand Down
6 changes: 3 additions & 3 deletions src/components/Send/SendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function CollaborativeTransactionOptions({
amount:
selectedAmount?.isSweep && sourceJarBalance
? sourceJarBalance.calculatedAvailableBalanceInSats
: (selectedAmount?.value ?? null),
: selectedAmount?.value ?? null,
numCollaborators: selectedNumCollaborators ?? null,
isCoinjoin: true,
})
Expand Down Expand Up @@ -134,8 +134,8 @@ function CollaborativeTransactionOptions({
numCollaborators={selectedNumCollaborators ?? null}
amount={
selectedAmount?.isSweep
? (sourceJarBalance?.calculatedAvailableBalanceInSats ?? null)
: (selectedAmount?.value ?? null)
? sourceJarBalance?.calculatedAvailableBalanceInSats ?? null
: selectedAmount?.value ?? null
}
onClick={() => {
setActiveFeeConfigModalSection('cj_fee')
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"warning_alert_button_ok": "Fine with me.",
"cheatsheet": "Cheatsheet",
"websocket_connected": "Websocket connected",
"websocket_disconnected": "Websocket disconnected"
"websocket_disconnected": "Websocket disconnected",
"orderbook": "Orderbook"
},
"onboarding": {
"splashscreen_title": "Jam",
Expand Down