bump-with-link

This commit is contained in:
Untone 2024-02-16 14:29:27 +03:00
parent e5ce4585fd
commit 6451118e90
3 changed files with 17 additions and 4 deletions

View File

@ -329,7 +329,7 @@
"Show more": "Show more", "Show more": "Show more",
"Show table of contents": "Show table of contents", "Show table of contents": "Show table of contents",
"Show": "Show", "Show": "Show",
"Sign in to see the voters": "Sign in to see the voters", "to see the voters": "to see the voters",
"Site search": "Site search", "Site search": "Site search",
"Slug": "Slug", "Slug": "Slug",
"Social networks": "Social networks", "Social networks": "Social networks",

View File

@ -351,7 +351,7 @@
"Show more": "Читать дальше", "Show more": "Читать дальше",
"Show table of contents": "Показать главление", "Show table of contents": "Показать главление",
"Show": "Показать", "Show": "Показать",
"Sign in to see the voters": "Войдите, чтобы видеть кто голосует", "to see the voters": "чтобы видеть кто голосует",
"Site search": "Поиск по сайту", "Site search": "Поиск по сайту",
"Slug": "Постоянная ссылка", "Slug": "Постоянная ссылка",
"Social networks": "Социальные сети", "Social networks": "Социальные сети",

View File

@ -11,6 +11,7 @@ import { Icon } from '../_shared/Icon'
import { Popup } from '../_shared/Popup' import { Popup } from '../_shared/Popup'
import { VotersList } from '../_shared/VotersList' import { VotersList } from '../_shared/VotersList'
import { useRouter } from '../../stores/router'
import stylesComment from './CommentRatingControl.module.scss' import stylesComment from './CommentRatingControl.module.scss'
import stylesShout from './ShoutRatingControl.module.scss' import stylesShout from './ShoutRatingControl.module.scss'
@ -22,7 +23,8 @@ interface RatingControlProps {
} }
export const RatingControl = (props: RatingControlProps) => { export const RatingControl = (props: RatingControlProps) => {
const { t } = useLocalize() const { t, lang } = useLocalize()
const { changeSearchParams } = useRouter()
const { author, requireAuthentication } = useSession() const { author, requireAuthentication } = useSession()
const { createReaction, deleteReaction, loadReactionsBy } = useReactions() const { createReaction, deleteReaction, loadReactionsBy } = useReactions()
const [isLoading, setIsLoading] = createSignal(false) const [isLoading, setIsLoading] = createSignal(false)
@ -151,7 +153,18 @@ export const RatingControl = (props: RatingControlProps) => {
</Show> </Show>
</button> </button>
<Popup trigger={getTrigger()} variant="tiny"> <Popup trigger={getTrigger()} variant="tiny">
<Show when={author()} fallback={t('Sign in to see the voters')}> <Show
when={author()}
fallback={
<>
<span class="link" onClick={() => changeSearchParams({ mode: 'login' })}>
{t('Enter')}
</span>
{lang() === 'ru' ? ', ' : ' '}
{t('to see the voters')}
</>
}
>
<VotersList <VotersList
reactions={ratings()} reactions={ratings()}
fallbackMessage={isLoading() ? t('Loading') : t('No one rated yet')} fallbackMessage={isLoading() ? t('Loading') : t('No one rated yet')}