Skip to content

Commit

Permalink
refactor(ShareLink): remove v-sheet to avoid linebreak
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Aug 17, 2024
1 parent fabdf44 commit 3cfb7b6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/components/OpenFoodFactsLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<a v-if="display === 'link'" :href="getUrl" target="_blank" :disabled="disabled">
{{ getSourceName }}
</a>
<v-btn v-else-if="display === 'button'" size="small" :prepend-icon="getSourceIcon" append-icon="mdi-open-in-new" :href="getUrl" target="_blank" :disabled="disabled">
{{ getSourceName }}
</v-btn>
<v-list-item v-else-if="display === 'list-item'" :slim="true" :prepend-icon="getSourceIcon" append-icon="mdi-open-in-new" :href="getUrl" target="_blank" :disabled="disabled">
{{ getSourceName }}
</v-list-item>
<v-btn v-else-if="display === 'button'" size="small" :prepend-icon="getSourceIcon" append-icon="mdi-open-in-new" :href="getUrl" target="_blank" :disabled="disabled">
{{ getSourceName }}
</v-btn>
</template>

<script>
Expand All @@ -34,7 +34,7 @@ export default {
display: {
type: String,
default: 'link',
examples: ['link', 'button', 'list-item']
examples: ['link', 'list-item', 'button']
},
disabled: {
type: Boolean,
Expand Down
8 changes: 4 additions & 4 deletions src/components/PriceAddLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<a v-if="display === 'link'" :to="getAddUrl" :disabled="disabled">
{{ $t('Common.AddPrice') }}
</a>
<v-list-item v-else-if="display === 'list-item'" :slim="true" base-color="primary" prepend-icon="mdi-tag-plus-outline" :to="getAddUrl" :disabled="disabled">
{{ $t('Common.AddPrice') }}
</v-list-item>
<v-btn
v-else-if="display === 'button'"
size="small"
Expand All @@ -12,9 +15,6 @@
>
{{ $t('Common.AddPrice') }}
</v-btn>
<v-list-item v-else-if="display === 'list-item'" :slim="true" base-color="primary" prepend-icon="mdi-tag-plus-outline" :to="getAddUrl" :disabled="disabled">
{{ $t('Common.AddPrice') }}
</v-list-item>
</template>

<script>
Expand All @@ -36,7 +36,7 @@ export default {
display: {
type: String,
default: 'link',
examples: ['link', 'button', 'list-item']
examples: ['link', 'list-item', 'button']
},
disabled: {
type: Boolean,
Expand Down
52 changes: 25 additions & 27 deletions src/components/ShareLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@
<a v-if="display === 'link'" :disabled="disabled" @click="shareViaWebShare">
{{ $t('Common.Share') }}
</a>
<v-sheet v-else-if="display === 'button'">
<v-btn
v-if="!$vuetify.display.smAndUp"
class="ml-2"
size="small"
density="comfortable"
color="teal"
icon="mdi-share-variant"
:title="$t('Common.Share')"
:disabled="disabled"
@click="shareViaWebShare"
/>
<v-btn
v-else
class="ml-2"
size="small"
rounded="xl"
color="teal"
prepend-icon="mdi-share-variant"
:title="$t('Common.Share')"
:disabled="disabled"
@click="shareViaWebShare"
>
{{ $t('Common.Share') }}
</v-btn>
</v-sheet>
<v-list-item v-else-if="display === 'list-item'" :slim="true" base-color="teal" prepend-icon="mdi-share-variant" :disabled="disabled" @click="shareViaWebShare">
{{ $t('Common.Share') }}
</v-list-item>
<v-btn
v-else-if="display === 'button' && !$vuetify.display.smAndUp"
class="ml-2"
size="small"
density="comfortable"
color="teal"
icon="mdi-share-variant"
:title="$t('Common.Share')"
:disabled="disabled"
@click="shareViaWebShare"
/>
<v-btn
v-else-if="display === 'button' && $vuetify.display.smAndUp"
class="ml-2"
size="small"
rounded="xl"
color="teal"
prepend-icon="mdi-share-variant"
:title="$t('Common.Share')"
:disabled="disabled"
@click="shareViaWebShare"
>
{{ $t('Common.Share') }}
</v-btn>

<v-snackbar
v-model="shareLinkCopySuccessMessage"
Expand All @@ -53,7 +51,7 @@ export default {
display: {
type: String,
default: 'link',
examples: ['link', 'button', 'list-item']
examples: ['link', 'list-item', 'button']
},
disabled: {
type: Boolean,
Expand Down

0 comments on commit 3cfb7b6

Please sign in to comment.