Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TAS-1386] 🔥 Remove content width settings #456

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -53 to -55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these in store also, if not used any where else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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,
}
Loading