Skip to content

Commit

Permalink
chore: remove dark theme code
Browse files Browse the repository at this point in the history
npm audit reported `svelte-local-storage-store` as problematic dependency - we do not really need it right now
  • Loading branch information
dawidsowardx committed Oct 10, 2024
1 parent ff4363f commit c970350
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 83 deletions.
1 change: 0 additions & 1 deletion apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"ramda": "^0.28.0",
"sanitize-html": "^2.11.0",
"svelte-filepond": "^0.2.0",
"svelte-local-storage-store": "^0.3.1",
"tslog": "^4.8.2",
"zod": "^3.21.4"
}
Expand Down
16 changes: 2 additions & 14 deletions apps/console/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
<script lang="ts">
import '@fonts'
import { featureFlags } from '@featureFlags'
import { darkTheme, getCssText } from '@styles'
import { getCssText } from '@styles'
import { navigating } from '$app/stores'
import { onMount } from 'svelte'
import {
accounts,
dAppToolkit,
gatewayApi,
selectedAccount,
storage
} from '@stores'
import { accounts, dAppToolkit, gatewayApi, selectedAccount } from '@stores'
import {
RadixDappToolkit,
Account,
Expand Down Expand Up @@ -90,12 +84,6 @@
resolveRDT(rdt)
})
$: if (mounted) {
document.body.classList[$storage.theme === 'dark' ? 'add' : 'remove'](
darkTheme
)
}
navigating
const routes: { text: string; icon: string; path: string }[] = [
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
"ramda": "^0.28.0",
"sanitize-html": "^2.11.0",
"svelte-filepond": "^0.2.0",
"svelte-local-storage-store": "^0.3.1",
"tslog": "^4.8.2",
"zod": "^3.21.4"
}
Expand Down
10 changes: 1 addition & 9 deletions apps/dashboard/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
import '@fonts'
import Layout from '@components/layout/Layout.svelte'
import { featureFlags } from '@featureFlags'
import { darkTheme } from '@styles'
import { navigating, page } from '$app/stores'
import { onMount } from 'svelte'
import {
accounts,
externalNavigationConfirmation,
selectedAccount,
storage
selectedAccount
} from '@stores'
import {
Account,
Expand Down Expand Up @@ -125,12 +123,6 @@
}
]
$: if (mounted) {
document.body.classList[$storage.theme === 'dark' ? 'add' : 'remove'](
darkTheme
)
}
navigating
let hideSearch = false
Expand Down
15 changes: 1 addition & 14 deletions package-lock.json

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

1 change: 0 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
"ramda": "^0.28.0",
"sanitize-html": "^2.11.0",
"svelte-filepond": "^0.2.0",
"svelte-local-storage-store": "^0.3.1",
"tslog": "^4.8.2",
"vite-tsconfig-paths": "^4.2.0",
"zod": "^3.21.4"
Expand Down
3 changes: 0 additions & 3 deletions packages/ui/src/stores.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { derived, writable } from 'svelte/store'
import { writable as localStorageStore } from 'svelte-local-storage-store'
import {
GatewayApiClient,
type NetworkConfigurationResponse
Expand All @@ -22,8 +21,6 @@ export const connected = derived(
([accounts]) => accounts.length > 0
)

export const storage = localStorageStore('storage', { theme: 'light' })

export const networkConfiguration = writable<
NetworkConfigurationResponse | undefined
>()
Expand Down
40 changes: 0 additions & 40 deletions packages/ui/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,43 +197,3 @@ export const {
mr: (value: SpaceKeys) => ({ marginRight: value })
}
})

export const darkTheme = createTheme<
Pick<(typeof config)['theme'], 'filters' | 'colors'>,
string
>({
filters: {
iconHover: 'brightness(1.5)'
},
colors: {
background: colors.grey0,
onBackground: colors.grey3,
surface: colors.grey01,
onSurface: colors.grey3,
primary: colors.green1,
onPrimary: colors.white,
action: colors.green1,
secondary: colors.grey4,
pickerBackground: colors.white,
onPickerBackground: colors.grey1,
primaryTextHover: colors.green2,
primaryButton: colors.green1,
primaryButtonHover: colors.grey1,
primaryButtonText: colors.white,
primaryGhostButton: colors.white,
primaryGhostButtonText: colors.grey1,
primaryGhostButtonHover: colors.blue1,
primaryGhostButtonHoverText: colors.white,
borderColor: colors.grey4,
grey: colors.grey1,
muted: colors.grey2,
slightlyMuted: colors.grey5,
text: colors.white,
highlightedText: colors.blue2,
transparent: 'transparent',
connectButton: colors.blue1,
connectButtonPopover: colors.blue2,
error: colors.red,
success: colors.green3
}
})

0 comments on commit c970350

Please sign in to comment.