Skip to content

Commit a56316b

Browse files
committed
fix(ContactsSettings): redo
Signed-off-by: Grigory Vodyanov <[email protected]>
1 parent 66e1d5e commit a56316b

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

src/components/AppNavigation/ContactsSettings.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@
99
v-model:open="showSettings"
1010
:name="t('contacts', 'Contacts settings')"
1111
:show-navigation="true">
12-
<AppSettingsSection id="general-settings" :name="t('contacts', 'General settings')">
12+
<AppSettingsSection id="general-settings" :name="t('contacts', 'General')">
1313
<CheckboxRadioSwitch
1414
:model-value="enableSocialSync"
1515
:loading="enableSocialSyncLoading"
1616
:disabled="enableSocialSyncLoading"
17+
type="switch"
1718
class="social-sync__checkbox contacts-settings-modal__form__row"
19+
:description="t('contacts', 'Refreshed once per week')"
1820
@update:model-value="toggleSocialSync">
1921
<div class="social-sync__checkbox__label">
2022
<span>
2123
{{ t('contacts', 'Update avatars from social media') }}
22-
<em>{{ t('contacts', '(refreshed once per week)') }}</em>
2324
</span>
2425
</div>
2526
</CheckboxRadioSwitch>
2627
<SettingsSortContacts class="contacts-settings-modal__form__row" />
28+
<SettingsImportContacts
29+
:addressbooks="addressbooks"
30+
class="contacts-settings-modal__form__row"
31+
@clicked="onClickImport"
32+
@file-loaded="onLoad" />
2733
</AppSettingsSection>
2834
<AppSettingsSection id="address-books" :name="t('contacts', 'Address books')">
2935
<div class="contacts-settings-modal__form">
@@ -33,11 +39,6 @@
3339
</ul>
3440
</div>
3541
<SettingsNewAddressbook class="contacts-settings-modal__form__row settings-new-addressbook" :addressbooks="addressbooks" />
36-
<SettingsImportContacts
37-
:addressbooks="addressbooks"
38-
class="contacts-settings-modal__form__row"
39-
@clicked="onClickImport"
40-
@file-loaded="onLoad" />
4142
</div>
4243
</AppSettingsSection>
4344
</AppSettingsDialog>

src/components/AppNavigation/Settings/SettingsNewAddressbook.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55

66
<template>
77
<div class="new-addressbook-entry">
8+
<NcButton v-if="!enabled" @click="enabled = true">
9+
<template #icon>
10+
<IconAdd :size="20" />
11+
</template>
12+
{{ t('contacts', 'New address book') }}
13+
</NcButton>
814
<IconLoading v-if="loading" :size="20" />
9-
<NcInputField
15+
<NcInputField v-if="enabled"
1016
v-model:model-value="displayName"
1117
class="new-addressbook"
1218
:disabled="loading"
@@ -28,7 +34,7 @@
2834

2935
<script>
3036
import { showError } from '@nextcloud/dialogs'
31-
import { NcInputField } from '@nextcloud/vue'
37+
import { NcInputField, NcButton } from '@nextcloud/vue'
3238
import IconLoading from 'vue-material-design-icons/Loading.vue'
3339
import IconAdd from 'vue-material-design-icons/Plus.vue'
3440
@@ -38,12 +44,14 @@ export default {
3844
NcInputField,
3945
IconAdd,
4046
IconLoading,
47+
NcButton,
4148
},
4249
4350
data() {
4451
return {
4552
loading: false,
4653
displayName: '',
54+
enabled: false,
4755
}
4856
},
4957
@@ -82,3 +90,17 @@ export default {
8290
},
8391
}
8492
</script>
93+
94+
<style lang="scss" scoped>
95+
96+
.new-addressbook-entry {
97+
display: flex;
98+
width: 100%;
99+
justify-content: stretch;
100+
margin-top: calc(var(--default-grid-baseline) * 2);
101+
102+
> * {
103+
flex-grow: 1;
104+
}
105+
}
106+
</style>

src/components/AppNavigation/Settings/SettingsSortContacts.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
<template>
77
<div class="sort-contacts">
8-
<IconList class="settings-line__icon" />
98
<NcSelect
109
id="sort-by"
1110
:value="orderKeyOption"
@@ -14,6 +13,7 @@
1413
:options="options"
1514
:custom-label="formatSortByLabel"
1615
:get-option-key="(option) => option.key"
16+
:input-label="t('contacts', 'Sort by')"
1717
label="label"
1818
@input="sortContacts" />
1919
</div>
@@ -89,6 +89,13 @@ export default {
8989

9090
<style lang="scss" scoped>
9191
.sort-contacts {
92+
width: 100%;
9293
display: flex;
94+
justify-content: stretch;
95+
margin-bottom: calc(var(--default-grid-baseline) * 2);
96+
97+
#sort-by {
98+
flex-grow: 1;
99+
}
93100
}
94101
</style>

0 commit comments

Comments
 (0)