Use patternfly icons instead of own SVGs (#4402)
This commit is contained in:
parent
2089d7c2e7
commit
361f9c93c0
6 changed files with 8 additions and 45 deletions
|
@ -1 +0,0 @@
|
||||||
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="bitbucket" class="svg-inline--fa fa-bitbucket fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M22.2 32A16 16 0 0 0 6 47.8a26.35 26.35 0 0 0 .2 2.8l67.9 412.1a21.77 21.77 0 0 0 21.3 18.2h325.7a16 16 0 0 0 16-13.4L505 50.7a16 16 0 0 0-13.2-18.3 24.58 24.58 0 0 0-2.8-.2L22.2 32zm285.9 297.8h-104l-28.1-147h157.3l-25.2 147z"></path></svg>
|
|
Before Width: | Height: | Size: 464 B |
|
@ -1 +0,0 @@
|
||||||
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="instagram" class="svg-inline--fa fa-instagram fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg>
|
|
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1 +0,0 @@
|
||||||
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="windows" class="svg-inline--fa fa-windows fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"></path></svg>
|
|
Before Width: | Height: | Size: 369 B |
|
@ -1 +0,0 @@
|
||||||
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="paypal" class="svg-inline--fa fa-paypal fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M111.4 295.9c-3.5 19.2-17.4 108.7-21.5 134-.3 1.8-1 2.5-3 2.5H12.3c-7.6 0-13.1-6.6-12.1-13.9L58.8 46.6c1.5-9.6 10.1-16.9 20-16.9 152.3 0 165.1-3.7 204 11.4 60.1 23.3 65.6 79.5 44 140.3-21.5 62.6-72.5 89.5-140.1 90.3-43.4.7-69.5-7-75.3 24.2zM357.1 152c-1.8-1.3-2.5-1.8-3 1.3-2 11.4-5.1 22.5-8.8 33.6-39.9 113.8-150.5 103.9-204.5 103.9-6.1 0-10.1 3.3-10.9 9.4-22.6 140.4-27.1 169.7-27.1 169.7-1 7.1 3.5 12.9 10.6 12.9h63.5c8.6 0 15.7-6.3 17.4-14.9.7-5.4-1.1 6.1 14.4-91.3 4.6-22 14.3-19.7 29.3-19.7 71 0 126.4-28.8 142.9-112.3 6.5-34.8 4.6-71.4-23.8-92.6z"></path></svg>
|
|
Before Width: | Height: | Size: 785 B |
|
@ -1,18 +1,20 @@
|
||||||
import {
|
import {
|
||||||
|
BitbucketIcon,
|
||||||
CubeIcon,
|
CubeIcon,
|
||||||
FacebookSquareIcon,
|
FacebookSquareIcon,
|
||||||
GithubIcon,
|
GithubIcon,
|
||||||
GitlabIcon,
|
GitlabIcon,
|
||||||
GoogleIcon,
|
GoogleIcon,
|
||||||
|
InstagramIcon,
|
||||||
LinkedinIcon,
|
LinkedinIcon,
|
||||||
|
MicrosoftIcon,
|
||||||
OpenshiftIcon,
|
OpenshiftIcon,
|
||||||
|
PaypalIcon,
|
||||||
StackOverflowIcon,
|
StackOverflowIcon,
|
||||||
TwitterIcon,
|
TwitterIcon,
|
||||||
} from "@patternfly/react-icons";
|
} from "@patternfly/react-icons";
|
||||||
import type { SVGIconProps } from "@patternfly/react-icons/dist/js/createIcon";
|
import type { SVGIconProps } from "@patternfly/react-icons/dist/js/createIcon";
|
||||||
|
|
||||||
import { FontAwesomeIcon } from "./icons/FontAwesomeIcon";
|
|
||||||
|
|
||||||
type ProviderIconMapperProps = {
|
type ProviderIconMapperProps = {
|
||||||
provider: { [index: string]: string };
|
provider: { [index: string]: string };
|
||||||
};
|
};
|
||||||
|
@ -39,10 +41,13 @@ export const ProviderIconMapper = ({ provider }: ProviderIconMapperProps) => {
|
||||||
case "twitter":
|
case "twitter":
|
||||||
return <TwitterIcon {...defaultProps} />;
|
return <TwitterIcon {...defaultProps} />;
|
||||||
case "microsoft":
|
case "microsoft":
|
||||||
|
return <MicrosoftIcon {...defaultProps} />;
|
||||||
case "bitbucket":
|
case "bitbucket":
|
||||||
|
return <BitbucketIcon {...defaultProps} />;
|
||||||
case "instagram":
|
case "instagram":
|
||||||
|
return <InstagramIcon {...defaultProps} />;
|
||||||
case "paypal":
|
case "paypal":
|
||||||
return <FontAwesomeIcon icon={provider.id} />;
|
return <PaypalIcon {...defaultProps} />;
|
||||||
default:
|
default:
|
||||||
return <CubeIcon {...defaultProps} />;
|
return <CubeIcon {...defaultProps} />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import environment from "../../environment";
|
|
||||||
|
|
||||||
type FontAwesomeIconProps = {
|
|
||||||
icon: "bitbucket" | "microsoft" | "instagram" | "paypal";
|
|
||||||
};
|
|
||||||
|
|
||||||
export const FontAwesomeIcon = ({ icon }: FontAwesomeIconProps) => {
|
|
||||||
const styles = { style: { height: "2em", width: "2em" } };
|
|
||||||
switch (icon) {
|
|
||||||
case "bitbucket":
|
|
||||||
return (
|
|
||||||
<img
|
|
||||||
src={environment.resourceUrl + "/bitbucket-brands.svg"}
|
|
||||||
{...styles}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "microsoft":
|
|
||||||
return (
|
|
||||||
<img
|
|
||||||
src={environment.resourceUrl + "/microsoft-brands.svg"}
|
|
||||||
{...styles}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "instagram":
|
|
||||||
return (
|
|
||||||
<img
|
|
||||||
src={environment.resourceUrl + "/instagram-brands.svg"}
|
|
||||||
{...styles}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "paypal":
|
|
||||||
return (
|
|
||||||
<img src={environment.resourceUrl + "/paypal-brands.svg"} {...styles} />
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
Reference in a new issue