Skip to content

Commit

Permalink
[Dashboard] Replace Unity icon (thirdweb-dev#4814)
Browse files Browse the repository at this point in the history
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on replacing instances of the `SiUnity` icon from the `react-icons` library with a new custom `UnityIcon` component across multiple files in the dashboard application.

### Detailed summary
- Added a new `UnityIcon` component in `UnityIcon.tsx`.
- Replaced `SiUnity` with `UnityIcon` in:
  - `ConnectSDKCard.tsx`
  - `ConnectPlaygroundButton.tsx`
  - `CodeOptionButton.tsx`
  - `SupportedPlatformLink.tsx`
  - `CodeSegment.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
kien-ngo committed Sep 27, 2024
1 parent 43a24e2 commit bc348ea
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Icon } from "@chakra-ui/react";
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
import { JavaScriptIcon } from "components/icons/brand-icons/JavaScriptIcon";
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
import { useTrack } from "hooks/analytics/useTrack";
import type { Dispatch, ReactNode, SetStateAction } from "react";
import { Button } from "tw-components";
Expand All @@ -20,7 +20,7 @@ const LOGO_OPTIONS = {
fill: "#61dafb",
},
unity: {
icon: SiUnity,
icon: UnityIcon,
fill: "#ffffff",
},
} as const;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ButtonGroup, Flex, Icon, Stack } from "@chakra-ui/react";
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
import { JavaScriptIcon } from "components/icons/brand-icons/JavaScriptIcon";
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
import { type Dispatch, type SetStateAction, useMemo } from "react";
import { Button, CodeBlock } from "tw-components";
import type { ComponentWithChildren } from "types/component-with-children";
Expand Down Expand Up @@ -40,7 +40,7 @@ const Environments: SupportedEnvironment[] = [
{
environment: "unity",
title: "Unity",
icon: SiUnity,
icon: UnityIcon,
colorScheme: "purple",
},
];
Expand Down
18 changes: 18 additions & 0 deletions apps/dashboard/src/components/icons/brand-icons/UnityIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { SVGProps } from "react";

export const UnityIcon = (props: SVGProps<SVGSVGElement>) => {
return (
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
width={24}
height={24}
{...props}
>
<title>Unity</title>
<path d="m12.9288 4.2939 3.7997 2.1929c.1366.077.1415.2905 0 .3675l-4.515 2.6076a.4192.4192 0 0 1-.4246 0L7.274 6.8543c-.139-.0745-.1415-.293 0-.3675l3.7972-2.193V0L1.3758 5.5977V16.793l3.7177-2.1456v-4.3858c-.0025-.1565.1813-.2682.318-.1838l4.5148 2.6076a.4252.4252 0 0 1 .2136.3676v5.2127c.0025.1565-.1813.2682-.3179.1838l-3.7996-2.1929-3.7178 2.1457L12 24l9.6954-5.5977-3.7178-2.1457-3.7996 2.1929c-.1341.082-.3229-.0248-.3179-.1838V13.053c0-.1565.087-.2956.2136-.3676l4.5149-2.6076c.134-.082.3228.0224.3179.1838v4.3858l3.7177 2.1456V5.5977L12.9288 0Z" />
</svg>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Icon } from "@chakra-ui/react";
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
import { JavaScriptIcon } from "components/icons/brand-icons/JavaScriptIcon";
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
import { useTrack } from "hooks/analytics/useTrack";
import type { Dispatch, SetStateAction } from "react";
import { flushSync } from "react-dom";
Expand All @@ -21,7 +21,7 @@ export const LOGO_OPTIONS = {
fill: "#61dafb",
},
unity: {
icon: SiUnity,
icon: UnityIcon,
fill: "#ffffff",
},
} as const;
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/components/shared/ConnectSDKCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
import Link from "next/link";
import { SiUnrealengine } from "react-icons/si";
import { SiDotnet } from "react-icons/si";
Expand Down Expand Up @@ -36,7 +36,7 @@ export function ConnectSDKCard({
/>
<DocLink
link="https://portal.thirdweb.com/unity/v4/getting-started"
icon={SiUnity}
icon={UnityIcon}
label="Unity SDK"
/>
<DocLink
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { TrackedLinkTW } from "@/components/ui/tracked-link";
import { cn } from "@/lib/utils";
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";

export function SupportedPlatformLink(props: {
platform: "React" | "React Native" | "Unity" | "TypeScript";
Expand All @@ -12,7 +12,7 @@ export function SupportedPlatformLink(props: {
}) {
let icon = ReactIcon;
if (props.platform === "Unity") {
icon = SiUnity;
icon = UnityIcon;
} else if (props.platform === "TypeScript") {
icon = TypeScriptIcon;
}
Expand Down

0 comments on commit bc348ea

Please sign in to comment.