Skip to content

Commit

Permalink
disable light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stxphxn committed Sep 19, 2024
1 parent bce75f6 commit f68b166
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 16 deletions.
Binary file added public/etherlink-favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/images/logos/etherlink-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/images/logos/taiko-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/taiko-favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ html[data-theme='etherlink'] {
--color-gray-400: 154, 154, 154; /* Text Secondary dark */
--color-gray-500: 75, 75, 75;
--color-gray-600: 57, 57, 57;
--color-gray-700: 39, 39, 39; /* Select Box Background */
--color-gray-700: 69, 69, 69; /* Select Box Background */
--color-gray-800: 27, 27, 27; /* Box Input Background */
--color-gray-900: 18, 18, 18; /* Box Background */
--color-gray-850: 23, 23, 23; /* Background */
Expand Down
11 changes: 3 additions & 8 deletions src/assets/images/icons/networks/taiko.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/components/btns/DarkModeToggle.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<script lang="ts" setup>
import useBreakpoints from '@/composables/useBreakpoints';
import useDarkMode from '@/composables/useDarkMode';
import useNetwork from '@/composables/useNetwork';
/**
* COMPOSABLES
*/
const { isMobile } = useBreakpoints();
const { darkMode, toggleDarkMode } = useDarkMode();
const { networkSlug } = useNetwork();
const hasLightMode = computed(() => {
return networkSlug !== 'taiko' && networkSlug !== 'etherlink';
});
</script>

<template>
<BalBtn
v-if="hasLightMode"
color="white"
:size="isMobile ? 'md' : 'sm'"
:circle="isMobile"
Expand All @@ -20,3 +28,4 @@ const { darkMode, toggleDarkMode } = useDarkMode();
<SunIcon v-else />
</BalBtn>
</template>
s
3 changes: 2 additions & 1 deletion src/composables/useBackgroundColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ref, watch } from 'vue';
import { RouteLocationNormalizedLoaded, useRoute } from 'vue-router';

import useDarkMode from '@/composables/useDarkMode';
import { networkSlug } from './useNetwork';

/**
* CONSTANTS
Expand Down Expand Up @@ -41,7 +42,7 @@ function setBackgroundColor(color: string): void {
function setDefaultBgColor(): void {
if (darkMode.value) {
setBackgroundColor(defaultDarkBgColor);
} else {
} else if (networkSlug !== 'etherlink' && networkSlug !== 'taiko') {
setBackgroundColor(defaultBgColor);
}
}
Expand Down
19 changes: 16 additions & 3 deletions src/composables/useDarkMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@ import { ref } from 'vue';

import LS_KEYS from '@/constants/local-storage.keys';
import { lsSet } from '@/lib/utils';
import { networkSlug } from './useNetwork';

// const osDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
// const lsDarkMode =
// lsGet(LS_KEYS.App.DarkMode, osDarkMode.toString()) === 'true';

const lsDarkMode = LS_KEYS.App.DarkMode === 'true';
const lsDarkMode = ref(LS_KEYS.App.DarkMode === 'true');

// STATE
const darkMode = ref<boolean>(lsDarkMode);
const darkMode = computed({
get() {
if (networkSlug === 'etherlink' || networkSlug === 'taiko') {
return true;
}
return lsDarkMode.value;
},
set(value: boolean) {
if (networkSlug !== 'etherlink' && networkSlug !== 'taiko') {
lsDarkMode.value = value;
}
},
});

// MUTATIONS
function setDarkMode(val: boolean): void {
darkMode.value = val;
lsSet(LS_KEYS.App.DarkMode, darkMode.value.toString());
if (darkMode.value) {
document.documentElement.classList.add('dark');
} else {
} else if (networkSlug !== 'etherlink' && networkSlug !== 'taiko') {
document.documentElement.classList.remove('dark');
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/lib/config/etherlink/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pools: Pools = {
DynamicFees: {
Gauntlet: [],
},
BlockList: [],
BlockList: [''],
IncludedPoolTypes: [
'Weighted',
'Stable',
Expand All @@ -35,7 +35,10 @@ const pools: Pools = {
Weighted: {
// Only effective after given timestamp here: usePool.ts#createdAfterTimestamp
// see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic.
AllowList: [],
AllowList: [
'0xed18b89e2a1b64e4390099869ae7010e47261086000200000000000000000002', // WXTZ-USDC
'0xe9ea69169449fbb708bcec267f3e9c0643ecfb52000200000000000000000003', // WETH-USDC
],
},
Factories: {
'0x4e4131dc27ed9501ac5feb76f94572fdae9f0fd0': 'weightedPool', // Weighted V5
Expand Down
1 change: 1 addition & 0 deletions src/lib/config/taiko/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const pools: Pools = {
// see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic.
AllowList: [
'0xe0f51bf8d30db81d0a93125a17a2a40130ad9f7e000200000000000000000004', //WETH-USDC
'0x27ebdb9db75b8ca967ec331cb1e74880f1d7f0a8000200000000000000000005', //TAIKO-WETH
],
},
Factories: {
Expand Down
2 changes: 1 addition & 1 deletion src/locales/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"poolSummary": "Pool summary",
"poolAlreadyExists": "This pool already exists",
"previewPool": "Preview new {0} pool",
"recommendedLiquidity": "It’s recommended to provide new pools with at least $20,000 in initial funds",
"recommendedLiquidity": "It’s recommended to provide new pools with at least $2,000 in initial funds",
"recoveredState": "We've recovered your previous choices",
"recoveredStateInfo": "You previously left before creating this pool. Your choices have been saved so you can continue from before.",
"similarPoolsExist": "Similar pools exist",
Expand Down

0 comments on commit f68b166

Please sign in to comment.