|
1 | | -import { Component, h, Prop, State } from '@stencil/core'; |
| 1 | +import { Component, h, Host, Prop, State } from '@stencil/core'; |
2 | 2 | import state from '../store'; |
3 | 3 |
|
4 | 4 | @Component({ |
@@ -28,36 +28,39 @@ export class MenuDropDown { |
28 | 28 |
|
29 | 29 | render() { |
30 | 30 | return ( |
31 | | - <div class="relative"> |
| 31 | + <Host class="relative w-full py-2"> |
32 | 32 | {/* Header */} |
33 | | - <h2 onClick={() => this.toggleDropdown()} class="font-sans text-gray-600 hover:text-indigo-800 cursor-pointer transition text-sm capitalize flex gap-1 items-center"> |
| 33 | + {/* <h2 onClick={() => this.toggleDropdown()} class="font-sans text-gray-600 hover:text-indigo-800 cursor-pointer transition text-sm capitalize flex gap-1 items-center"> |
34 | 34 | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> |
35 | 35 | <path |
36 | 36 | stroke-linecap="round" |
37 | 37 | stroke-linejoin="round" |
38 | 38 | d="M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z" |
39 | 39 | /> |
40 | 40 | </svg> |
41 | | - </h2> |
| 41 | + </h2> */} |
| 42 | + <div onClick={() => this.toggleDropdown()} class='w-full pl-3 cursor-pointer'> |
| 43 | + {this.listTitle} |
| 44 | + </div> |
42 | 45 | <backdrop-filter showBackDrop={this.showDropdown} backDropHandler={this.backDropHandler}></backdrop-filter> |
43 | 46 | {/* List */} |
44 | 47 | <div |
45 | 48 | id="dropdownDefaultButton" |
46 | 49 | data-dropdown-toggle="dropdown" |
47 | 50 | style={{ right: '0px' }} |
48 | | - class={this.showDropdown ? 'absolute bg-white z-10 w-44 text-sm list-none mt-2 rounded divide-y right-0 divide-gray-100 shadow ' : 'hidden'} |
| 51 | + class={this.showDropdown ? 'absolute bg-gray-300 z-50 w-44 text-sm list-none mt-2 rounded-md divide-y -bottom-1 right-0 divide-gray-100 shadow ' : 'hidden'} |
49 | 52 | > |
50 | | - <ul id="dropdown" class="py-1 bg-white"> |
| 53 | + <ul id="dropdown" class="py-1 bg-gray-300 rounded-b-md"> |
51 | 54 | {this.list?.map(item => ( |
52 | 55 | <li> |
53 | | - <a href="#" onClick={() => this.buttonHandler(this.listTitle)} class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100"> |
| 56 | + <a href="#" onClick={() => this.buttonHandler(this.listTitle)} class="block py-1 px-4 text-sm text-gray-700 cursor-pointer"> |
54 | 57 | {item} |
55 | 58 | </a> |
56 | 59 | </li> |
57 | 60 | ))} |
58 | 61 | </ul> |
59 | 62 | </div> |
60 | | - </div> |
| 63 | + </Host> |
61 | 64 | ); |
62 | 65 | } |
63 | 66 | } |
0 commit comments