Skip to content

Commit

Permalink
chore: improve source formatting (#965)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <[email protected]>
  • Loading branch information
svienot authored Apr 9, 2024
1 parent de07f49 commit 137eaa2
Show file tree
Hide file tree
Showing 350 changed files with 7,412 additions and 7,148 deletions.
41 changes: 0 additions & 41 deletions public/networks-config.json

This file was deleted.

31 changes: 17 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export default defineComponent({

setup() {
const route = useRoute()
const onMainDashboardPage = computed( () => { return route.name == "MainDashboard" })
const onMainDashboardPage = computed(() => {
return route.name == "MainDashboard"
})

const buildRelease = import.meta.env.VITE_BUILD_RELEASE ?? "not available"
provide('buildRelease', buildRelease)
Expand Down Expand Up @@ -92,24 +94,24 @@ export default defineComponent({
})
provide('isLargeScreen', isLargeScreen)

const onResizeHandler = () => {
const onResizeHandler = () => {
windowWidth.value = window.innerWidth
}

const showCookiesDialog = ref(false)

const acceptCookies = ref<boolean|null>(null)
const acceptCookies = ref<boolean | null>(null)
watch(acceptCookies, (value) => {
if (value != null && value) {
insertGoogleTag(import.meta.env.VITE_APP_GOOGLE_TAG_ID)
}
})

provide(loadingKey, AxiosMonitor.instance.loading)
provide(initialLoadingKey, AxiosMonitor.instance.initialLoading)
provide(errorKey, AxiosMonitor.instance.error)
provide(explanationKey, AxiosMonitor.instance.explanation)
provide(suggestionKey, AxiosMonitor.instance.suggestion)
provide(loadingKey, AxiosMonitor.instance.loading)
provide(initialLoadingKey, AxiosMonitor.instance.initialLoading)
provide(errorKey, AxiosMonitor.instance.error)
provide(explanationKey, AxiosMonitor.instance.explanation)
provide(suggestionKey, AxiosMonitor.instance.suggestion)

onBeforeMount(() => {
const tagId = import.meta.env.VITE_APP_GOOGLE_TAG_ID
Expand Down Expand Up @@ -154,18 +156,18 @@ export default defineComponent({

function insertGoogleTag(tagId: string) {
const src1 = `https://www.googletagmanager.com/gtag/js?id=${tagId}`
let s1 = document.createElement( 'script' );
s1.setAttribute( 'async', '' );
s1.setAttribute( 'src', src1 );
document.head.appendChild( s1 );
let s1 = document.createElement('script');
s1.setAttribute('async', '');
s1.setAttribute('src', src1);
document.head.appendChild(s1);

const src2 = `window.dataLayer = window.dataLayer || [];
function gtag() {dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${import.meta.env.VITE_APP_GOOGLE_TAG_ID}');`
let s2 = document.createElement( 'script' );
let s2 = document.createElement('script');
s2.innerHTML = src2;
document.head.appendChild( s2 );
document.head.appendChild(s2);
}

</script>
Expand All @@ -179,6 +181,7 @@ section.section.is-top-section {
background-repeat: no-repeat;
background-size: 104px
}

section.section.is-top-section.is-medium-screen {
padding-bottom: 30px;
background-size: 112px
Expand Down
38 changes: 19 additions & 19 deletions src/AppStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AppStorage {
return result ?? networkRegistry.getDefaultEntry()
}

public static setLastNetwork(newValue: string|NetworkEntry): void {
public static setLastNetwork(newValue: string | NetworkEntry): void {
const newItem = typeof newValue == "string" ? newValue : newValue.name
this.setLocalStorageItem(this.LAST_USED_NETWORK_KEY, newItem)
}
Expand All @@ -48,10 +48,10 @@ export class AppStorage {
private static readonly DISCLAIMER_SKIP_KEY = 'skipDisclaimer'

public static getSkipDisclaimer(): boolean {
return this.getLocalStorageItem(this.DISCLAIMER_SKIP_KEY) != null
return this.getLocalStorageItem(this.DISCLAIMER_SKIP_KEY) != null
}

public static setSkipDisclaimer(newValue: boolean|null): void {
public static setSkipDisclaimer(newValue: boolean | null): void {
this.setLocalStorageItem(this.DISCLAIMER_SKIP_KEY, newValue ? "true" : null)
}

Expand All @@ -66,7 +66,7 @@ export class AppStorage {
return size ? Number(size) : null
}

public static setLogsTablePageSize(newValue: number | null ): void {
public static setLogsTablePageSize(newValue: number | null): void {
this.setLocalStorageItem(this.CONTRACT_LOGS_TABLE_PAGE_SIZE_KEY, newValue ? newValue?.toString() : null)
}

Expand All @@ -81,7 +81,7 @@ export class AppStorage {
return size ? Number(size) : null
}

public static setStatesTablePageSize(newValue: number | null ): void {
public static setStatesTablePageSize(newValue: number | null): void {
this.setLocalStorageItem(this.CONTRACT_STATES_TABLE_PAGE_SIZE_KEY, newValue ? newValue?.toString() : null)
}

Expand All @@ -94,7 +94,7 @@ export class AppStorage {
private static readonly COOKIE_POLICY_REJECT = 'reject'
private static readonly COOKIE_POLICY_VALIDITY = 365 // days

public static getAcceptCookiePolicy(): boolean|null {
public static getAcceptCookiePolicy(): boolean | null {
const policy = AppStorage.readCookie(AppStorage.COOKIE_POLICY_NAME)
return policy != null ? policy === AppStorage.COOKIE_POLICY_ACCEPT : null
}
Expand All @@ -111,10 +111,10 @@ export class AppStorage {
private static readonly SHOW_HEXA_OPCODE_KEY = 'hexaOpcode'

public static getShowHexaOpcode(): boolean {
return this.getLocalStorageItem(this.SHOW_HEXA_OPCODE_KEY) != null
return this.getLocalStorageItem(this.SHOW_HEXA_OPCODE_KEY) != null
}

public static setShowHexaOpcode(newValue: boolean|null): void {
public static setShowHexaOpcode(newValue: boolean | null): void {
this.setLocalStorageItem(this.SHOW_HEXA_OPCODE_KEY, newValue ? "true" : null)
}

Expand Down Expand Up @@ -167,9 +167,9 @@ export class AppStorage {

private static readonly INPUT_PARAMS = 'inputParams'

public static getInputParam(functionHash: string, paramName: string): unknown|null {
public static getInputParam(functionHash: string, paramName: string): unknown | null {
const jsonText = this.getLocalStorageItem(this.makeInputParamKey(functionHash, paramName))
let result: unknown|null
let result: unknown | null
if (jsonText !== null) {
try {
result = JSON.parse(jsonText)
Expand All @@ -182,7 +182,7 @@ export class AppStorage {
return result
}

public static setInputParam(newValue: unknown|null, functionHash: string, paramName: string) {
public static setInputParam(newValue: unknown | null, functionHash: string, paramName: string) {
const jsonText = newValue !== null ? JSON.stringify(newValue) : null
this.setLocalStorageItem(this.makeInputParamKey(functionHash, paramName), jsonText)
}
Expand All @@ -209,8 +209,8 @@ export class AppStorage {
// Private
//

private static getLocalStorageItem(keySuffix: string): string|null {
let result: string|null
private static getLocalStorageItem(keySuffix: string): string | null {
let result: string | null
try {
result = localStorage.getItem(AppStorage.VERSION + "/" + keySuffix)
} catch {
Expand All @@ -219,7 +219,7 @@ export class AppStorage {
return result
}

private static setLocalStorageItem(keySuffix: string, value: string|null) {
private static setLocalStorageItem(keySuffix: string, value: string | null) {
const key = AppStorage.VERSION + "/" + keySuffix
try {
if (value != null) {
Expand All @@ -237,25 +237,25 @@ export class AppStorage {
// from routines provided at https://www.quirksmode.org/js/cookies.html
//

private static createCookie(name: string, value: string, days:number): void {
private static createCookie(name: string, value: string, days: number): void {
let expires
if (days) {
let date = new Date()
date.setTime(date.getTime() + (days*24*60*60*1000))
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000))
expires = `; expires=${date.toUTCString()}`
} else {
expires = ""
}
document.cookie = `${name}=${value}${expires}; path=/`
}

private static readCookie(name: string): string|null {
private static readCookie(name: string): string | null {
let result = null
const nameEQ = name + "="
const ca = document.cookie.split(';')
for (let i= 0; i < ca.length; i++) {
for (let i = 0; i < ca.length; i++) {
let c = ca[i]
while (c.charAt(0)==' ') {
while (c.charAt(0) == ' ') {
c = c.substring(1, c.length)
}
if (c.indexOf(nameEQ) == 0) {
Expand Down
54 changes: 27 additions & 27 deletions src/assets/styles/brand-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@
*/

:root {
// Theme for MAINNET
--h-mainnet-background-color: #575757;
--h-mainnet-highlight-color: lightgrey;
--h-mainnet-page-background-color: #171717;
--h-mainnet-box-background-color: #202020;
--h-mainnet-pill-background-color: lightgrey;
// Theme for MAINNET
--h-mainnet-background-color: #575757;
--h-mainnet-highlight-color: lightgrey;
--h-mainnet-page-background-color: #171717;
--h-mainnet-box-background-color: #202020;
--h-mainnet-pill-background-color: lightgrey;

// Theme for TESTNET
--h-testnet-background-color: #575757;
--h-testnet-highlight-color: lightgrey;
--h-testnet-page-background-color: #171717;
--h-testnet-box-background-color: #202020;
--h-testnet-pill-background-color: lightgrey;
// Theme for TESTNET
--h-testnet-background-color: #575757;
--h-testnet-highlight-color: lightgrey;
--h-testnet-page-background-color: #171717;
--h-testnet-box-background-color: #202020;
--h-testnet-pill-background-color: lightgrey;

// Theme for PREVIEWNET
--h-previewnet-background-color: #575757;
--h-previewnet-highlight-color: lightgrey;
--h-previewnet-page-background-color: #171717;
--h-previewnet-box-background-color: #202020;
--h-previewnet-pill-background-color: lightgrey;
// Theme for PREVIEWNET
--h-previewnet-background-color: #575757;
--h-previewnet-highlight-color: lightgrey;
--h-previewnet-page-background-color: #171717;
--h-previewnet-box-background-color: #202020;
--h-previewnet-pill-background-color: lightgrey;

// Active Theme
--h-theme-background-color: var(--h-mainnet-background-color);
--h-theme-highlight-color: var(--h-mainnet-highlight-color);
--h-theme-page-background-color: var(--h-mainnet-page-background-color);
--h-theme-box-background-color: var(--h-mainnet-box-background-color);
--h-theme-pill-background-color: var(--h-mainnet-pill-background-color);
// Active Theme
--h-theme-background-color: var(--h-mainnet-background-color);
--h-theme-highlight-color: var(--h-mainnet-highlight-color);
--h-theme-page-background-color: var(--h-mainnet-page-background-color);
--h-theme-box-background-color: var(--h-mainnet-box-background-color);
--h-theme-pill-background-color: var(--h-mainnet-pill-background-color);
}

// Theme SCSS variables
Expand All @@ -64,9 +64,9 @@ $h-table-hover-background-color: $h-page-background-color;

// Global styling of boxes
.h-box-border {
border: 0.5px solid;
border-image-slice: 1;
border-image-source: $h-background-color;
border: 0.5px solid;
border-image-slice: 1;
border-image-source: $h-background-color;
}


Expand Down
Loading

0 comments on commit 137eaa2

Please sign in to comment.