Add custom support link

This commit is contained in:
Justin 2022-08-22 13:23:37 -04:00
parent 18afb586fa
commit 347897cd9d

View file

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