Skip to content

Commit badfed3

Browse files
committed
refactor: add AppWindow wrapper component
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
1 parent bd6e66e commit badfed3

8 files changed

Lines changed: 44 additions & 47 deletions

File tree

src/authentication/renderer/AuthenticationApp.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
1010
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
1111
import NcTextField from '@nextcloud/vue/components/NcTextField'
1212
import IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'
13+
import AppWindow from '../../shared/components/AppWindow.vue'
1314
import { appData } from '../../app/AppData.js'
1415
import { refetchAppData } from '../../app/appData.service.js'
1516
import { MIN_REQUIRED_NEXTCLOUD_VERSION, MIN_REQUIRED_TALK_VERSION } from '../../constants.js'
@@ -157,7 +158,7 @@ async function login() {
157158
</script>
158159
159160
<template>
160-
<div class="wrapper">
161+
<AppWindow class="wrapper">
161162
<div class="spacer">
162163
<div class="logo" />
163164
</div>
@@ -209,12 +210,11 @@ async function login() {
209210
{{ BUILD_CONFIG.applicationName }} {{ version }}
210211
</footer>
211212
</div>
212-
</div>
213+
</AppWindow>
213214
</template>
214215
215216
<style scoped>
216217
.wrapper {
217-
height: 100vh;
218218
display: flex;
219219
flex-direction: column;
220220
align-items: center;

src/callbox/renderer/CallboxApp.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
1111
import IconClose from 'vue-material-design-icons/Close.vue'
1212
import IconPhoneHangupOutline from 'vue-material-design-icons/PhoneHangupOutline.vue'
1313
import IconPhoneOutline from 'vue-material-design-icons/PhoneOutline.vue'
14+
import AppWindow from '../../shared/components/AppWindow.vue'
1415
import { postBroadcast } from '../../shared/broadcast.service.ts'
1516
import { waitCurrentUserHasJoinedCall } from './callbox.service.ts'
1617
import { playRingtone } from './callbox.utils.ts'
@@ -62,7 +63,7 @@ function dismiss() {
6263
</script>
6364

6465
<template>
65-
<div class="callbox">
66+
<AppWindow class="callbox">
6667
<div class="callbox__info">
6768
<NcAvatar
6869
class="callbox__avatar"
@@ -110,15 +111,9 @@ function dismiss() {
110111
{{ t('talk_desktop', 'Join call') }}
111112
</NcButton>
112113
</div>
113-
</div>
114+
</AppWindow>
114115
</template>
115116

116-
<style>
117-
* {
118-
box-sizing: border-box;
119-
}
120-
</style>
121-
122117
<style scoped>
123118
.callbox {
124119
--height: calc(var(--default-clickable-area) * 2 + var(--default-grid-baseline) * 2 * 3);
@@ -127,7 +122,6 @@ function dismiss() {
127122
flex-direction: column;
128123
gap: var(--gap);
129124
padding: var(--gap);
130-
height: 100vh;
131125
user-select: none;
132126
backdrop-filter: blur(12px);
133127
background: rgba(0, 0, 0, .2);

src/certificate/renderer/CertificateApp.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
1313
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
1414
import IconAlert from 'vue-material-design-icons/Alert.vue'
1515
import IconShieldOffOutline from 'vue-material-design-icons/ShieldOffOutline.vue'
16+
import AppWindow from '../../shared/components/AppWindow.vue'
1617
import CertificateInfo from './components/CertificateInfo.vue'
1718
1819
useHotKey('Escape', () => window.close())
@@ -29,7 +30,7 @@ const isAdvanced = ref(false)
2930
</script>
3031

3132
<template>
32-
<div class="certificate">
33+
<AppWindow class="certificate">
3334
<h2 class="certificate__heading">
3435
{{ t('talk_desktop', 'Warning: potential security risk') }}
3536
</h2>
@@ -85,22 +86,15 @@ const isAdvanced = ref(false)
8586
{{ t('talk_desktop', 'Cancel') }}
8687
</NcButton>
8788
</div>
88-
</div>
89+
</AppWindow>
8990
</template>
9091

91-
<style>
92-
* {
93-
box-sizing: border-box;
94-
}
95-
</style>
96-
9792
<style scoped>
9893
.certificate {
9994
display: flex;
10095
flex-direction: column;
10196
align-items: stretch;
10297
gap: calc(4 * var(--default-grid-baseline));
103-
height: 100vh;
10498
padding: calc(4 * var(--default-grid-baseline));
10599
background: var(--color-main-background);
106100
}

src/help/renderer/HelpApp.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ref } from 'vue'
1111
import NcButton from '@nextcloud/vue/components/NcButton'
1212
import NcRichText from '@nextcloud/vue/components/NcRichText'
1313
import IconWindowClose from 'vue-material-design-icons/WindowClose.vue'
14+
import AppWindow from '../../shared/components/AppWindow.vue'
1415
import ButtonCopy from './ButtonCopy.vue'
1516
import TalkLogo from '../../../img/talk-icon-rounded.svg'
1617
import { BUILD_CONFIG } from '../../shared/build.config.ts'
@@ -40,7 +41,7 @@ function close() {
4041
</script>
4142

4243
<template>
43-
<div class="help">
44+
<AppWindow class="help">
4445
<div class="help__title-bar" :class="{ 'help__title-bar--mac': isMac }">
4546
<NcButton
4647
:aria-label="t('talk_desktop', 'Close')"
@@ -90,15 +91,9 @@ function close() {
9091
</div>
9192
</div>
9293
</div>
93-
</div>
94+
</AppWindow>
9495
</template>
9596

96-
<style>
97-
* {
98-
box-sizing: border-box;
99-
}
100-
</style>
101-
10297
<style scoped>
10398
.no-drag {
10499
app-region: no-drag;
@@ -107,7 +102,6 @@ function close() {
107102
.help {
108103
--spacing-4: calc(4 * var(--default-grid-baseline));
109104
app-region: drag;
110-
height: 100vh;
111105
padding: var(--spacing-4) var(--spacing-4) var(--spacing-4) 0;
112106
display: flex;
113107
flex-direction: column;

src/help/renderer/help.styles.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
* {
7-
box-sizing: border-box;
8-
}
9-
106
body {
117
background: var(--color-background-dark) !important;
128
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
<template>
7+
<div class="window">
8+
<slot />
9+
</div>
10+
</template>
11+
12+
<style>
13+
* {
14+
box-sizing: border-box;
15+
}
16+
</style>
17+
18+
<style scoped>
19+
.window {
20+
height: 100vh;
21+
}
22+
</style>

src/talk/renderer/TalkDesktop.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
<script setup lang="ts">
77
import { provide, ref } from 'vue'
8+
import AppWindow from '../../shared/components/AppWindow.vue'
89
import TalkWrapper from './TalkWrapper/TalkWrapper.vue'
910
import TitleBar from './TitleBar/TitleBar.vue'
1011
import { useNotificationsStore } from './notifications/notifications.store.js'
@@ -19,7 +20,9 @@ window.OCA.Viewer = createViewer()
1920
</script>
2021

2122
<template>
22-
<div id="skip-actions" />
23-
<TitleBar id="header" />
24-
<TalkWrapper @ready="isTalkInitialized = true" />
23+
<AppWindow>
24+
<div id="skip-actions" />
25+
<TitleBar id="header" />
26+
<TalkWrapper @ready="isTalkInitialized = true" />
27+
</AppWindow>
2528
</template>

src/upgrade/renderer/UpgradeApp.vue

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import { generateUrl } from '@nextcloud/router'
99
import NcButton from '@nextcloud/vue/components/NcButton'
1010
import IconCloudDownloadOutline from 'vue-material-design-icons/CloudDownloadOutline.vue'
1111
import IconWeb from 'vue-material-design-icons/Web.vue'
12+
import AppWindow from '../../shared/components/AppWindow.vue'
1213
1314
const packageInfo = window.TALK_DESKTOP.packageInfo
1415
1516
const browserLink = generateUrl('/apps/spreed')
1617
</script>
1718

1819
<template>
19-
<div class="upgrade">
20+
<AppWindow class="upgrade">
2021
<div class="upgrade__content">
2122
<h2 class="upgrade__heading">
2223
{{ t('talk_desktop', 'Upgrade required') }}
@@ -47,16 +48,9 @@ const browserLink = generateUrl('/apps/spreed')
4748
{{ t('talk_desktop', 'Continue in web browser') }} ↗
4849
</NcButton>
4950
</div>
50-
</div>
51+
</AppWindow>
5152
</template>
5253

53-
<style>
54-
* {
55-
box-sizing: border-box;
56-
user-select: none;
57-
}
58-
</style>
59-
6054
<style scoped>
6155
.upgrade {
6256
--upgrade-spacing: calc(2 * var(--default-grid-baseline));
@@ -65,9 +59,9 @@ const browserLink = generateUrl('/apps/spreed')
6559
align-items: stretch;
6660
text-align: center;
6761
gap: var(--upgrade-spacing);
68-
height: 100vh;
6962
background: var(--color-main-background);
7063
padding: var(--upgrade-spacing);
64+
user-select: none;
7165
}
7266
7367
.upgrade__content {

0 commit comments

Comments
 (0)