Create dropdown component and update language selection with API
This commit is contained in:
parent
c689cd13c2
commit
b09a551121
1 changed files with 23 additions and 0 deletions
23
src/components/Dropdown.astro
Normal file
23
src/components/Dropdown.astro
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
const { Name, OnClick } = Astro.props
|
||||
---
|
||||
|
||||
<div class="tr-dropdown">
|
||||
<a style="cursor: pointer;" onclick={OnClick} id={Name + '-dropdown-button'}>{Name}</a>
|
||||
<div style="display: none;" id={Name + '-dropdown-menu'} class="comp-dropdown">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.comp-dropdown {
|
||||
position: absolute;
|
||||
background: #0d0d0d;
|
||||
border-radius: 6px;
|
||||
border: 2px #464646 solid;
|
||||
width: max-content;
|
||||
a {
|
||||
padding: 12px 48px 12px 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in a new issue