Skip to content

Commit 7928be2

Browse files
committed
add client header
1 parent e108145 commit 7928be2

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

packages/clients/textLocator/src/addPlugins.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Scale from '@polar/plugin-scale'
1111
import Toast from '@polar/plugin-toast'
1212
import Zoom from '@polar/plugin-zoom'
1313

14+
import Header from './plugins/Header'
1415
import { searchCoastalGazetteer } from './search/coastalGazetteer'
1516
import { idRegister } from './services'
1617

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

2223
core.addPlugins([
24+
Header({
25+
displayComponent: true,
26+
layoutTag: NineLayoutTag.TOP_LEFT,
27+
}),
2328
IconMenu({
2429
displayComponent: true,
2530
// TODO fix, it's broken ...
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<h1 class="polar-plugin-header" lang="en">
3+
{{ $t('common:plugins.textLocator.header.text') }}
4+
&nbsp;
5+
<v-icon x-small color="white">fa-scroll</v-icon>
6+
<v-icon x-small color="white">fa-magnifying-glass</v-icon>
7+
</h1>
8+
</template>
9+
10+
<script lang="ts">
11+
import Vue from 'vue'
12+
13+
export default Vue.extend({
14+
name: 'TextLocatorHeader',
15+
})
16+
</script>
17+
18+
<style lang="scss" scoped>
19+
.polar-plugin-header {
20+
position: fixed;
21+
top: 0;
22+
left: 0;
23+
24+
display: flex;
25+
26+
pointer-events: all;
27+
28+
color: #ffffff;
29+
font-weight: initial;
30+
font-size: 0.8rem;
31+
background: #7d212b;
32+
border-radius: 0 0 10px 0;
33+
padding: 0.1em 2em 0.1em 0.5em;
34+
}
35+
</style>
36+
37+
<style lang="scss">
38+
/* TODO decide if required */
39+
.polar-plugin-address-search-toolbar {
40+
margin-top: 12px;
41+
}
42+
</style>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from 'vue'
2+
import { PluginOptions } from '@polar/lib-custom-types'
3+
import Header from './Header.vue'
4+
import language from './language'
5+
6+
export default (options: PluginOptions) => (instance: Vue) =>
7+
instance.$store.dispatch('addComponent', {
8+
name: 'header',
9+
plugin: Header,
10+
language,
11+
options,
12+
})
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { LanguageOption } from '@polar/lib-custom-types'
2+
3+
const lang: LanguageOption[] = [
4+
{
5+
type: 'de',
6+
resources: {
7+
plugins: {
8+
textLocator: {
9+
header: {
10+
// remove lang="en" in component if this becomes german
11+
text: 'TextLocator',
12+
},
13+
},
14+
},
15+
},
16+
},
17+
{
18+
type: 'en',
19+
resources: {
20+
plugins: {
21+
textLocator: {
22+
header: {
23+
text: 'TextLocator',
24+
},
25+
},
26+
},
27+
},
28+
},
29+
]
30+
31+
export default lang

0 commit comments

Comments
 (0)