You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.6 KiB

2 years ago
tag app-link
def render
2 years ago
<self
@pointerover=api.set_link_selection_index(index)
2 years ago
@click=handle_click
.selected=(index is state.link_selection_index)
2 years ago
>
2 years ago
css d:flex fld:row jc:space-between ai:center
px:16px py:11px rd:5px cursor:pointer c:blue3
2 years ago
<.link-left>
css d:flex fl:1
2 years ago
<img.link-icon src=link.icon>
2 years ago
css w:20px h:20px mr:10px rd:3px
2 years ago
<.display-name [c:#FAD4AB]=link.is_bang> link.display_name
2 years ago
css tt:capitalize fs:20px overflow-wrap:anywhere
2 years ago
if link.display_name isnt link.name and config.data.enable_effective_names
2 years ago
<.name>
css d:flex ja:center c:gray4 ml:10px fs:14px
css .parens fs:10px c:gray4/80
2 years ago
2 years ago
<span.parens> "("
<span> link.name
2 years ago
<span.parens> ")"
2 years ago
2 years ago
<.link-right>
css d:flex fld:row jc:space-between ai:center
css .buttons-disabled .link-button visibility:hidden
css .selected .link-button visibility:visible
2 years ago
2 years ago
<.link-buttons .buttons-disabled=!config.data.enable_buttons>
css d:flex fld:row jc:flex-start ai:center pr:25px gap:5px
css .link-button visibility:hidden rd:3px c:purple4 fs:15px cursor:pointer px:3px
css .link-button svg w:15px
2 years ago
2 years ago
<.link-button@click.prevent.stop=handle_click_edit(link)>
<svg src='../assets/edit-2.svg'>
2 years ago
2 years ago
<.link-button@click.prevent.stop=handle_click_delete(link)>
<svg src='../assets/trash.svg'>
2 years ago
2 years ago
<.link-button
@click.prevent.stop=handle_click_pin(link)
[visibility:visible c:purple3/50]=(link.is_pinned and (index isnt state.link_selection_index or not config.data.enable_buttons))
2 years ago
> <svg src='../assets/star.svg'>
2 years ago
<.frequency> link.frequency
2 years ago
css fs:15px ml:7px