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

Change Prev/next links to buttons #2695

Merged
merged 2 commits into from
Jul 18, 2022
Merged
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
67 changes: 28 additions & 39 deletions src/components/Modal/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@
</Actions>

<!-- Close modal -->
<Actions v-if="canClose && !closeButtonContained" class="header-close">
<ActionButton @click="close">
Copy link
Contributor

Choose a reason for hiding this comment

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

Regression, fix in #3066

<template #icon>
<Close :size="iconSize" />
</template>
{{ t('Close') }}
</ActionButton>
</Actions>
<ButtonVue v-if="canClose && !closeButtonContained"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<ButtonVue v-if="canClose && !closeButtonContained"
<Button v-if="canClose && !closeButtonContained"

suggestion (non-blocking): Rename ButtonVue to Button where it's used

Copy link
Contributor

Choose a reason for hiding this comment

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

It was used like this before. Don't know why.

Copy link
Contributor

@marcoambrosini marcoambrosini Jul 18, 2022

Choose a reason for hiding this comment

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

When there are regular button elements the names conflict, so we import the vue button as ButtonVue

type="tertiary"
class="header-close"
:aria-label="closeButtonAriaLabel">
<template #icon>
<Close :size="iconSize" />
</template>
</ButtonVue>
</div>
</div>
</transition>
Expand All @@ -178,20 +178,18 @@
@mousedown.self="close">
<!-- Navigation button -->
<transition name="fade-visibility">
<a v-show="hasPrevious"
<ButtonVue v-show="hasPrevious"
type="tertiary-no-background"
class="prev"
href="#"
:class="{
invisible: !hasPrevious
}"
@click.prevent.stop="previous">
<span class="icon-previous">
:aria-label="prevButtonAriaLabel"
@click="previous">
<template #icon>
<ChevronLeft :size="40" />
<span class="hidden-visually">
{{ t('Previous') }}
</span>
</span>
</a>
</template>
</ButtonVue>
</transition>

<!-- Content -->
Expand All @@ -212,20 +210,18 @@

<!-- Navigation button -->
<transition name="fade-visibility">
<a v-show="hasNext"
<ButtonVue v-show="hasNext"
type="tertiary-no-background"
class="next"
href="#"
:class="{
invisible: !hasNext
}"
@click.prevent.stop="next">
<span class="icon-next">
:aria-label="nextButtonAriaLabel"
@click="next">
<template #icon>
<ChevronRight :size="40" />
<span class="hidden-visually">
{{ t('Next') }}
</span>
</span>
</a>
</template>
</ButtonVue>
</transition>
</div>
</transition>
Expand All @@ -235,7 +231,6 @@

<script>
import Actions from '../Actions/index.js'
import ActionButton from '../ActionButton/index.js'
import Tooltip from '../../directives/Tooltip/index.js'
import l10n from '../../mixins/l10n.js'
import Timer from '../../utils/Timer.js'
Expand All @@ -254,7 +249,6 @@ export default {
name: 'Modal',

components: {
ActionButton,
Actions,
ChevronLeft,
ChevronRight,
Expand Down Expand Up @@ -403,6 +397,12 @@ export default {
closeButtonAriaLabel() {
return t('Close modal')
},
prevButtonAriaLabel() {
return t('Previous')
},
nextButtonAriaLabel() {
return t('Next')
},
},

watch: {
Expand Down Expand Up @@ -761,17 +761,6 @@ export default {
right: 0;
}

// buttons/icons
.icon-next,
.icon-previous {
box-sizing: border-box;
width: $clickable-area;
height: $clickable-area;
color: white;
background-image: none;
display: flex;
}

/* Content */
.modal-container {
position: relative;
Expand Down