Skip to content

Commit

Permalink
feat: add logo to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed May 15, 2024
1 parent 64b45d4 commit 7fa0965
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
15 changes: 9 additions & 6 deletions components/IconPreview.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<script setup lang="ts">
defineProps<{
value: string
}>()
withDefaults(
defineProps<{
value: string
size?: string
}>(),
{ size: '1.2em' },
)
</script>

<template>
<img
v-if="value.startsWith('https://')"
:src="value"
w="1.2em"
h="1.2em"
:style="{ width: size, height: size }"
object-contain
/>
<div v-else :class="value" />
<div v-else :class="value" :style="{ width: size, height: size }" />
</template>
2 changes: 1 addition & 1 deletion components/ParserOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function handleDialogClick(evt: MouseEvent) {
p0
@click="handleDialogClick"
>
<div relative flex items-center justify-center py2 text-lg font-bold>
<div relative flex items-center justify-center gap1 py2 text-lg font-bold>
Parser Options
<button
class="i-ri:close-line"
Expand Down
11 changes: 7 additions & 4 deletions components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { currentParserGui as ParserGui } from '~/composables/language'
</script>

<template>
<div border-r p2>
<h2 flex="~ gap1" mb3 items-center justify-center text-lg font-bold>
<div flex="~ col" items-center gap2 border-r p2>
<div>
<IconPreview :value="currentParser.icon" size="5em" />
</div>
<h2 flex items-center justify-center gap2 text-lg font-bold>
Parser Options
<ParserOptions v-if="currentParser.options.configurable" />
</h2>
<template v-if="ParserGui">
<div v-if="ParserGui" w-full>
<ParserGui />
</template>
</div>
</div>
</template>

0 comments on commit 7fa0965

Please sign in to comment.