Skip to content

Commit

Permalink
🔥 Remove content width settings (#456)
Browse files Browse the repository at this point in the history
* 🔥 Remove content width settings

* 🔥 Remove ui module
  • Loading branch information
AuroraHuang22 authored Mar 19, 2024
1 parent 8afd6b2 commit e8fca6f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 104 deletions.
11 changes: 0 additions & 11 deletions components/RootLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,25 @@ import { namespace } from 'vuex-class'
import { IS_CHAIN_UPGRADING } from '~/constant'
const walletModule = namespace('wallet')
const uiModule = namespace('ui')
@Component({
head() {
const isDesktopViewMode: boolean =
this.$store.getters['ui/isDesktopViewMode']
const contentWidth = isDesktopViewMode
? 'width=1024, initial-scale=1, minimum-scale=1'
: 'width=device-width'
return {
htmlAttrs: {
class: this.$props.bgClass,
},
meta: [{ hid: 'viewport', name: 'viewport', content: contentWidth }],
}
},
})
export default class RootLayout extends Vue {
@walletModule.Action('restoreSessionIfNecessary') restoreSessionIfNecessary!: () => Promise<any>
@uiModule.Action('init') initUIStore!: () => void
@Prop({ default: 'bg-light-gray' }) readonly bgClass!: string
isOpenChainUpgradeBlockingDialog = false
async mounted() {
this.isOpenChainUpgradeBlockingDialog = !!IS_CHAIN_UPGRADING
this.initUIStore()
await this.restoreSessionIfNecessary()
}
Expand Down
32 changes: 1 addition & 31 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,14 @@
<IconArrowLeft class="w-[20px]" />
</template>
</Button>
<Button
:class="['mt-[26px]', 'text-medium-gray']"
preset="outline"
text-preset="h7"
size="mini"
:text="viewModeButtonText"
@click="handleChangeViewModeButtonClick"
/>
</div>
<AppFooter />
</RootLayout>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { namespace } from 'vuex-class'
const uiModule = namespace('ui')
@Component
export default class DefaultLayout extends Vue {
@uiModule.Getter isDesktopViewMode!: boolean
@uiModule.Action enableDesktopViewMode!: () => void
@uiModule.Action enableMobileViewMode!: () => void
get viewModeButtonText() {
if (this.isDesktopViewMode) {
return this.$t('HomePage.button.viewMode.mobile')
}
return this.$t('HomePage.button.viewMode.desktop')
}
handleChangeViewModeButtonClick() {
if (this.isDesktopViewMode) {
this.enableMobileViewMode()
} else {
this.enableDesktopViewMode()
}
}
}
export default class DefaultLayout extends Vue {}
</script>
58 changes: 0 additions & 58 deletions store/ui.ts

This file was deleted.

4 changes: 0 additions & 4 deletions utils/store-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ import { getModule } from 'vuex-module-decorators'

import WalletStore from '~/store/wallet'
import IscnStore from '~/store/iscn'
import UIStore from '~/store/ui'

let walletStore: WalletStore
let iscnStore: IscnStore
let uiStore: UIStore

function initialiseStores(store: Store<any>): void {
walletStore = getModule(WalletStore, store)
iscnStore = getModule(IscnStore, store)
uiStore = getModule(UIStore, store)
}

export {
initialiseStores,
walletStore,
iscnStore,
uiStore,
}

0 comments on commit e8fca6f

Please sign in to comment.