chore: minor ui improvements

This commit is contained in:
Liyas Thomas
2022-09-30 09:47:12 +05:30
parent 045dc10a0d
commit 1b23c5ea4a
33 changed files with 304 additions and 181 deletions

View File

@@ -36,14 +36,14 @@
<p> <p>
<a href="https://hoppscotch.io/#gh-light-mode-only" target="_blank"> <a href="https://hoppscotch.io/#gh-light-mode-only" target="_blank">
<img <img
src="./packages/hoppscotch-app/static/images/banner-light.png" src="./packages/hoppscotch-app/public/images/banner-light.png"
alt="Hoppscotch" alt="Hoppscotch"
width="100%" width="100%"
/> />
</a> </a>
<a href="https://hoppscotch.io/#gh-dark-mode-only" target="_blank"> <a href="https://hoppscotch.io/#gh-dark-mode-only" target="_blank">
<img <img
src="./packages/hoppscotch-app/static/images/banner-dark.png" src="./packages/hoppscotch-app/public/images/banner-dark.png"
alt="Hoppscotch" alt="Hoppscotch"
width="100%" width="100%"
/> />

View File

@@ -336,6 +336,7 @@ pre.ace_editor {
@apply font-semibold; @apply font-semibold;
@apply leading-body; @apply leading-body;
@apply tracking-normal; @apply tracking-normal;
@apply rounded;
@apply last: ml-4; @apply last: ml-4;
@apply sm: ml-8; @apply sm: ml-8;
@apply before: absolute; @apply before: absolute;
@@ -425,7 +426,7 @@ pre.ace_editor {
.cm-focused { .cm-focused {
@apply select-auto; @apply select-auto;
@apply outline-none; @apply outline-none #{!important};
.cm-activeLine { .cm-activeLine {
@apply bg-primaryLight; @apply bg-primaryLight;

View File

@@ -6,16 +6,17 @@
@close="hideModal" @close="hideModal"
> >
<template #body> <template #body>
<p class="px-2 mb-8 text-secondaryLight"> <p class="px-2 mb-4 text-secondaryLight">
{{ t("app.developer_option_description") }} {{ t("app.developer_option_description") }}
</p> </p>
<div class="flex flex-1"> <div class="flex flex-1">
<button class="share-link" @click="copyUserAuthToken"> <ButtonSecondary
<component :is="copyIcon" /> outline
<span> filled
{{ t("app.copy_user_id") }} :icon="copyIcon"
</span> :label="t('app.copy_user_id')"
</button> @click="copyUserAuthToken"
/>
</div> </div>
</template> </template>
</SmartModal> </SmartModal>
@@ -65,29 +66,3 @@ const hideModal = () => {
emit("hide-modal") emit("hide-modal")
} }
</script> </script>
<style lang="scss" scoped>
.share-link {
@apply border border-dividerLight;
@apply rounded;
@apply flex;
@apply p-3;
@apply items-center;
@apply justify-center;
@apply font-semibold;
@apply hover: (bg-primaryLight text-secondaryDark);
@apply focus: outline-none;
@apply focus-visible: border-divider;
svg {
@apply opacity-80;
@apply mr-2;
}
&:hover {
svg {
@apply opacity-100;
}
}
}
</style>

View File

@@ -139,7 +139,12 @@
/> />
<div <div
class="flex px-4 py-2 opacity-50" class="flex px-4 py-2 opacity-50"
@dblclick="showDeveloperOptionModal()" @dblclick="
() => {
showDeveloperOptionModal()
hide()
}
"
> >
{{ `${t("app.name")} v${version}` }} {{ `${t("app.name")} v${version}` }}
</div> </div>
@@ -271,7 +276,6 @@ const chatWithUs = () => {
const showDeveloperOptionModal = () => { const showDeveloperOptionModal = () => {
if (currentUser.value) { if (currentUser.value) {
showDeveloperOptions.value = true showDeveloperOptions.value = true
options.value.tippy().hide()
} }
} }

View File

@@ -13,7 +13,7 @@
v-model="filterText" v-model="filterText"
type="search" type="search"
autocomplete="off" autocomplete="off"
class="flex px-4 py-2 border rounded bg-primaryLight border-dividerLight focus-visible:border-divider" class="flex px-4 py-2 border rounded bg-primaryContrast border-dividerLight focus-visible:border-divider"
:placeholder="`${t('action.search')}`" :placeholder="`${t('action.search')}`"
/> />
</div> </div>

View File

@@ -7,7 +7,7 @@
@keydown.esc="close()" @keydown.esc="close()"
> >
<div <div
class="absolute inset-0 bg-primaryLight opacity-90" class="absolute inset-0 bg-primaryLight opacity-90 focus:outline-none"
tabindex="0" tabindex="0"
@click="close()" @click="close()"
></div> ></div>

View File

@@ -23,13 +23,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="addNewCollection" @click="addNewCollection"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,13 +23,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="addFolder" @click="addFolder"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -21,13 +21,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="addRequest" @click="addRequest"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,13 +23,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="saveCollection" @click="saveCollection"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,13 +23,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="editFolder" @click="editFolder"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,13 +23,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="loadingState" :loading="loadingState"
outline
@click="saveRequest" @click="saveRequest"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -43,9 +43,18 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="`${t('action.save')}`" @click="saveRequestAs" /> <ButtonPrimary
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> :label="`${t('action.save')}`"
outline
@click="saveRequestAs"
/>
<ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,12 +23,17 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="`${t('action.save')}`" :label="`${t('action.save')}`"
outline
@click="addNewCollection" @click="addNewCollection"
/> />
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> <ButtonSecondary
:label="`${t('action.cancel')}`"
outline
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,9 +23,14 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="t('action.save')" @click="addFolder" /> <ButtonPrimary :label="t('action.save')" outline @click="addFolder" />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,9 +23,14 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="t('action.save')" @click="addRequest" /> <ButtonPrimary :label="t('action.save')" outline @click="addRequest" />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,9 +23,18 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="`${t('action.save')}`" @click="saveCollection" /> <ButtonPrimary
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> :label="`${t('action.save')}`"
outline
@click="saveCollection"
/>
<ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,9 +23,18 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="`${t('action.save')}`" @click="editFolder" /> <ButtonPrimary
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> :label="`${t('action.save')}`"
outline
@click="editFolder"
/>
<ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -23,9 +23,18 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary :label="`${t('action.save')}`" @click="saveRequest" /> <ButtonPrimary
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> :label="`${t('action.save')}`"
outline
@click="saveRequest"
/>
<ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -73,6 +73,7 @@
<ButtonSecondary <ButtonSecondary
:label="t('add.new')" :label="t('add.new')"
filled filled
outline
@click="displayModalAdd(true)" @click="displayModalAdd(true)"
/> />
</div> </div>

View File

@@ -128,12 +128,14 @@
:label="t('add.new')" :label="t('add.new')"
class="mb-4" class="mb-4"
filled filled
outline
/> />
<ButtonSecondary <ButtonSecondary
v-else v-else
:label="t('add.new')" :label="t('add.new')"
filled filled
class="mb-4" class="mb-4"
outline
@click="displayModalAdd(true)" @click="displayModalAdd(true)"
/> />
</div> </div>

View File

@@ -101,12 +101,18 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="`${t('action.save')}`" :label="`${t('action.save')}`"
outline
@click="saveEnvironment" @click="saveEnvironment"
/> />
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> <ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -109,6 +109,7 @@
:label="`${t('add.new')}`" :label="`${t('add.new')}`"
filled filled
class="mb-4" class="mb-4"
outline
@click="displayModalAdd(true)" @click="displayModalAdd(true)"
/> />
</div> </div>

View File

@@ -34,7 +34,7 @@
v-model="searchQuery" v-model="searchQuery"
type="search" type="search"
autocomplete="off" autocomplete="off"
class="flex w-full p-4 py-2 !bg-popover input" class="flex w-full p-4 py-2 input !bg-primaryContrast"
:placeholder="`${t('action.search')}`" :placeholder="`${t('action.search')}`"
/> />
</div> </div>
@@ -94,13 +94,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="`${t('action.copy')}`" :label="`${t('action.copy')}`"
:icon="copyIcon" :icon="copyIcon"
outline
@click="copyRequestCode" @click="copyRequestCode"
/> />
<ButtonSecondary :label="`${t('action.dismiss')}`" @click="hideModal" /> <ButtonSecondary
:label="`${t('action.dismiss')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -14,19 +14,26 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
ref="importButton" ref="importButton"
:label="`${t('import.title')}`" :label="`${t('import.title')}`"
outline
@click="handleImport" @click="handleImport"
/> />
<ButtonSecondary :label="`${t('action.cancel')}`" @click="hideModal" /> <ButtonSecondary
:label="`${t('action.cancel')}`"
outline
filled
@click="hideModal"
/>
</span> </span>
<span class="flex"> <span class="flex">
<ButtonSecondary <ButtonSecondary
:icon="pasteIcon" :icon="pasteIcon"
:label="`${t('action.paste')}`" :label="`${t('action.paste')}`"
filled filled
outline
@click="handlePaste" @click="handlePaste"
/> />
</span> </span>

View File

@@ -7,25 +7,31 @@
@close="hideModal" @close="hideModal"
> >
<template #body> <template #body>
<div class="flex flex-col"> <div class="flex flex-col items-center justify-center">
<label>
{{ t("confirm.request_change") }} {{ t("confirm.request_change") }}
</label>
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
v-focus v-focus
:label="t('action.save')" :label="t('action.save')"
outline
@click="saveApiChange" @click="saveApiChange"
/> />
<ButtonSecondary <ButtonSecondary
:label="t('action.dont_save')" :label="t('action.dont_save')"
outline
filled
@click="discardApiChange" @click="discardApiChange"
/> />
</span> </span>
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</template> </template>
</SmartModal> </SmartModal>
</template> </template>

View File

@@ -132,8 +132,11 @@
</template> </template>
</tippy> </tippy>
</span> </span>
<span
class="flex ml-2 border rounded border-dividerLight hover:border-dividerDark transition"
>
<ButtonSecondary <ButtonSecondary
class="flex-1 ml-2 rounded rounded-r-none" class="flex-1 rounded rounded-r-none"
:label="COLUMN_LAYOUT ? `${t('request.save')}` : ''" :label="COLUMN_LAYOUT ? `${t('request.save')}` : ''"
filled filled
:icon="IconSave" :icon="IconSave"
@@ -161,7 +164,7 @@
name="request-name" name="request-name"
type="text" type="text"
autocomplete="off" autocomplete="off"
class="mb-2 input" class="mb-2 input !bg-primaryContrast"
@keyup.enter="hide()" @keyup.enter="hide()"
/> />
<div <div
@@ -207,6 +210,7 @@
</template> </template>
</tippy> </tippy>
</span> </span>
</span>
</div> </div>
<HttpImportCurl <HttpImportCurl
:text="curlText" :text="curlText"

View File

@@ -18,7 +18,7 @@
v-model="searchQuery" v-model="searchQuery"
type="search" type="search"
autocomplete="off" autocomplete="off"
class="flex w-full p-4 py-2 !bg-popover input" class="flex w-full p-4 py-2 input !bg-primaryContrast"
:placeholder="`${t('action.search')}`" :placeholder="`${t('action.search')}`"
/> />
</div> </div>

View File

@@ -13,14 +13,20 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
v-focus v-focus
:label="yes ?? t('action.yes')" :label="yes ?? t('action.yes')"
:loading="!!loadingState" :loading="!!loadingState"
outline
@click="resolve" @click="resolve"
/> />
<ButtonSecondary :label="no ?? t('action.no')" @click="hideModal" /> <ButtonSecondary
:label="no ?? t('action.no')"
filled
outline
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -18,7 +18,7 @@
@mousedown="!dialog ? close() : null" @mousedown="!dialog ? close() : null"
> >
<div <div
class="absolute inset-0 opacity-80 bg-primaryLight" class="absolute inset-0 opacity-80 bg-primaryLight focus:outline-none"
tabindex="0" tabindex="0"
@click="!dialog ? close() : null" @click="!dialog ? close() : null"
></div> ></div>

View File

@@ -18,13 +18,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="isLoading" :loading="isLoading"
outline
@click="addNewTeam" @click="addNewTeam"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -176,13 +176,19 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<span class="flex"> <span class="flex space-x-2">
<ButtonPrimary <ButtonPrimary
:label="t('action.save')" :label="t('action.save')"
:loading="isLoading" :loading="isLoading"
outline
@click="saveTeam" @click="saveTeam"
/> />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>

View File

@@ -294,8 +294,8 @@
v-if="sendInvitesResult.length" v-if="sendInvitesResult.length"
class="flex justify-between flex-1 text-secondaryLight" class="flex justify-between flex-1 text-secondaryLight"
> >
<SmartAnchor <ButtonSecondary
class="link" class="link !p-0"
:label="t('team.invite_more')" :label="t('team.invite_more')"
:icon="IconArrowLeft" :icon="IconArrowLeft"
@click=" @click="
@@ -310,15 +310,20 @@
} }
" "
/> />
<SmartAnchor <ButtonSecondary
class="link" class="link !p-0"
:label="`${t('action.dismiss')}`" :label="`${t('action.dismiss')}`"
@click="hideModal" @click="hideModal"
/> />
</p> </p>
<span v-else> <span v-else class="flex space-x-2">
<ButtonPrimary :label="t('team.invite')" @click="sendInvites" /> <ButtonPrimary :label="t('team.invite')" outline @click="sendInvites" />
<ButtonSecondary :label="t('action.cancel')" @click="hideModal" /> <ButtonSecondary
:label="t('action.cancel')"
outline
filled
@click="hideModal"
/>
</span> </span>
</template> </template>
</SmartModal> </SmartModal>