Skip to content

Commit 0cf8fc8

Browse files
committed
Add cffinit logo on the top left side with a link to the landing page
1 parent 855b102 commit 0cf8fc8

3 files changed

Lines changed: 36 additions & 10 deletions

File tree

cypress/e2e/navigation.cy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ const advancedStepNames = [
1212
const allStepNames = [...basicStepNames, ...advancedStepNames]
1313

1414
describe('App navigation', () => {
15+
it('should be able to go back through the logo button', () => {
16+
cy.visit('/start')
17+
cy.dataCy('btn-logo')
18+
.click()
19+
cy.url().then((e) => expect(e.endsWith('#/')).to.be.true)
20+
})
1521
describe('during basic mode', () => {
1622
it(`should have ${basicStepNames.length + 1} steps on stepper`, () => {
1723
cy.visit('/start')

src/components/Header.vue

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
<template>
2-
<span class="spacer" />
3-
<q-btn-group flat>
2+
<q-toolbar>
3+
<q-btn
4+
aria-label="Back to landing page"
5+
class="q-py-sm"
6+
data-cy="btn-logo"
7+
flat
8+
id="btn-logo"
9+
v-on:click="goHome"
10+
>
11+
<img
12+
alt=""
13+
height="40"
14+
src="~assets/cff-logo.svg"
15+
>
16+
</q-btn>
17+
<q-space />
418
<q-btn
5-
color=""
619
flat
720
href="https://github.com/citation-file-format/cff-initializer-javascript/issues"
821
icon-right="ion-logo-github"
@@ -23,25 +36,32 @@
2336
/>
2437
<q-btn
2538
class="lt-lg gt-xs"
39+
flat
2640
icon="menu"
2741
v-on:click="$emit('togglePreview')"
2842
>
2943
Preview
3044
</q-btn>
31-
</q-btn-group>
45+
</q-toolbar>
3246
</template>
3347

3448
<script lang="ts">
3549
import { defineComponent } from 'vue'
50+
import { useRouter } from 'vue-router'
3651
3752
export default defineComponent({
3853
name: 'Header',
39-
emits: ['togglePreview']
54+
emits: ['togglePreview'],
55+
setup () {
56+
const router = useRouter()
57+
return {
58+
goHome: async () => {
59+
await router.push({ path: '/' })
60+
}
61+
}
62+
}
4063
})
4164
</script>
4265

4366
<style scoped>
44-
.spacer {
45-
flex-grow: 1;
46-
}
4767
</style>

src/css/app.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ body {
1717
}
1818

1919
#header-inner {
20-
background-color: purple;
21-
color: white;
20+
background-color: #fdfdfd;
21+
color: black;
2222
display: flex;
2323
flex-direction: row;
2424
height: 50px;

0 commit comments

Comments
 (0)