Add support for some specific placeholders for correct social urls

This commit is contained in:
Gabe Kangas 2021-02-03 15:16:33 -08:00
parent 53cf80282e
commit 38a20d022d

View file

@ -42,6 +42,11 @@ export default function EditSocialLinks() {
let resetTimer = null; let resetTimer = null;
const PLACEHOLDERS = {
'mastodon': 'https://mastodon.social/@username',
'twitter': 'https://twitter.com/username'
}
const getAvailableIcons = async () => { const getAvailableIcons = async () => {
try { try {
const result = await fetchData(SOCIAL_PLATFORMS_LIST, { auth: false }); const result = await fetchData(SOCIAL_PLATFORMS_LIST, { auth: false });
@ -267,7 +272,7 @@ export default function EditSocialLinks() {
<TextField <TextField
fieldName="social-url" fieldName="social-url"
label="URL" label="URL"
placeholder="Url to page" placeholder={PLACEHOLDERS[modalDataState.platform] || 'Url to page'}
value={modalDataState.url} value={modalDataState.url}
onChange={handleUrlChange} onChange={handleUrlChange}
/> />