Skip to content

Commit

Permalink
Feat/183 currency support (#185)
Browse files Browse the repository at this point in the history
* Bug: fix for incorrect btnClass attribute on setting/account menu buttons.

* Feature: configure webockets

* support for multi currency
  • Loading branch information
radicleart committed Jul 15, 2023
1 parent 2b40ac5 commit 4e28999
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 388 deletions.
68 changes: 62 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"classnames": "^2.3.2",
"flowbite": "^1.6.5",
"flowbite-svelte": "^0.39.1",
"sbtc-bridge-lib": "^1.0.22",
"sbtc-bridge-lib": "^1.0.24",
"sockjs": "^0.3.24",
"svelte-local-storage-store": "^0.5.0",
"svelte-qrcode": "^1.0.0",
"tailwind-merge": "^1.13.1"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/shared/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Button
type="button"
on:click={(event) => doClicked(event)}
btnClass="bg-primary-02 p-px font-normal rounded-xl focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50"
class="bg-primary-02 p-px font-normal rounded-xl focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50"
>
<span class="inline-flex items-center gap-x-1.5 bg-gray-1000 px-4 py-2 rounded-xl h-full">
<span class="text-transparent bg-clip-text bg-primary-02">{label}</span>
Expand All @@ -37,7 +37,7 @@
<Button
type="button"
on:click={(event) => doClicked(event)}
btnClass="inline-flex items-center gap-x-1.5 bg-primary-01 px-4 py-2 font-normal text-black rounded-xl border border-primary-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50"
class="inline-flex items-center gap-x-1.5 bg-primary-01 px-4 py-2 font-normal text-black rounded-xl border border-primary-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50"
>
{label}
</Button>
Expand Down
6 changes: 5 additions & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const TESTNET_CONFIG = {
VITE_PUBLIC_APP_NAME: 'sBTC Bridge Testnet',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_BRIDGE_WS: 'ws://bridge.stx.eco',
VITE_URI_BRIDGE: 'https://bridge.stx.eco',
VITE_URI_SIGN: 'https://sign.stx.eco',
VITE_URI_VOTE: 'https://vote.stx.eco',
Expand All @@ -21,6 +22,7 @@ const TESTNET_CONFIG = {
const MAINNET_CONFIG = {
VITE_PUBLIC_APP_NAME: 'sBTC Bridge',
VITE_PUBLIC_APP_VERSION: '1.0.0',
VITE_BRIDGE_WS: 'ws://bridge.stx.eco',
VITE_URI_BRIDGE: 'https://bridge.stx.eco',
VITE_URI_SIGN: 'https://sign.stx.eco',
VITE_URI_VOTE: 'https://vote.stx.eco',
Expand Down Expand Up @@ -50,6 +52,7 @@ const DEVNET_CONFIG = {
VITE_SBTC_WALLET: 'tb1q6zlpyrzvzjcrf6dlsctcrh9yl3dwfktsw0nclq',
VITE_SBTC_COORDINATOR: 'ST2BJA4JYFJ7SDMNFJZ9TJ3GB80P9Z80ADNF2R2AG',
VITE_SBTC_CONTRACT_ID: 'ST306HDPY54T81RZ7A9NGA2F03B8NRGW6Y59ZRZSD.faint-tan-cobra',
VITE_BRIDGE_WS: 'ws://localhost:3010',
VITE_BRIDGE_API: 'http://localhost:3010/bridge-api/v1',
VITE_SIGNER_API: 'http://localhost:3010/signer-api/v1',
VITE_STACKS_API: 'http://localhost:3999',
Expand Down Expand Up @@ -77,7 +80,8 @@ export function setConfig(search:string) {
CONFIG.VITE_URI_VOTE = 'http://localhost:8082'

// toggle depending on location / ip address etc
//CONFIG.VITE_BRIDGE_API = 'http://localhost:3010/bridge-api/v1'
//CONFIG.VITE_BRIDGE_WS = 'ws://localhost:3030'
//CONFIG.VITE_BRIDGE_API = 'http://localhost:3030/bridge-api/v1'
//CONFIG.VITE_SIGNER_API: 'http://localhost:3010/signer-api/v1',
}
//console.log('CONFIG.VITE_BRIDGE_API: ' + CONFIG.VITE_BRIDGE_API);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/header/AccountDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@

<div id="clipboard"></div>

<Button btnClass="block w-full md:w-auto md:inline-flex items-center gap-x-1.5 bg-primary-01 px-4 py-2 font-normal text-black rounded-xl border border-primary-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50 shrink-0">
<Button class="block w-full md:w-auto md:inline-flex items-center gap-x-1.5 bg-primary-01 px-4 py-2 font-normal text-black rounded-xl border border-primary-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500/50 shrink-0">
My account
<svg class="hidden md:inline" width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.426 8.4428L10.1782 12.9405C10.1552 12.964 10.1277 12.9828 10.0973 12.9957C10.0664 13.0089 10.0331 13.0156 9.99953 13.0156C9.96593 13.0156 9.93266 13.0089 9.90174 12.9957C9.87138 12.9828 9.84389 12.964 9.82084 12.9405L5.57304 8.4428L5.57305 8.44278L5.56984 8.43945C5.5239 8.39169 5.49879 8.32765 5.50004 8.2614C5.50129 8.19515 5.5288 8.1321 5.57651 8.08611L5.22954 7.72611L5.57619 8.08642C5.62394 8.04048 5.68798 8.01537 5.75424 8.01662C5.8198 8.01786 5.88222 8.0448 5.92807 8.09159L9.6356 12.027L9.99953 12.4133L10.3635 12.027L14.0735 8.08897L14.0735 8.08903L14.0799 8.08203C14.1023 8.05725 14.1296 8.03724 14.1599 8.02317C14.1903 8.0091 14.2232 8.00127 14.2566 8.00014C14.29 7.99901 14.3234 8.00461 14.3546 8.01659C14.3858 8.02858 14.4143 8.04671 14.4384 8.06992C14.4626 8.09313 14.4817 8.12094 14.4949 8.1517C14.5081 8.18246 14.5149 8.21555 14.515 8.24901C14.5152 8.28247 14.5086 8.31561 14.4957 8.34648C14.4828 8.37734 14.4638 8.40531 14.4399 8.4287L14.4328 8.43561L14.426 8.4428Z" fill="white" stroke="black"/>
</svg>
</Button>
<Dropdown
frameClass="z-30 rounded-lg !bg-black !border py-1 !border-gray-900"
class="z-30 rounded-lg !bg-black !border py-1 !border-gray-900"
ulClass="py-1 w-full"
placement='bottom-end'>
<div slot="header" class="bg-gray-1000 overflow-hidden py-1 text-white">
Expand Down

0 comments on commit 4e28999

Please sign in to comment.