mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 00:38:49 +01:00
Better copy to differentiate poll created vs voted
This commit is contained in:
parent
3bee69dc84
commit
9f9395d965
1 changed files with 13 additions and 1 deletions
|
@ -9,6 +9,7 @@ import Loader from '../components/loader';
|
||||||
import NameText from '../components/name-text';
|
import NameText from '../components/name-text';
|
||||||
import Status from '../components/status';
|
import Status from '../components/status';
|
||||||
import states from '../utils/states';
|
import states from '../utils/states';
|
||||||
|
import store from '../utils/store';
|
||||||
import useTitle from '../utils/useTitle';
|
import useTitle from '../utils/useTitle';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -34,6 +35,8 @@ const contentText = {
|
||||||
follow_request: 'requested to follow you.',
|
follow_request: 'requested to follow you.',
|
||||||
favourite: 'favourited your status.',
|
favourite: 'favourited your status.',
|
||||||
poll: 'A poll you have voted in or created has ended.',
|
poll: 'A poll you have voted in or created has ended.',
|
||||||
|
'poll-self': 'A poll you have created has ended.',
|
||||||
|
'poll-voted': 'A poll you have voted in has ended.',
|
||||||
update: 'A status you interacted with has been edited.',
|
update: 'A status you interacted with has been edited.',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,6 +48,15 @@ function Notification({ notification }) {
|
||||||
// status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update
|
// status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update
|
||||||
const actualStatusID = status?.reblog?.id || status?.id;
|
const actualStatusID = status?.reblog?.id || status?.id;
|
||||||
|
|
||||||
|
const currentAccount = store.session.get('currentAccount');
|
||||||
|
const isSelf = currentAccount?.id === account.id;
|
||||||
|
const isVoted = status?.poll?.voted;
|
||||||
|
|
||||||
|
const text =
|
||||||
|
type === 'poll'
|
||||||
|
? contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll']
|
||||||
|
: contentText[type];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
@ -75,7 +87,7 @@ function Notification({ notification }) {
|
||||||
<NameText account={account} showAvatar />{' '}
|
<NameText account={account} showAvatar />{' '}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{contentText[type]}
|
{text}
|
||||||
</p>
|
</p>
|
||||||
{status && (
|
{status && (
|
||||||
<Link class="status-link" href={`#/s/${actualStatusID}`}>
|
<Link class="status-link" href={`#/s/${actualStatusID}`}>
|
||||||
|
|
Loading…
Reference in a new issue