Skip to content

Commit ef1da79

Browse files
committed
refactor: tweaks
1 parent 51bb531 commit ef1da79

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

plugins/search/plugin-docsearch/src/client/utils/getSearchButtonTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const getSearchButtonTemplate = ({
1212
buttonText = 'Search',
1313
buttonAriaLabel = buttonText,
1414
}: DocSearchTranslation['button'] = {}): string => {
15-
const isApple = __VUEPRESS_SSR__ ? false : isMacOS() || isiPad() || isiPhone()
15+
const isApple = !__VUEPRESS_SSR__ && (isMacOS() || isiPad() || isiPhone())
1616

1717
return `<button type="button" aria-label="${buttonAriaLabel}" aria-keyshortcuts="${isApple ? 'Command' : 'Control'}+k" class="DocSearch DocSearch-Button"><span class="DocSearch-Button-Container"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" class="DocSearch-Search-Icon"><circle cx="11" cy="11" r="8" stroke="currentColor" fill="none" stroke-width="1.4"></circle><path d="m21 21-4.3-4.3" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">${buttonText}</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key ${isApple ? '' : 'DocSearch-Button-Key--ctrl'}">${isApple ? '⌘' : 'Ctrl'}</kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button>`
1818
}

themes/theme-default/src/client/composables/useSidebarItems.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ export const setupSidebarItems = (): void => {
187187
const headers = useHeaders()
188188
const routePath = useRoutePath()
189189

190-
const sidebarConfig = computed<SidebarOptions | false>(() =>
191-
frontmatter.value.home
192-
? false
193-
: ((frontmatter.value as DefaultThemeNormalPageFrontmatter).sidebar ??
190+
const sidebarConfig = computed<SidebarOptions | false>(
191+
() =>
192+
!frontmatter.value.home &&
193+
((frontmatter.value as DefaultThemeNormalPageFrontmatter).sidebar ??
194194
themeLocale.value.sidebar ??
195195
'heading'),
196196
)

tools/shiki-twoslash/src/client/enhanceTwoslash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import 'floating-vue/dist/style.css'
2323
* ```
2424
*/
2525
export const enhanceTwoslash = (app: App): void => {
26-
const isMobileDevice = __VUEPRESS_SSR__ ? false : isMobile()
26+
const isMobileDevice = !__VUEPRESS_SSR__ && isMobile()
2727

2828
if (!__VUEPRESS_SSR__) {
2929
// Recompute poppers when clicking on a tab

0 commit comments

Comments
 (0)