Skip to content

Commit

Permalink
add client header
Browse files Browse the repository at this point in the history
  • Loading branch information
warm-coolguy committed Feb 23, 2024
1 parent e108145 commit 7928be2
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/clients/textLocator/src/addPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Scale from '@polar/plugin-scale'
import Toast from '@polar/plugin-toast'
import Zoom from '@polar/plugin-zoom'

import Header from './plugins/Header'
import { searchCoastalGazetteer } from './search/coastalGazetteer'
import { idRegister } from './services'

Expand All @@ -20,6 +21,10 @@ export const addPlugins = (core) => {
setLayout(NineLayout)

core.addPlugins([
Header({
displayComponent: true,
layoutTag: NineLayoutTag.TOP_LEFT,
}),
IconMenu({
displayComponent: true,
// TODO fix, it's broken ...
Expand Down
42 changes: 42 additions & 0 deletions packages/clients/textLocator/src/plugins/Header/Header.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<h1 class="polar-plugin-header" lang="en">
{{ $t('common:plugins.textLocator.header.text') }}
&nbsp;
<v-icon x-small color="white">fa-scroll</v-icon>
<v-icon x-small color="white">fa-magnifying-glass</v-icon>
</h1>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
name: 'TextLocatorHeader',
})
</script>

<style lang="scss" scoped>
.polar-plugin-header {
position: fixed;
top: 0;
left: 0;
display: flex;
pointer-events: all;
color: #ffffff;
font-weight: initial;
font-size: 0.8rem;
background: #7d212b;
border-radius: 0 0 10px 0;
padding: 0.1em 2em 0.1em 0.5em;
}
</style>

<style lang="scss">
/* TODO decide if required */
.polar-plugin-address-search-toolbar {
margin-top: 12px;
}
</style>
12 changes: 12 additions & 0 deletions packages/clients/textLocator/src/plugins/Header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Vue from 'vue'
import { PluginOptions } from '@polar/lib-custom-types'
import Header from './Header.vue'
import language from './language'

export default (options: PluginOptions) => (instance: Vue) =>
instance.$store.dispatch('addComponent', {
name: 'header',
plugin: Header,
language,
options,
})
31 changes: 31 additions & 0 deletions packages/clients/textLocator/src/plugins/Header/language.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { LanguageOption } from '@polar/lib-custom-types'

const lang: LanguageOption[] = [
{
type: 'de',
resources: {
plugins: {
textLocator: {
header: {
// remove lang="en" in component if this becomes german
text: 'TextLocator',
},
},
},
},
},
{
type: 'en',
resources: {
plugins: {
textLocator: {
header: {
text: 'TextLocator',
},
},
},
},
},
]

export default lang

0 comments on commit 7928be2

Please sign in to comment.