Add custom support link

This commit is contained in:
Justin 2022-08-22 13:23:37 -04:00
parent 18afb586fa
commit 347897cd9d
1 changed files with 33 additions and 22 deletions

View File

@ -7,6 +7,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { getSettings } from 'soapbox/actions/settings';
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
import Blurhash from 'soapbox/components/blurhash';
import Icon from 'soapbox/components/icon';
import StillImage from 'soapbox/components/still_image';
@ -263,9 +264,14 @@ class Item extends React.PureComponent {
}
const mapStateToMediaGalleryProps = state => ({
const mapStateToMediaGalleryProps = state => {
const { links } = getSoapboxConfig(state);
return {
displayMedia: getSettings(state).get('displayMedia'),
});
links,
};
};
export default @connect(mapStateToMediaGalleryProps)
@injectIntl
@ -285,6 +291,7 @@ class MediaGallery extends React.PureComponent {
onToggleVisibility: PropTypes.func,
displayMedia: PropTypes.string,
compact: PropTypes.bool,
links: ImmutablePropTypes.map,
};
static defaultProps = {
@ -568,7 +575,7 @@ class MediaGallery extends React.PureComponent {
}
render() {
const { media, intl, sensitive, compact, inReview } = this.props;
const { media, intl, sensitive, compact, inReview, links } = this.props;
const { visible } = this.state;
const sizeData = this.getSizeData(media.size);
@ -638,6 +645,8 @@ class MediaGallery extends React.PureComponent {
<Text theme='white' size='sm' weight='medium'>
{summary}
{links.get('support') && (
<>
{' '}
<FormattedMessage
id='status.in_review_summary.contact'
@ -646,7 +655,7 @@ class MediaGallery extends React.PureComponent {
link: (
<a
className='underline text-inherit'
href='/hello'
href={links.get('support')}
>
<FormattedMessage
id='status.in_review_summary.link'
@ -656,6 +665,8 @@ class MediaGallery extends React.PureComponent {
),
}}
/>
</>
)}
</Text>
</div>