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.
Replace new-style upstream CWs with old-style CWs for now
- Loading branch information
1 parent
0d26c9f
commit 4d75493
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
26 changes: 18 additions & 8 deletions
26
app/javascript/flavours/glitch/components/content_warning.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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
import { StatusBanner, BannerVariant } from './status_banner'; | ||
/* Significantly rewritten from upstream to keep the old design for now */ | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
|
||
export const ContentWarning: React.FC<{ | ||
text: string; | ||
expanded?: boolean; | ||
onClick?: () => void; | ||
}> = ({ text, expanded, onClick }) => ( | ||
<StatusBanner | ||
expanded={expanded} | ||
onClick={onClick} | ||
variant={BannerVariant.Yellow} | ||
> | ||
<p dangerouslySetInnerHTML={{ __html: text }} /> | ||
</StatusBanner> | ||
<p> | ||
<span dangerouslySetInnerHTML={{ __html: text }} className='translate' />{' '} | ||
<button | ||
type='button' | ||
className='status__content__spoiler-link' | ||
onClick={onClick} | ||
aria-expanded={expanded} | ||
> | ||
{expanded ? ( | ||
<FormattedMessage id='status.show_less' defaultMessage='Show less' /> | ||
) : ( | ||
<FormattedMessage id='status.show_more' defaultMessage='Show more' /> | ||
)} | ||
</button> | ||
</p> | ||
); |
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