diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index 4b4a526..87028f5 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -44,6 +44,9 @@ const ERRORS: Record = { exchange_failed: 'Could not complete the connection. Please try again.', } +/** Where the page's own code lives; linked from the footer. */ +const SOURCE_URL = 'https://github.com/roboloop/only-dashboard' + const syncNote = computed(() => { if (session.loading || !session.fetchedAt) return 'syncing…' return `synced ${relativeTime(session.fetchedAt, now.value)} ago` @@ -104,8 +107,14 @@ async function disconnect(id: ProviderId) { - @@ -171,6 +180,20 @@ async function disconnect(id: ProviderId) { margin: 26px 26px 0; padding-top: 22px; border-top: 1px solid var(--border-rule); + display: flex; + align-items: center; + justify-content: space-between; +} + +.source { + font: 500 var(--fs-micro) / 1 var(--font-sans); + letter-spacing: 0.06em; + color: var(--text-dim); + text-decoration: none; +} + +.source:hover { + color: var(--accent); } .signout { diff --git a/src/views/__tests__/DashboardView.spec.ts b/src/views/__tests__/DashboardView.spec.ts index 73985b4..52f0221 100644 --- a/src/views/__tests__/DashboardView.spec.ts +++ b/src/views/__tests__/DashboardView.spec.ts @@ -111,6 +111,17 @@ describe('DashboardView', () => { expect(wrapper.findAll('a.dashboard')).toHaveLength(1) }) + it('links to the source repository even with nothing connected', async () => { + stubApi([providerState()]) + const wrapper = await mountView() + + const link = wrapper.get('a.source') + expect(link.attributes('href')).toBe('https://github.com/roboloop/only-dashboard') + expect(link.attributes('target')).toBe('_blank') + expect(link.text()).toContain('SOURCE') + expect(wrapper.text()).not.toContain('SIGN OUT') + }) + it('pre-fills the title input with the current shared title', async () => { stubApi([providerState({ connected: true, streamTitle: 'Current title' })]) const wrapper = await mountView()