Add route name to document title

This commit is contained in:
Jonathan Staab 2023-03-03 14:57:49 -06:00
parent 6802b411e2
commit e90170d3de
17 changed files with 37 additions and 2 deletions

View File

@ -80,6 +80,8 @@ export const displayPerson = p => {
}
}
export const displayRelay = ({url}) => last(url.split('://'))
export const isLike = content => ['', '+', '🤙', '👍', '❤️', '😎', '🏅'].includes(content)
export const isAlert = (e, pubkey) => {

View File

@ -4,6 +4,8 @@
import {logs} from 'src/util/logger.js'
import {formatTimestamp} from 'src/util/misc'
import Content from 'src/partials/Content.svelte'
document.title = "Debug"
</script>
<Content>

View File

@ -30,6 +30,8 @@
return navigate("/login")
}
})
document.title = 'Keys'
</script>
<div in:fly={{y: 20}}>

View File

@ -32,6 +32,8 @@
publishWithToast(getUserWriteRelays(), cmd.updateUser(values))
navigate(routes.person(user.getPubkey(), 'profile'))
}
document.title = "Profile"
</script>
<form on:submit={submit} in:fly={{y: 20}}>

View File

@ -25,6 +25,8 @@
toast.show("info", "Your settings have been saved!")
}
document.title = "Settings"
</script>
<form on:submit={submit} in:fly={{y: 20}}>

View File

@ -15,6 +15,8 @@
let notes = null
onMount(() => {
document.title = "Notifications"
lastChecked.update(assoc('alerts', now()))
return createScroller(async () => {

View File

@ -46,6 +46,8 @@
return event
}
document.title = $room.name
lastChecked.update(updateIn(assoc(id, now())))
</script>

View File

@ -20,6 +20,7 @@
$: search = fuzzy($otherRooms, {keys: ['name', 'about']})
$: results = search(q).slice(0, 50)
document.title = 'Chat'
onMount(() => {
const sub = network.listen({

View File

@ -25,6 +25,8 @@
const pubkeyLogIn = () => {
modal.set({type: 'login/pubkey'})
}
document.title = "Log In"
</script>
<div in:fly={{y: 20}}>

View File

@ -20,6 +20,8 @@
window.location.href = '/login'
}, 1000)
}
document.title = "Log Out"
</script>
<Content size="lg" class="text-center">

View File

@ -68,6 +68,8 @@
// Return unencrypted content so we can display it immediately
return {...event, content}
}
document.title = `DMs with ${displayPerson($person)}`
</script>
<Channel {loadMessages} {listenForMessages} {sendMessage}>

View File

@ -20,6 +20,8 @@
const getDisplay = tab =>
({title: toTitle(tab), badge: getContacts(tab).length})
document.title = 'Direct Messages'
</script>
<Content>

View File

@ -1,5 +1,6 @@
<script>
import {navigate} from 'svelte-routing'
import {toTitle} from 'hurdak/lib/hurdak'
import Anchor from "src/partials/Anchor.svelte"
import Content from "src/partials/Content.svelte"
import Tabs from "src/partials/Tabs.svelte"
@ -11,6 +12,8 @@
export let activeTab
const setActiveTab = tab => navigate(`/notes/${tab}`)
document.title = toTitle(activeTab)
</script>
<Content>

View File

@ -69,6 +69,8 @@
onMount(async () => {
log('Person', npub, person)
document.title = displayPerson(person)
// Refresh our person
network.loadPeople([pubkey], {force: true}).then(() => {
person = database.getPersonWithFallback(pubkey)

View File

@ -1,7 +1,8 @@
<script lang="ts">
import {last, find, propEq} from 'ramda'
import {find, propEq} from 'ramda'
import {onMount} from 'svelte'
import {poll, stringToColor} from "src/util/misc"
import {displayRelay} from "src/util/nostr"
import {between} from 'hurdak/lib/hurdak'
import Content from "src/partials/Content.svelte"
import Anchor from "src/partials/Anchor.svelte"
@ -35,6 +36,8 @@
}
})
})
document.title = displayRelay(relay)
</script>
<Content>
@ -44,7 +47,7 @@
<span
class="border-b border-solid"
style={`border-color: ${stringToColor(relay.url)}`}>
{last(relay.url.split('://'))}
{displayRelay(relay)}
</span>
<span
on:mouseout={() => {showStatus = false}}

View File

@ -8,6 +8,8 @@
import {modal} from "src/app/ui"
const {relays} = user
document.title = 'Relays'
</script>
<div in:fly={{y: 20}}>

View File

@ -8,6 +8,8 @@
export let activeTab
const setActiveTab = tab => navigate(`/search/${tab}`)
document.title = "Search"
</script>
<Content>