Skip to content

Commit

Permalink
Merge pull request #4041 from nextcloud/fix/contact-details-spacing
Browse files Browse the repository at this point in the history
fix: adjust spacing and alignment in the contact details view
  • Loading branch information
ChristophWurst authored Jul 18, 2024
2 parents b7b1a0a + 75ee842 commit 8a9558c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 62 deletions.
104 changes: 42 additions & 62 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,46 @@
</template>
</template>

<template #quick-actions>
<div v-if="!editMode && !loadingData">
<Actions :inline="6"
type="secondary">
<ActionButton v-if="isTalkEnabled && isInSystemAddressBook"
:aria-label="(t('contacts', 'Go to talk conversation'))"
:name="(t('contacts', 'Go to talk conversation'))"
class="icon-talk quick-action"
:href="callUrl" />
<ActionButton v-if="profilePageLink"
class="quick-action"
:aria-label="(t('contacts','View profile'))"
:name="(t('contacts','View profile'))"
:href="profilePageLink">
<template #icon>
<IconAccount :size="20" />
</template>
</ActionButton>
<ActionLink v-for="emailAddress in emailAddressList"
:key="emailAddress"
class="quick-action"
:href="'mailto:' + emailAddress">
<template #icon>
<IconMail :size="20" />
</template>
{{ emailAddress }}
</ActionLink>
<ActionLink v-for="phoneNumber in phoneNumberList"
:key="phoneNumber"
class="quick-action"
:href="'tel:' + phoneNumber">
<template #icon>
<IconCall :size="20" />
</template>
{{ phoneNumber }}
</ActionLink>
</Actions>
</div>
</template>

<!-- actions -->
<template #actions>
<!-- warning message -->
Expand Down Expand Up @@ -207,49 +247,6 @@
<IconLoading v-if="loadingData" :size="20" class="contact-details" />
<!-- quick actions -->
<div v-else-if="!loadingData" class="contact-details-wrapper">
<div v-if="!editMode" class="quick-actions">
<Actions v-if="emailAddressProperties"
type="secondary">
<template #icon>
<IconMail :size="20" />
</template>
<ActionLink v-for="emailAddress in emailAddressList"
:key="emailAddress"
:href="'mailto:' + emailAddress">
<template #icon>
<IconMail :size="20" />
</template>
{{ emailAddress }}
</ActionLink>
</Actions>
<Actions v-if="phoneNumberProperties"
type="secondary">
<template #icon>
<IconCall :size="20" />
</template>
<ActionLink v-for="phoneNumber in phoneNumberList"
:key="phoneNumber"
:href="'tel:' + phoneNumber">
<template #icon>
<IconCall :size="20" />
</template>
{{ phoneNumber }}
</ActionLink>
</Actions>
<NcButton v-if="isTalkEnabled && isInSystemAddressBook"
:aria-label="(t('contacts', 'Go to talk conversation'))"
:name="(t('contacts', 'Go to talk conversation'))"
class="icon-talk"
:href="callUrl" />
<NcButton v-if="profilePageLink"
:aria-label="(t('contacts','View profile'))"
:name="(t('contacts','View profile'))"
:href="profilePageLink">
<template #icon>
<IconAccount :size="20" />
</template>
</NcButton>
</div>
<!-- contact details -->
<section class="contact-details">
<!-- properties iteration -->
Expand Down Expand Up @@ -1046,7 +1043,7 @@ export default {
.contact-details-wrapper {
display: inline;
align-items: flex-start;
padding: 50px 0 20px;
padding: 20px 0 20px;
gap: 15px;
float: left;
}
Expand All @@ -1059,24 +1056,7 @@ export default {
section.contact-details {
display: flex;
flex-direction: column;
gap: 40px;
}

.quick-actions {
display: flex;
flex: 1 0 auto;
gap: 15px;
margin-top: 40px;
margin-left: 204px;
padding-bottom: 30px;
}
@media only screen and (max-width: 600px) {
.quick-actions {
justify-content: center;
display: flex;
margin-top: -44px;
margin-left: 0;
}
gap: 10px;
}

#qrcode-modal {
Expand Down
10 changes: 10 additions & 0 deletions src/components/DetailsHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<div v-if="$slots.subtitle" class="contact-header__infos-subtitle">
<slot name="subtitle" />
</div>
<div class="contact-header__quick-actions">
<slot name="quick-actions" />
</div>
</div>
</div>

Expand Down Expand Up @@ -74,6 +77,9 @@ $top-padding: 50px;
align-items: center;
padding: $top-padding 0 20px;
gap: $contact-details-row-gap;
&__quick-actions{
padding: 5px 0;
}

@media (max-width: 1024px) {
// Top padding of 44px is already included in AppContent by default on mobile
Expand Down Expand Up @@ -127,6 +133,10 @@ $top-padding: 50px;
margin: 0;
}

&__quick-actions {
padding: 5px 0;
}

:deep(input) {
flex: 1 auto;
}
Expand Down
4 changes: 4 additions & 0 deletions src/css/ContactDetailsLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
$contact-details-label-max-width: 200px;
$contact-details-value-max-width: 300px;
$contact-details-row-gap: 15px;

.quick-action {
margin-right: 5px;
}

0 comments on commit 8a9558c

Please sign in to comment.