Skip to content

Commit 8309cbe

Browse files
committed
sort button update
1 parent 5da274a commit 8309cbe

File tree

1 file changed

+8
-33
lines changed

1 file changed

+8
-33
lines changed

frontend/src/components/shared/Sort.vue

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,13 @@
11
<template>
22
<!-- eslint-disable max-len -->
3-
<div class="inline-block focus:outline-none">
4-
<div v-bind:class="{'flex': true, 'items-center': true, 'justify-center': true, 'w-20': true, 'h-12': true, 'rounded-xl': true, 'border': true, 'border-gray-matcha': !closed, 'border-gray-300': closed, 'px-4': true, 'py-2': true, 'focus:outline-none': true, 'cursor-pointer': true}" @click="toggle" @focusout="close" tabindex="0">
5-
<img v-bind:class="{ 'opacity-50': closed, 'h-8': true, }" src="../../assets/sort.png">
3+
<div class="focus:outline-none flex-1 sm:flex-none" @focusout="close" tabindex="0">
4+
<div v-bind:class="{'sort-button': true, 'border-gray-matcha': !closed}" @click="toggle">
5+
<!-- <img v-bind:class="{ 'opacity-50': closed, 'noSelect': true }" src="../../assets/sort.png">-->
6+
<h1 v-bind:class="{ 'opacity-50': closed, 'noSelect': true, 'capitalize': true }">↑↓</h1>
67
</div>
7-
<div v-bind:class="{
8-
'w-56': true,
9-
'h-56': true,
10-
'mt-4': true,
11-
'overflow-scroll': true,
12-
'rounded-md': true,
13-
'shadow-2xl': true,
14-
'absolute': true,
15-
'rounded-md': true,
16-
'bg-white': true,
17-
'hidden': closed}">
18-
<h1
19-
v-for="(option, index) in options"
20-
:key="option + index + option"
21-
v-bind:class="{
22-
'cursor-pointer': true,
23-
'block': true,
24-
'pl-4': true,
25-
'border-b': index !== options.length - 1,
26-
'border-gray-300': index !== options.length - 1,
27-
'py-4': true,
28-
'text-sm': true,
29-
'leading-5': true,
30-
'text-gray-700': true,
31-
'hover:bg-gray-100': true,
32-
'hover:text-gray-900': true,
33-
'focus:outline-none': true,
34-
'focus:bg-gray-100': true,
35-
'focus:text-gray-900': true}"
8+
<div v-bind:class="{'sort-dropdown': true, 'hidden': closed}">
9+
<h1 v-for="(option, index) in options" :key="option + index + option"
10+
v-bind:class="{'sort-dropdown-option': true, 'border-b': index !== options.length - 1}"
3611
v-on:click="select(option)">
3712
{{option}}
3813
</h1>
@@ -49,7 +24,7 @@ export default {
4924
methods: {
5025
select(option) {
5126
this.closed = true;
52-
this.$emit('sort', this.name, option);
27+
this.$emit('sort', option);
5328
},
5429
toggle() {
5530
this.closed = !this.closed;

0 commit comments

Comments
 (0)