Skip to content

Commit

Permalink
Merge branch 'dev' into UI--Style-"No-active-ADM-nodes"-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
NikIvv authored Nov 29, 2024
2 parents 01e07e9 + dce0721 commit e24457e
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 28 deletions.
25 changes: 16 additions & 9 deletions src/components/DelegatesTable/DelegateVoteCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,35 @@ export default {
&__icon {
font-size: 24px !important;
height: 24px !important;
&--good {
color: map-get($adm-colors, 'good');
}
&--danger {
color: map-get($adm-colors, 'danger');
}
}
}
/** Themes **/
.v-theme--light {
.delegate-vote-checkbox {
&__icon {
color: map-get($adm-colors, 'muted');
&--good {
color: map-get($adm-colors, 'good');
}
&--danger {
color: map-get($adm-colors, 'danger');
}
}
}
}
.dark {
.v-theme--dark {
.delegate-vote-checkbox {
&__icon {
&--good {
color: map-get($adm-colors, 'good');
}
&--danger {
color: map-get($adm-colors, 'danger');
}
}
}
}
Expand Down
34 changes: 31 additions & 3 deletions src/components/LoginForm.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<v-form ref="form" class="login-form" @submit.prevent="submit">
<v-form ref="form" :class="classes.root" @submit.prevent="submit">
<v-row no-gutters>
<slot>
<v-text-field
v-model="passphrase"
:label="$t('login.password_label')"
autocomplete="current-password"
:class="classes.textField"
class="text-center"
color="white"
:type="showPassphrase ? 'text' : 'password'"
variant="underlined"
>
Expand Down Expand Up @@ -60,6 +60,12 @@ import { useRouter } from 'vue-router'
import { isAxiosError } from 'axios'
import { isAllNodesOfflineError, isAllNodesDisabledError } from '@/lib/nodes/utils/errors'
const className = 'login-form'
const classes = {
root: className,
textField: `${className}__textfield`
}
export default defineComponent({
props: {
modelValue: {
Expand All @@ -73,7 +79,6 @@ export default defineComponent({
const store = useStore()
const { t } = useI18n()
const showSpinner = ref(false)
const showPassphrase = ref(false)
const togglePassphraseVisibility = () => {
showPassphrase.value = !showPassphrase.value
Expand Down Expand Up @@ -133,6 +138,7 @@ export default defineComponent({
showSpinner,
passphrase,
showPassphrase,
classes,
togglePassphraseVisibility,
submit,
freeze,
Expand All @@ -142,3 +148,25 @@ export default defineComponent({
}
})
</script>

<style lang="scss" scoped>
@import 'vuetify/settings';
@import '@/assets/styles/settings/_colors.scss';
/** Themes **/
.v-theme--light {
.login-form {
&__textfield {
color: map-get($adm-colors, 'regular');
}
}
}
.v-theme--dark {
.login-form {
&__textfield {
color: map-get($shades, 'white');
}
}
}
</style>
5 changes: 1 addition & 4 deletions src/components/NodesOfflineDialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-dialog v-model="showDialog" width="500" :class="className">
<v-card>
<v-card-title class="a-text-header">
<v-card-title :class="`${className}__card-title a-text-header`">
{{ t('chats.nodes_offline_dialog.title', { coin: nodeType.toUpperCase() }) }}
</v-card-title>

Expand Down Expand Up @@ -83,9 +83,6 @@ export default {
&__card-text {
padding: 14px !important;
}
&__disclaimer {
margin-top: 10px;
}
&__btn {
margin-top: 15px;
margin-bottom: 20px;
Expand Down
17 changes: 17 additions & 0 deletions src/components/nodes/components/NodesTableHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default {

<style lang="scss">
@import 'vuetify/settings';
@import '@/assets/styles/settings/_colors.scss';
.nodes-table-head {
&__th {
Expand All @@ -76,4 +77,20 @@ export default {
width: 104px;
}
}
/** Themes **/
.v-theme--light {
.nodes-table-head {
&__th, &__label {
color: map-get($adm-colors, 'regular');
}
}
}
.v-theme--dark {
.nodes-table-head {
&__th, &__label {
color: map-get($adm-colors, 'white');
}
}
}
</style>
9 changes: 8 additions & 1 deletion src/components/transactions/Erc20Transaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useStore } from 'vuex'
import TransactionTemplate from './TransactionTemplate.vue'
import { getExplorerTxUrl } from '@/config/utils'
import { Cryptos, CryptoSymbol } from '@/lib/constants'
import { AllCryptos } from '@/lib/constants/cryptos'
import { useCryptoAddressPretty } from './hooks/address'
import { useBlockHeight } from '@/hooks/queries/useBlockHeight'
import { useTransactionStatus } from './hooks/useTransactionStatus'
Expand Down Expand Up @@ -96,7 +97,13 @@ export default defineComponent({
return transaction.value?.confirmations
})
const fee = computed(() => transaction.value?.fee)
const fee = computed(() => {
const ethFee = transaction.value?.fee || 0
const currentCurrency = store.state.options.currentRate
const currentRate = store.state.rate.rates[`${AllCryptos.ETH}/${currentCurrency}`]
const feeRate = (ethFee * currentRate).toFixed(2)
return +feeRate
})
return {
refetch,
Expand Down
14 changes: 8 additions & 6 deletions src/lib/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ marked.setOptions({

const renderer = new marked.Renderer()

renderer.image = function (_href, _title, _text) {
renderer.image = function ({ _href, _title, _text }) {
return ''
}

renderer.link = function (href, title, text) {
renderer.link = function ({ href, _title, text }) {
const linkPattern = /^(eth|bch|bitcoin|https?|s?ftp|magnet|tor|onion|tg):(.*)$/i
const emailPattern = /^(mailto):[^@]+@[^@]+\.[^@]+$/i

Expand All @@ -27,10 +27,12 @@ renderer.link = function (href, title, text) {
return text
}

renderer.heading = function (text) {
renderer.heading = function ({ text }) {
return `<p>${text}</p>`
}

marked.use({ renderer })

/**
* Sanitizes text to show HTML
* @param {string} text text to sanitize
Expand All @@ -46,7 +48,7 @@ export function sanitizeHTML(text = '') {
* @returns {string} resulting sanitized HTML
*/
export function renderMarkdown(text = '') {
return marked(DOMPurify.sanitize(text), { renderer })
return marked.parse(sanitizeHTML(text))
}

/**
Expand All @@ -58,15 +60,15 @@ export function renderMarkdown(text = '') {
export function removeFormats(text = '') {
const node = document.createElement('div')
const textWithSymbol = text.replace(/\n/g, '↵ ')
node.innerHTML = marked(DOMPurify.sanitize(textWithSymbol), { renderer })
node.innerHTML = marked.parse(sanitizeHTML(textWithSymbol))

return node.textContent || node.innerText || ''
}

export function formatMessage(text = '') {
const node = document.createElement('div')
const textWithSymbol = text.replace(/\n/g, '↵ ')
node.innerHTML = marked(DOMPurify.sanitize(textWithSymbol), { renderer })
node.innerHTML = marked.parse(sanitizeHTML(textWithSymbol))

const textWithoutHtml = node.textContent || node.innerText || ''
const styledText = textWithoutHtml.replace(//g, '<span class="arrow-return">↵</span>')
Expand Down
4 changes: 2 additions & 2 deletions src/lib/nodes/doge-indexer/DogeIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class DogeIndexer extends Node<AxiosInstance> {
protected async checkHealth() {
const time = Date.now()
const height = await this.client
.get('/api/blocks?limit=0')
.then((res) => res.data.blocks[0].height)
.get('/api/status')
.then((res) => res.data.info.blocks)

return {
height,
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"label": "Type",
"host": "Host",
"inactive": "Inactive",
"sync": "Sync",
"sync": "Syncing",
"ms": "ms",
"nodeLabelDescription": "Support decentralization and enhance privacy level—<a target=\"_blank\" href=\"https://medium.com/adamant-im/how-to-run-your-adamant-node-on-ubuntu-990e391e8fcc\">run your own ADAMANT node</a>. To add your nodes to the list, you need <a target=\"_blank\" href=\"https://github.com/Adamant-im/adamant-im/\">to deploy web application on separate domain</a>. This limitation refers to Content Security Policy (CSP).",
"offline": "Offline",
Expand Down
5 changes: 3 additions & 2 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<language-switcher prepend-icon="mdi-chevron-right" />
</div>
<div :class="`${className}__settings-button`">
<v-btn @click="$router.push('/options/nodes')" icon variant="flat" :size="32">
<v-btn @click="$router.push('/options/nodes')" icon variant="plain" :size="32">
<v-icon icon="mdi-cog" />
</v-btn>
</div>
Expand Down Expand Up @@ -229,7 +229,8 @@ export default defineComponent({
.login-page {
&__icon,
&__title,
&__subtitle {
&__subtitle,
&__settings-button {
color: map-get($adm-colors, 'regular');
}
}
Expand Down

0 comments on commit e24457e

Please sign in to comment.