Skip to content

Commit

Permalink
chore(frontend): Upgrade to React 19 (All-Hands-AI#5835)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape authored Dec 27, 2024
1 parent 5ed80b5 commit 9d984aa
Show file tree
Hide file tree
Showing 25 changed files with 127 additions and 155 deletions.
11 changes: 5 additions & 6 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import { HomepageHeader } from "../components/HomepageHeader/HomepageHeader";
import { Welcome } from "../components/Welcome/Welcome";
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import { HomepageHeader } from '../components/HomepageHeader/HomepageHeader';
import { translate } from '@docusaurus/Translate';

export function Header({ title, summary }): JSX.Element {
return (
<div>
<h1>{title}</h1>
<h2 style={{ fontSize: "3rem" }}>{summary}</h2>
<h2 style={{ fontSize: '3rem' }}>{summary}</h2>
</div>
);
}
Expand All @@ -23,7 +22,7 @@ export default function Home(): JSX.Element {
message: 'Code Less, Make More',
})}
>
<HomepageHeader />
<HomepageHeader />
</Layout>
);
}
124 changes: 64 additions & 60 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": ">=20.0.0"
},
"dependencies": {
"@monaco-editor/react": "^4.6.0",
"@monaco-editor/react": "^4.7.0-rc.0",
"@nextui-org/react": "^2.6.10",
"@react-router/node": "^7.1.1",
"@react-router/serve": "^7.1.1",
Expand All @@ -27,8 +27,8 @@
"jose": "^5.9.4",
"monaco-editor": "^0.52.2",
"posthog-js": "^1.203.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-highlight": "^0.15.0",
"react-hot-toast": "^2.4.1",
"react-i18next": "^15.2.0",
Expand Down Expand Up @@ -83,8 +83,8 @@
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^22.10.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/react-highlight": "^0.12.8",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/ws": "^8.5.12",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/arrow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function ArrowIcon(): JSX.Element {
function ArrowIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/cog-tooth.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function CogTooth(): JSX.Element {
function CogTooth() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/confirm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function ConfirmIcon(): JSX.Element {
function ConfirmIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/pause.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function PauseIcon(): JSX.Element {
function PauseIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/play.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function PlayIcon(): JSX.Element {
function PlayIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/reject.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function RejectIcon(): JSX.Element {
function RejectIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/stop.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

function StopIcon(): JSX.Element {
function StopIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/extension-icon-map.constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
FaPython,
} from "react-icons/fa";

export const EXTENSION_ICON_MAP: Record<string, JSX.Element> = {
export const EXTENSION_ICON_MAP: Record<string, React.ReactNode> = {
js: <DiJavascript />,
ts: <DiJavascript />,
py: <FaPython />,
Expand Down
16 changes: 10 additions & 6 deletions frontend/src/components/features/context-menu/context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ import React from "react";
import { cn } from "#/utils/utils";

interface ContextMenuProps {
ref: React.RefObject<HTMLUListElement | null>;
testId?: string;
children: React.ReactNode;
className?: React.HTMLAttributes<HTMLUListElement>["className"];
}

export const ContextMenu = React.forwardRef<HTMLUListElement, ContextMenuProps>(
({ testId, children, className }, ref) => (
export function ContextMenu({
testId,
children,
className,
ref,
}: ContextMenuProps) {
return (
<ul
data-testid={testId}
ref={ref}
className={cn("bg-[#404040] rounded-md w-[224px]", className)}
>
{children}
</ul>
),
);

ContextMenu.displayName = "ContextMenu";
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface FolderIconProps {
isOpen: boolean;
}

export function FolderIcon({ isOpen }: FolderIconProps): JSX.Element {
export function FolderIcon({ isOpen }: FolderIconProps) {
return isOpen ? (
<FaFolderOpen color="D9D3D0" className="icon" />
) : (
Expand Down
Loading

0 comments on commit 9d984aa

Please sign in to comment.