Added rel Button attribute + fixed mastodon verification (#262)

Co-authored-by: Kali <git@kalitsune.cloud>
This commit is contained in:
-ˏˋ Maple ˊˎ 2022-11-06 19:22:10 +01:00 committed by GitHub
parent 15123676ec
commit 9a1d328f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import { trackMatomoEvent } from '../../analytics/matomo';
import { addShadow } from '../../utils'; import { addShadow } from '../../utils';
function Button(props) { function Button(props) {
const { name, href, displayName, logo, styles, alt, icon } = props; const { name, href, displayName, logo, styles, alt, icon, rels } = props;
const handleClick = () => { const handleClick = () => {
const eventName = `${name}-button`; const eventName = `${name}-button`;
@ -30,7 +30,7 @@ function Button(props) {
className={(styles ? 'button' : `button button-${name}`) + addShadow()} className={(styles ? 'button' : `button button-${name}`) + addShadow()}
href={href} href={href}
target={runtimeConfig?.BUTTON_TARGET || '_blank'} target={runtimeConfig?.BUTTON_TARGET || '_blank'}
rel="noopener noreferrer" rel={rels ? rels : 'noopener noreferrer'}
onClick={handleClick} onClick={handleClick}
style={styles ? styles : undefined} style={styles ? styles : undefined}
title={alt || displayName} title={alt || displayName}
@ -59,4 +59,5 @@ Button.propType = {
logo: string, logo: string,
icon: string, icon: string,
styles: object, styles: object,
rels: string,
}; };

View File

@ -410,6 +410,7 @@ function Home(props) {
<Button <Button
name="mastodon" name="mastodon"
href={runtimeConfig.MASTODON} href={runtimeConfig.MASTODON}
rels="me noopener noreferrer"
displayName="Mastodon" displayName="Mastodon"
logo={mastodonLogo} logo={mastodonLogo}
order={buttonOrder('MASTODON')} order={buttonOrder('MASTODON')}