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

Release/desktop 1.2.0 #2794

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import { TransakCryptoCurrency } from '@auxiliary/transak'
import { Button, Icon, IconName, Spinner, Text } from '@bloomwalletio/ui'
import { DISCORD_URL } from '@contexts/settings'
import { selectedAccountIndex } from '@core/account/stores'
import { openUrlInBrowser, Platform } from '@core/app'
import { IS_MAC, openUrlInBrowser, Platform } from '@core/app'
import { localize } from '@core/i18n'
import { FiatCurrency } from '@core/market'
import { SupportedNetworkId } from '@core/network'
Expand All @@ -25,9 +24,6 @@
let isTransakOpen: boolean = false
let isTransakLoading: boolean = false

$: if ($selectedAccountIndex !== undefined) {
void closeTransak()
}
$: isTransakOpen, void handleOverlayChanges($popupState)

Platform.onEvent('transak-loaded', () => (isTransakLoading = false))
Expand Down Expand Up @@ -87,11 +83,6 @@
await updateTransakBounds()
}

async function closeTransak(): Promise<void> {
await Platform.closeTransak()
isTransakOpen = false
}

function onButtonClick(): void {
openUrlInBrowser(DISCORD_URL)
}
Expand Down Expand Up @@ -127,11 +118,14 @@
</div>
{/if}
</div>
{#if IS_MAC}
<div class="h-8 w-full"></div>
{/if}
</div>

<style>
.transak-container {
width: 30rem;
height: min(70vh, 700px);
height: min(80vh, 750px);
}
</style>
15 changes: 9 additions & 6 deletions packages/desktop/lib/electron/preloads/transak.preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ function observeStyleChanges(targetNode: Element): void {
window.addEventListener('DOMContentLoaded', () => {
observeStyleChanges(window.document.documentElement)

const appRoot = window.document.getElementById('appRoot')
if (appRoot) {
appRoot.style.borderBottomLeftRadius = '32px'
appRoot.style.borderBottomRightRadius = '32px'
appRoot.style.overflow = 'hidden'
// TODO: Potential bug in electron means that the page is not rendered properly on Mac when the background is transparent
if (process.platform !== 'darwin') {
const appRoot = window.document.getElementById('appRoot')
if (appRoot) {
appRoot.style.borderBottomLeftRadius = '32px'
appRoot.style.borderBottomRightRadius = '32px'
appRoot.style.overflow = 'hidden'
}
window.document.documentElement.style.backgroundColor = 'transparent'
}
window.document.documentElement.style.backgroundColor = 'transparent'
})
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "desktop",
"productName": "Bloom",
"version": "1.1.3",
"version": "1.2.0",
"description": "Simple and secure web3 wallet for the IOTA and Shimmer ecosystem",
"main": "public/build/main.process.js",
"repository": "[email protected]:bloomwalletio/bloom.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
data-label="transak-logo"
width="90"
height="28"
src="assets/logos/transak.svg"
src="assets/logos/transak-full.svg"
alt="Transak"
class:opacity-0={isLoading}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shared",
"version": "1.1.3",
"version": "1.2.0",
"description": "TypeScript library for the Bloom application",
"author": "Bloom Labs Ltd <[email protected]>",
"license": "PolyForm Strict License 1.0.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/shared/src/lib/core/utils/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export function debounce<T extends UiEventFunction>(callback: T, wait = 500): Ui
*/
export const clickOutside: Action<HTMLElement> = function (node) {
const onClick: (event: Event) => void = (event) => {
if (node && !node.contains(event.target as Node) && !event.defaultPrevented) {
if (!node) {
return
}

const hasClickedInNavbar = document.querySelector('body > app > navbar')?.contains(event.target as Node)
const hasClickedOutside = !node.contains(event.target as Node)
if (hasClickedOutside && !hasClickedInNavbar && !event.defaultPrevented) {
node.dispatchEvent(new CustomEvent('clickOutside', { detail: event }))
}
}
Expand Down
Loading