forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2841 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to a021dee
- Loading branch information
Showing
64 changed files
with
501 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/javascript/flavours/glitch/components/status_thread_label.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import ReplyIcon from '@/material-icons/400-24px/reply.svg?react'; | ||
import { Icon } from 'flavours/glitch/components/icon'; | ||
import { DisplayedName } from 'flavours/glitch/features/notifications_v2/components/displayed_name'; | ||
import { useAppSelector } from 'flavours/glitch/store'; | ||
|
||
export const StatusThreadLabel: React.FC<{ | ||
accountId: string; | ||
inReplyToAccountId: string; | ||
}> = ({ accountId, inReplyToAccountId }) => { | ||
const inReplyToAccount = useAppSelector((state) => | ||
state.accounts.get(inReplyToAccountId), | ||
); | ||
|
||
let label; | ||
|
||
if (accountId === inReplyToAccountId) { | ||
label = ( | ||
<FormattedMessage | ||
id='status.continued_thread' | ||
defaultMessage='Continued thread' | ||
/> | ||
); | ||
} else if (inReplyToAccount) { | ||
label = ( | ||
<FormattedMessage | ||
id='status.replied_to' | ||
defaultMessage='Replied to {name}' | ||
values={{ name: <DisplayedName accountIds={[inReplyToAccountId]} /> }} | ||
/> | ||
); | ||
} else { | ||
label = ( | ||
<FormattedMessage | ||
id='status.replied_in_thread' | ||
defaultMessage='Replied in thread' | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<div className='status__prepend'> | ||
<div className='status__prepend__icon'> | ||
<Icon id='reply' icon={ReplyIcon} /> | ||
</div> | ||
{label} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/javascript/mastodon/components/status_thread_label.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import ReplyIcon from '@/material-icons/400-24px/reply.svg?react'; | ||
import { Icon } from 'mastodon/components/icon'; | ||
import { DisplayedName } from 'mastodon/features/notifications_v2/components/displayed_name'; | ||
import { useAppSelector } from 'mastodon/store'; | ||
|
||
export const StatusThreadLabel: React.FC<{ | ||
accountId: string; | ||
inReplyToAccountId: string; | ||
}> = ({ accountId, inReplyToAccountId }) => { | ||
const inReplyToAccount = useAppSelector((state) => | ||
state.accounts.get(inReplyToAccountId), | ||
); | ||
|
||
let label; | ||
|
||
if (accountId === inReplyToAccountId) { | ||
label = ( | ||
<FormattedMessage | ||
id='status.continued_thread' | ||
defaultMessage='Continued thread' | ||
/> | ||
); | ||
} else if (inReplyToAccount) { | ||
label = ( | ||
<FormattedMessage | ||
id='status.replied_to' | ||
defaultMessage='Replied to {name}' | ||
values={{ name: <DisplayedName accountIds={[inReplyToAccountId]} /> }} | ||
/> | ||
); | ||
} else { | ||
label = ( | ||
<FormattedMessage | ||
id='status.replied_in_thread' | ||
defaultMessage='Replied in thread' | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<div className='status__prepend'> | ||
<div className='status__prepend__icon'> | ||
<Icon id='reply' icon={ReplyIcon} /> | ||
</div> | ||
{label} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.