Fix icons.

new-frontend
Icedream 2023-01-09 04:02:23 +01:00
parent d41809eafa
commit bff84738f2
Signed by: icedream
GPG Key ID: 468BBEEBB9EC6AEA
6 changed files with 25 additions and 14 deletions

View File

@ -23,6 +23,7 @@ import Button from 'react-bootstrap/Button';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Overlay, Tooltip } from 'react-bootstrap'; import { Overlay, Tooltip } from 'react-bootstrap';
import type { IconProp } from '@fortawesome/fontawesome-svg-core'; import type { IconProp } from '@fortawesome/fontawesome-svg-core';
import { faCopy, faShare } from '@fortawesome/free-solid-svg-icons';
import { FormattedMessage } from './localization'; import { FormattedMessage } from './localization';
function CopyField({ function CopyField({
@ -60,7 +61,7 @@ function CopyField({
icon icon
? ( ? (
<InputGroup.Text> <InputGroup.Text>
<FontAwesomeIcon icon="share" /> <FontAwesomeIcon icon={faShare} />
</InputGroup.Text> </InputGroup.Text>
) )
: '' : ''
@ -86,7 +87,7 @@ function CopyField({
} }
CopyField.defaultProps = { CopyField.defaultProps = {
copyIcon: 'copy', copyIcon: faCopy,
icon: null, icon: null,
}; };

View File

@ -16,6 +16,7 @@
*/ */
import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { IconProp } from '@fortawesome/fontawesome-svg-core';
import { faDownload } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react'; import React from 'react';
import { Button } from 'react-bootstrap'; import { Button } from 'react-bootstrap';
@ -34,6 +35,7 @@ export default function DownloadButton({
return ( return (
<Button variant="success" href={getDownloadURL(id, fileName)}> <Button variant="success" href={getDownloadURL(id, fileName)}>
<FontAwesomeIcon icon={icon} className="mr-2" /> <FontAwesomeIcon icon={icon} className="mr-2" />
{' '}
<FormattedMessage <FormattedMessage
id="DownloadButton.download" id="DownloadButton.download"
defaultMessage="Download" defaultMessage="Download"
@ -44,5 +46,5 @@ export default function DownloadButton({
} }
DownloadButton.defaultProps = { DownloadButton.defaultProps = {
icon: 'download', icon: faDownload,
}; };

View File

@ -1,3 +1,6 @@
import {
faFacebook, faTwitch, faTwitter, faYoutube,
} from '@fortawesome/free-brands-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import * as React from 'react'; import * as React from 'react';
import { RunnerInformation } from 'util/datatypes/RunnerList'; import { RunnerInformation } from 'util/datatypes/RunnerList';
@ -11,27 +14,27 @@ export default function Runner({ runner }: { runner: RunnerInformation }) {
<sup> <sup>
{runner.platform === 'TWITCH' && runner.stream.length > 0 ? ( {runner.platform === 'TWITCH' && runner.stream.length > 0 ? (
<a href={runner.stream}> <a href={runner.stream}>
<FontAwesomeIcon icon={['fab', 'twitch']} className={['mr-1', style.twitch].join(' ')} /> <FontAwesomeIcon icon={faTwitch} className={['mr-1', style.twitch].join(' ')} />
</a> </a>
) : ''} ) : ''}
{runner.platform === 'FACEBOOK' && runner.stream.length > 0 ? ( {runner.platform === 'FACEBOOK' && runner.stream.length > 0 ? (
<a href={runner.stream}> <a href={runner.stream}>
<FontAwesomeIcon icon={['fab', 'facebook']} className={['mr-1', style.facebook].join(' ')} /> <FontAwesomeIcon icon={faFacebook} className={['mr-1', style.facebook].join(' ')} />
</a> </a>
) : ''} ) : ''}
{runner.platform === 'YOUTUBE' && runner.stream.length > 0 ? ( {runner.platform === 'YOUTUBE' && runner.stream.length > 0 ? (
<a href={runner.stream}> <a href={runner.stream}>
<FontAwesomeIcon icon={['fab', 'youtube']} className={['mr-1', style.youtube].join(' ')} /> <FontAwesomeIcon icon={faYoutube} className={['mr-1', style.youtube].join(' ')} />
</a> </a>
) : ''} ) : ''}
{runner.twitter && runner.twitter.length > 0 ? ( {runner.twitter && runner.twitter.length > 0 ? (
<a href={`https://twitter.com/${runner.twitter}`}> <a href={`https://twitter.com/${runner.twitter}`}>
<FontAwesomeIcon icon={['fab', 'twitter']} className={['mr-1', style.twitter].join(' ')} /> <FontAwesomeIcon icon={faTwitter} className={['mr-1', style.twitter].join(' ')} />
</a> </a>
) : ''} ) : ''}
{runner.youtube && runner.youtube.length > 0 ? ( {runner.youtube && runner.youtube.length > 0 ? (
<a href={`https://youtube.com/${runner.youtube}`}> <a href={`https://youtube.com/${runner.youtube}`}>
<FontAwesomeIcon icon={['fab', 'youtube']} className={['mr-1', style.youtube].join(' ')} /> <FontAwesomeIcon icon={faYoutube} className={['mr-1', style.youtube].join(' ')} />
</a> </a>
) : ''} ) : ''}
</sup> </sup>

View File

@ -24,6 +24,7 @@ import ListGroup from 'react-bootstrap/ListGroup';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { injectIntl, IntlShape } from 'react-intl'; import { injectIntl, IntlShape } from 'react-intl';
import { RunnerList } from 'util/datatypes/RunnerList'; import { RunnerList } from 'util/datatypes/RunnerList';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
import VideoListItem from './VideoListItem'; import VideoListItem from './VideoListItem';
import Filter from './Filter'; import Filter from './Filter';
import { VideoEntry } from '../util/datatypes/VideoList'; import { VideoEntry } from '../util/datatypes/VideoList';
@ -70,7 +71,7 @@ class VideoList extends React.Component<VideoListProps, VideoListState> {
<div> <div>
<InputGroup> <InputGroup>
<InputGroup.Text id="search-prepend"> <InputGroup.Text id="search-prepend">
<FontAwesomeIcon icon="search" /> <FontAwesomeIcon icon={faSearch} />
</InputGroup.Text> </InputGroup.Text>
<FormControl <FormControl
placeholder={intl.formatMessage({ id: 'VideoList.Search.Placeholder', defaultMessage: 'Type something to search here…' })} placeholder={intl.formatMessage({ id: 'VideoList.Search.Placeholder', defaultMessage: 'Type something to search here…' })}

View File

@ -27,6 +27,7 @@ import Link from 'next/link';
import { RunInformation, Thumbnails } from 'util/datatypes/VideoList'; import { RunInformation, Thumbnails } from 'util/datatypes/VideoList';
import { Runner as RunnerData, RunnerList } from 'util/datatypes/RunnerList'; import { Runner as RunnerData, RunnerList } from 'util/datatypes/RunnerList';
import { Col, Row } from 'react-bootstrap'; import { Col, Row } from 'react-bootstrap';
import { faClock, faHourglass, faRunning } from '@fortawesome/free-solid-svg-icons';
import { getThumbnailURL } from '../util/thumbnail'; import { getThumbnailURL } from '../util/thumbnail';
import FormattedDuration from './localization/FormattedDuration'; import FormattedDuration from './localization/FormattedDuration';
@ -132,7 +133,7 @@ export default function VideoListItem({
<Col sm={5} xs={12}> <Col sm={5} xs={12}>
{runners && runners.length > 0 ? ( {runners && runners.length > 0 ? (
<div className="mr-2"> <div className="mr-2">
<FontAwesomeIcon icon="running" /> <FontAwesomeIcon icon={faRunning} />
{' '} {' '}
{runners.reduce((all: Array<ReactElement>, runner: RunnerData) => [ {runners.reduce((all: Array<ReactElement>, runner: RunnerData) => [
...all, ...all,
@ -143,7 +144,7 @@ export default function VideoListItem({
) : ''} ) : ''}
{displayDuration !== null ? ( {displayDuration !== null ? (
<span className="mr-2 text-nowrap"> <span className="mr-2 text-nowrap">
<FontAwesomeIcon icon="clock" /> <FontAwesomeIcon icon={faClock} />
{' '} {' '}
<FormattedDuration <FormattedDuration
seconds={displayDuration} seconds={displayDuration}
@ -153,7 +154,7 @@ export default function VideoListItem({
</span> </span>
) : ( ) : (
<span className="mr-2 text-nowrap"> <span className="mr-2 text-nowrap">
<FontAwesomeIcon icon="hourglass" /> <FontAwesomeIcon icon={faHourglass} />
{' '} {' '}
Coming up Coming up
</span> </span>

View File

@ -33,6 +33,7 @@ import { basename } from 'path';
import withSession from 'util/session'; import withSession from 'util/session';
import { ParsedUrlQuery } from 'querystring'; import { ParsedUrlQuery } from 'querystring';
import YouTubePlayer from 'react-youtube'; import YouTubePlayer from 'react-youtube';
import { faTwitch, faYoutube } from '@fortawesome/free-brands-svg-icons';
import { getDASHManifestURL, getHLSMasterURL } from '../../util'; import { getDASHManifestURL, getHLSMasterURL } from '../../util';
import VideoPlayer from '../../components/VideoPlayer'; import VideoPlayer from '../../components/VideoPlayer';
@ -351,7 +352,8 @@ export default function VideoPlayerPage({
variant="twitch" variant="twitch"
key="watchOnTwitch" key="watchOnTwitch"
> >
<FontAwesomeIcon icon={['fab', 'twitch']} className="mr-2" /> <FontAwesomeIcon icon={faTwitch} className="mr-2" />
{' '}
<FormattedMessage <FormattedMessage
id="VideoPlayerPage.watchOnTwitch" id="VideoPlayerPage.watchOnTwitch"
description="Button below video that links to the exact position in the archived stream to watch it there." description="Button below video that links to the exact position in the archived stream to watch it there."
@ -402,7 +404,8 @@ export default function VideoPlayerPage({
variant="youtube" variant="youtube"
key="watchOnYouTube" key="watchOnYouTube"
> >
<FontAwesomeIcon icon={['fab', 'youtube']} className="mr-2" /> <FontAwesomeIcon icon={faYoutube} className="mr-2" />
{' '}
<FormattedMessage <FormattedMessage
id="VideoPlayerPage.watchOnYouTube" id="VideoPlayerPage.watchOnYouTube"
description="Button below video that links user to the YouTube upload of the VOD." description="Button below video that links user to the YouTube upload of the VOD."