Skip to content

πŸ™Œ OpenHands: AI-Driven Development

refactor(frontend): categorized css files into a separate folder (#298)

Renu0a4f7de215b7
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index d8389b7d23..a18315e091 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -58,7 +58,9 @@ function App(): JSX.Element {
<div className="right-pane">
<div className="navbar bg-base-100">
<div className="flex-1">
- <div className="btn btn-ghost text-xl xl:w-full xl:h-full h-1/2 w-1/2 ml-4">OpenDevin Workspace</div>
+ <div className="btn btn-ghost text-xl xl:w-full xl:h-full h-1/2 w-1/2 ml-4">
+ OpenDevin Workspace
+ </div>
</div>
<div className="flex">
<BannerSettings />
diff --git a/frontend/src/components/BannerSettings.css b/frontend/src/components/BannerSettings.css
deleted file mode 100644
index d1a1db1103..0000000000
--- a/frontend/src/components/BannerSettings.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.banner {
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 1rem;
-}
-
-select {
- padding: 0.5rem;
- border: 0;
- border-radius: 5px;
- font-size: 1rem;
-}
diff --git a/frontend/src/components/BannerSettings.tsx b/frontend/src/components/BannerSettings.tsx
index ed62937e9e..065b9f14f7 100644
--- a/frontend/src/components/BannerSettings.tsx
+++ b/frontend/src/components/BannerSettings.tsx
@@ -6,7 +6,7 @@ import {
changeModel,
fetchModels,
} from "../services/settingsService";
-import "./BannerSettings.css";
+import "./css/BannerSettings.css";
function ModelSelect(): JSX.Element {
const [models, setModels] = useState<string[]>(INITIAL_MODELS);
diff --git a/frontend/src/components/Browser.tsx b/frontend/src/components/Browser.tsx
index 3553ff28a6..51e41a51dd 100644
--- a/frontend/src/components/Browser.tsx
+++ b/frontend/src/components/Browser.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import "./Browser.css";
+import "./css/Browser.css";
import { useSelector } from "react-redux";
import { RootState } from "../store";
diff --git a/frontend/src/components/ChatInterface.tsx b/frontend/src/components/ChatInterface.tsx
index 55c1253f4b..8d3575266e 100644
--- a/frontend/src/components/ChatInterface.tsx
+++ b/frontend/src/components/ChatInterface.tsx
@@ -4,7 +4,7 @@ import assistantAvatar from "../assets/assistant-avatar.png";
import userAvatar from "../assets/user-avatar.png";
import { sendChatMessage } from "../services/chatService";
import { RootState } from "../store";
-import "./ChatInterface.css";
+import "./css/ChatInterface.css";
import { changeDirectory as sendChangeDirectorySocketMessage } from "../services/settingsService";
function MessageList(): JSX.Element {
diff --git a/frontend/src/components/Errors.css b/frontend/src/components/Errors.css
deleted file mode 100644
index 49ec3f52d4..0000000000
--- a/frontend/src/components/Errors.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.errors {
- position: fixed;
- left: 50%;
- transform: translateX(-50%);
- top: 1rem;
- z-index: 1000;
-}
-
-.error {
- background-color: #B00020;
- padding: 1rem;
- border-radius: 0.5rem;
- box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
- margin-bottom: 0.5rem;
-}
\ No newline at end of file
diff --git a/frontend/src/components/Errors.tsx b/frontend/src/components/Errors.tsx
index f98163130e..5f812faf08 100644
--- a/frontend/src/components/Errors.tsx
+++ b/frontend/src/components/Errors.tsx
@@ -1,7 +1,7 @@
import React from "react";
import { useSelector } from "react-redux";
import { RootState } from "../store";
-import "./Errors.css";
+import "./css/Errors.css";
function Errors(): JSX.Element {
const errors = useSelector((state: RootState) => state.errors.errors);
diff --git a/frontend/src/components/Planner.tsx b/frontend/src/components/Planner.tsx
index aec2a18011..8c5f4ab464 100644
--- a/frontend/src/components/Planner.tsx
+++ b/frontend/src/components/Planner.tsx
@@ -1,17 +1,9 @@
import React from "react";
+import "./css/Planner.css";
function Planner(): JSX.Element {
return (
- <div
- className="planner"
- style={{
- background: "black",
- padding: "1rem",
- height: "90%",
- margin: "1rem",
- borderRadius: "1rem",
- }}
- >
+ <div className="planner">
<h3>
Current Focus: Set up the development environment according to the
project&apos;s instructions.
diff --git a/frontend/src/components/css/BannerSettings.css b/frontend/src/components/css/BannerSettings.css
new file mode 100644
index 0000000000..2036e23389
--- /dev/null
+++ b/frontend/src/components/css/BannerSettings.css
@@ -0,0 +1,13 @@
+.banner {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 1rem;
+}
+
+select {
+ padding: 0.5rem;
+ border: 0;
+ border-radius: 5px;
+ font-size: 1rem;
+}
diff --git a/frontend/src/components/css/Browser.css b/frontend/src/components/css/Browser.css
new file mode 100644
index 0000000000..9663c86cc8
--- /dev/null
+++ b/frontend/src/components/css/Browser.css
@@ -0,0 +1,36 @@
+.mockup-browser {
+ background: black;
+ padding: 1rem;
+ height: 90%;
+ margin: 1rem;
+ border-radius: 1rem;
+}
+
+.url {
+ margin: 0.5rem;
+ padding: 0.5rem 1rem;
+ background-color: white;
+ border-radius: 2rem;
+ color: #252526;
+}
+.browser {
+ height: 90%;
+ width: 100%;
+ border-radius: 2rem;
+ padding: 1rem;
+}
+.url {
+ margin: 0.5rem;
+ padding: 0.5rem 1rem;
+ width: 80%;
+ background-color: white;
+ border-radius: 2rem;
+ color: #252526;
+}
+
+.screenshot {
+ width: 100%;
+ height: 96%;
+ max-height: calc(90vh - 100px); /* 100px is the height of the header */
+ object-fit: cover;
+}
diff --git a/frontend/src/components/ChatInterface.css b/frontend/src/components/css/ChatInterface.css
similarity index 100%
rename from frontend/src/components/ChatInterface.css
rename to frontend/src/components/css/ChatInterface.css
diff --git a/frontend/src/components/css/Errors.css b/frontend/src/components/css/Errors.css
new file mode 100644
index 0000000000..489c1bd15f
--- /dev/null
+++ b/frontend/src/components/css/Errors.css
@@ -0,0 +1,15 @@
+.errors {
+ position: fixed;
+ left: 50%;
+ transform: translateX(-50%);
+ top: 1rem;
+ z-index: 1000;
+}
+
+.error {
+ background-color: #B00020;
+ padding: 1rem;
+ border-radius: 0.5rem;
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
+ margin-bottom: 0.5rem;
+}
diff --git a/frontend/src/components/Browser.css b/frontend/src/components/css/Planner.css
similarity index 83%
rename from frontend/src/components/Browser.css
rename to frontend/src/components/css/Planner.css
index fd2326011f..7969a73534 100644
--- a/frontend/src/components/Browser.css
+++ b/frontend/src/components/css/Planner.css
@@ -1,4 +1,4 @@
-.mockup-browser {
+.planner {
background: black;
padding: 1rem;
height: 90%;