feat: add single column layout toggle option

This commit is contained in:
codytseng
2025-10-19 14:50:49 +08:00
parent 56729e09c3
commit dbee10361b
23 changed files with 298 additions and 112 deletions

View File

@@ -51,6 +51,7 @@ class LocalStorageService {
private shownCreateWalletGuideToastPubkeys: Set<string> = new Set()
private sidebarCollapse: boolean = false
private primaryColor: TPrimaryColor = 'DEFAULT'
private enableSingleColumnLayout: boolean = false
constructor() {
if (!LocalStorageService.instance) {
@@ -201,6 +202,9 @@ class LocalStorageService {
this.primaryColor =
(window.localStorage.getItem(StorageKey.PRIMARY_COLOR) as TPrimaryColor) ?? 'DEFAULT'
this.enableSingleColumnLayout =
window.localStorage.getItem(StorageKey.ENABLE_SINGLE_COLUMN_LAYOUT) === 'true'
// Clean up deprecated data
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
window.localStorage.removeItem(StorageKey.ACCOUNT_FOLLOW_LIST_EVENT_MAP)
@@ -502,6 +506,15 @@ class LocalStorageService {
this.primaryColor = color
window.localStorage.setItem(StorageKey.PRIMARY_COLOR, color)
}
getEnableSingleColumnLayout() {
return this.enableSingleColumnLayout
}
setEnableSingleColumnLayout(enable: boolean) {
this.enableSingleColumnLayout = enable
window.localStorage.setItem(StorageKey.ENABLE_SINGLE_COLUMN_LAYOUT, enable.toString())
}
}
const instance = new LocalStorageService()