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 => {
const { links } = getSoapboxConfig(state);
return {
displayMedia: getSettings(state).get('displayMedia'), 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,6 +645,8 @@ 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 <FormattedMessage
id='status.in_review_summary.contact' id='status.in_review_summary.contact'
@ -646,7 +655,7 @@ class MediaGallery extends React.PureComponent {
link: ( link: (
<a <a
className='underline text-inherit' className='underline text-inherit'
href='/hello' href={links.get('support')}
> >
<FormattedMessage <FormattedMessage
id='status.in_review_summary.link' id='status.in_review_summary.link'
@ -656,6 +665,8 @@ class MediaGallery extends React.PureComponent {
), ),
}} }}
/> />
</>
)}
</Text> </Text>
</div> </div>