mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
help-beta: Add KeyboardTip component.
We also add unplugin types to tsconfig.json. We didn't need them before since those types were not used in any astro components and were used in mdx files directly instead. We have an open PR to the upstream starlight repository to add support for custom icons in the Aside starlight component. The PR is stalled due to dependency on some of the custom icons work being done on starlight. We should replace the code below with the Aside starlight component along with a custom icon (keyboard in out case). Not linking it directly to avoid necessary mentions on the original PR whenever this commit is pushed. The PR number is 2261 in https://github.com/withastro/starlight.
This commit is contained in:
committed by
Tim Abbott
parent
231cae594e
commit
9d9b0c01fc
25
help-beta/src/components/KeyboardTip.astro
Normal file
25
help-beta/src/components/KeyboardTip.astro
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
import ZulipIconsKeyboard from "~icons/zulip-icon/keyboard"
|
||||
|
||||
let { title } = Astro.props;
|
||||
if (!title) {
|
||||
title = "Keyboard Shortcut";
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
We have an open PR to the upstream starlight repository to add support
|
||||
for custom icons in the Aside starlight component. The PR is stalled
|
||||
due to dependency on some of the custom icons work being done on
|
||||
starlight. We should replace the code below with the Aside starlight
|
||||
component along with a custom icon (keyboard in out case).
|
||||
Link: https://github.com/withastro/starlight/pull/2261
|
||||
-->
|
||||
<aside aria-label={title} class={`starlight-aside starlight-aside--tip`}>
|
||||
<p class="starlight-aside__title" aria-hidden="true">
|
||||
<ZulipIconsKeyboard class="starlight-aside__icon" />{title}
|
||||
</p>
|
||||
<div class="starlight-aside__content">
|
||||
<slot />
|
||||
</div>
|
||||
</aside>
|
||||
@@ -26,5 +26,7 @@
|
||||
|
||||
/* Projects */
|
||||
"composite": true,
|
||||
|
||||
"types": ["unplugin-icons/types/astro"],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user