feat: refactor buttons

This commit is contained in:
Liyas Thomas
2021-07-03 13:14:58 +00:00
committed by GitHub
parent b55439ce44
commit 3e3da2f27b
103 changed files with 2150 additions and 2496 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div>
<div class="show-on-large-screen">
<div class="flex">
<li>
<input
data-testid="'url'"
@@ -10,72 +10,64 @@
:value="entry.url"
:placeholder="$t('empty_req_name')"
class="input cursor-pointer text-sm bg-transparent"
@click="$emit('use-entry')"
@click.native="$emit('use-entry')"
/>
</li>
<button
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="{
content: !entry.star ? $t('add_star') : $t('remove_star'),
}"
data-testid="star_button"
class="icon button"
:class="{ stared: entry.star }"
@click="$emit('toggle-star')"
>
<i class="material-icons">
{{ entry.star ? "star" : "star_border" }}
</i>
</button>
<button
@click.native="$emit('toggle-star')"
/>
<i class="material-icons">
{{ entry.star ? "star" : "star_border" }}
</i>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="{
content: expand ? $t('hide_more') : $t('show_more'),
}"
data-testid="query_expand"
class="icon button"
@click="expand = !expand"
>
<i class="material-icons">
{{ expand ? "unfold_less" : "unfold_more" }}
</i>
</button>
<tippy trigger="click" theme="popover" arrow>
@click.native="expand = !expand"
/>
<i class="material-icons">
{{ expand ? "unfold_less" : "unfold_more" }}
</i>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<button
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('options')"
data-testid="options"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
/>
<i class="material-icons">more_vert</i>
</template>
<div>
<button
<ButtonSecondary
data-testid="restore_history_entry"
class="icon button"
:aria-label="$t('restore')"
@click="$emit('use-entry')"
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
@click.native="$emit('use-entry')"
/>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</div>
<div>
<button
<ButtonSecondary
data-testid="delete_history_entry"
class="icon button"
:aria-label="$t('delete')"
@click="$emit('delete-entry')"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
@click.native="$emit('delete-entry')"
/>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</div>
</tippy>
</div>
<div class="show-on-large-screen">
<div class="flex">
<li data-testid="'query'">
<input
v-for="(line, index) in query"
@@ -89,7 +81,7 @@
</li>
</div>
<transition name="fade">
<div v-if="showMore" class="show-on-large-screen">
<div v-if="showMore" class="flex">
<li>
<input
v-tippy="{ theme: 'tooltip' }"