Fix some broken social icons in frontend and admin
This commit is contained in:
@@ -3,7 +3,7 @@ import { Typography, Table, Button, Modal, Input } from 'antd';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import { CaretDownOutlined, CaretUpOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { SocialDropdown } from './SocialDropdown';
|
||||
import { fetchData, SOCIAL_PLATFORMS_LIST, NEXT_PUBLIC_API_HOST } from '../../utils/apis';
|
||||
import { fetchData, SOCIAL_PLATFORMS_LIST } from '../../utils/apis';
|
||||
import { ServerStatusContext } from '../../utils/server-status-context';
|
||||
import {
|
||||
API_SOCIAL_HANDLES,
|
||||
@@ -212,12 +212,10 @@ export const EditSocialLinks: FC = () => {
|
||||
);
|
||||
}
|
||||
const { icon, platform: platformName } = platformInfo;
|
||||
const iconUrl = `${NEXT_PUBLIC_API_HOST}${icon.slice(1)}`;
|
||||
|
||||
return (
|
||||
<div className="social-handle-cell">
|
||||
<span className="option-icon">
|
||||
<img src={iconUrl} alt="" className="option-icon" />
|
||||
<img src={icon} alt="" className="option-icon" />
|
||||
</span>
|
||||
<p className="option-label">
|
||||
<strong>{platformName}</strong>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { FC } from 'react';
|
||||
import { Select } from 'antd';
|
||||
import { SocialHandleDropdownItem } from '../../types/config-section';
|
||||
import { NEXT_PUBLIC_API_HOST } from '../../utils/apis';
|
||||
import { OTHER_SOCIAL_HANDLE_OPTION } from '../../utils/config-constants';
|
||||
|
||||
export type DropdownProps = {
|
||||
@@ -39,12 +38,11 @@ export const SocialDropdown: FC<DropdownProps> = ({ iconList, selectedOption, on
|
||||
>
|
||||
{iconList.map(item => {
|
||||
const { platform, icon, key } = item;
|
||||
const iconUrl = `${NEXT_PUBLIC_API_HOST}${icon.slice(1)}`;
|
||||
|
||||
return (
|
||||
<Select.Option className="social-option" key={`platform-${key}`} value={key}>
|
||||
<span className="option-icon">
|
||||
<img src={iconUrl} alt="" className="option-icon" />
|
||||
<img src={icon} alt="" className="option-icon" />
|
||||
</span>
|
||||
<span className="option-label">{platform}</span>
|
||||
</Select.Option>
|
||||
|
||||
@@ -17,7 +17,12 @@ export const SocialLinks: FC<SocialLinksProps> = ({ links }) => (
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<img src={link.icon} alt={link.platform} title={link.platform} className={styles.link} />
|
||||
<img
|
||||
src={link.icon || '/img/platformlogos/default.svg'}
|
||||
alt={link.platform}
|
||||
title={link.platform}
|
||||
className={styles.link}
|
||||
/>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user