From ff254029bf9fdebce08ed43ff1d169b08f0149de Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 2 Jul 2023 10:29:24 -0300 Subject: [PATCH] style: apply tailwind formatting --- src/frontend/src/App.tsx | 24 ++++++-- .../components/parameterComponent/index.tsx | 12 ++-- .../src/CustomNodes/GenericNode/index.tsx | 20 +++---- .../components/singleAlertComponent/index.tsx | 12 ++-- .../src/alerts/alertDropDown/index.tsx | 10 ++-- src/frontend/src/alerts/error/index.tsx | 2 +- src/frontend/src/alerts/notice/index.tsx | 4 +- src/frontend/src/alerts/success/index.tsx | 2 +- .../components/CrashErrorComponent/index.tsx | 12 ++-- .../EditFlowSettingsComponent/index.tsx | 4 +- .../ExtraSidebarComponent/index.tsx | 16 ++--- .../ReactTooltipComponent/index.tsx | 2 +- .../src/components/cardComponent/index.tsx | 10 ++-- .../chatComponent/buildTrigger/index.tsx | 6 +- .../chatComponent/chatMessage/index.tsx | 12 ++-- .../chatComponent/chatTrigger/index.tsx | 6 +- .../components/codeAreaComponent/index.tsx | 10 ++-- .../components/dropdownComponent/index.tsx | 12 ++-- .../src/components/floatComponent/index.tsx | 4 +- .../components/menuBar/index.tsx | 18 +++--- .../src/components/headerComponent/index.tsx | 30 +++++----- .../src/components/inputComponent/index.tsx | 16 ++--- .../components/inputFileComponent/index.tsx | 12 ++-- .../components/inputListComponent/index.tsx | 10 ++-- .../src/components/intComponent/index.tsx | 6 +- .../src/components/loadingComponent/index.tsx | 6 +- .../src/components/promptComponent/index.tsx | 10 ++-- .../components/textAreaComponent/index.tsx | 10 ++-- .../src/components/toggleComponent/index.tsx | 8 +-- src/frontend/src/components/ui/card.tsx | 2 +- .../src/components/ui/dropdown-menu.tsx | 2 +- .../src/components/ui/rename-label.tsx | 4 +- src/frontend/src/components/ui/tabs.tsx | 2 +- src/frontend/src/contexts/tabsContext.tsx | 8 ++- src/frontend/src/modals/ApiModal/index.tsx | 26 ++++----- .../src/modals/EditNodeModal/index.tsx | 18 +++--- .../NodeModal/components/ModalField/index.tsx | 2 +- src/frontend/src/modals/NodeModal/index.tsx | 20 +++---- .../src/modals/chatModal/chatInput/index.tsx | 4 +- .../chatModal/chatMessage/codeBlock/index.tsx | 4 +- .../modals/chatModal/chatMessage/index.tsx | 32 +++++----- .../modals/chatModal/fileComponent/index.tsx | 20 +++---- src/frontend/src/modals/chatModal/index.tsx | 58 ++++++++++--------- .../src/modals/codeAreaModal/index.tsx | 8 +-- src/frontend/src/modals/exportModal/index.tsx | 20 +++++-- .../src/modals/flowSettingsModal/index.tsx | 4 +- .../src/modals/genericModal/index.tsx | 4 +- .../modals/importModal/buttonBox/index.tsx | 10 ++-- src/frontend/src/modals/importModal/index.tsx | 20 +++---- src/frontend/src/modals/promptModal/index.tsx | 14 ++--- .../src/modals/textAreaModal/index.tsx | 14 ++--- .../src/pages/CommunityPage/index.tsx | 14 ++--- .../components/DisclosureComponent/index.tsx | 2 +- .../components/PageComponent/index.tsx | 12 ++-- .../extraSidebarComponent/index.tsx | 36 ++++++------ .../components/nodeToolbarComponent/index.tsx | 18 +++--- src/frontend/src/pages/FlowPage/index.tsx | 2 +- src/frontend/src/pages/MainPage/index.tsx | 18 +++--- src/frontend/src/types/tabs/index.ts | 6 +- 59 files changed, 371 insertions(+), 339 deletions(-) diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 3ef728925..f4df0f00b 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -51,7 +51,11 @@ export default function App() { useEffect(() => { // If there is an error alert open with data, add it to the alertsList if (errorOpen && errorData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(errorData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(errorData) + ) { return; } setErrorOpen(false); @@ -65,7 +69,11 @@ export default function App() { } // If there is a notice alert open with data, add it to the alertsList else if (noticeOpen && noticeData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(noticeData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(noticeData) + ) { return; } setNoticeOpen(false); @@ -79,7 +87,11 @@ export default function App() { } // If there is a success alert open with data, add it to the alertsList else if (successOpen && successData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(successData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(successData) + ) { return; } setSuccessOpen(false); @@ -112,7 +124,7 @@ export default function App() { return ( //need parent component with width and height -
+
{ window.localStorage.removeItem("tabsData"); @@ -127,7 +139,7 @@ export default function App() {
{alertsList.map((alert) => ( @@ -161,4 +173,4 @@ export default function App() {
); -} \ No newline at end of file +} diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index f002492a6..f9c432fc1 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -101,7 +101,7 @@ export default function ParameterComponent({ 0 ? "items-center flex mt-3" : "items-center flex" + i > 0 ? "mt-3 flex items-center" : "flex items-center" )} >
<>
{info !== "" && ( - + )}
@@ -182,7 +182,7 @@ export default function ParameterComponent({ } className={classNames( left ? "-ml-0.5 " : "-mr-0.5 ", - "w-3 h-3 rounded-full border-2 bg-background" + "h-3 w-3 rounded-full border-2 bg-background" )} style={{ borderColor: color, @@ -247,7 +247,7 @@ export default function ParameterComponent({ ) : left === true && type === "str" && data.node.template[name].options ? ( -
+
-
+
diff --git a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx index 5827ccc2f..5a16390bb 100644 --- a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx @@ -25,14 +25,14 @@ export default function SingleAlert({ > {type === "error" ? (
-

+

{dropItem.title}

{dropItem.list ? ( @@ -72,17 +72,17 @@ export default function SingleAlert({
) : type === "notice" ? (
-

+

{dropItem.title}

-

+

{dropItem.link ? ( ) : (

diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index fe6845ff9..ef703f624 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -24,9 +24,9 @@ export default function AlertDropdown({}: AlertDropdownType) { return (
-
+
Notifications
-
+
{notificationList.length !== 0 ? ( notificationList.map((alertItem, index) => ( )) ) : ( -
+
No new notifications
)} diff --git a/src/frontend/src/alerts/error/index.tsx b/src/frontend/src/alerts/error/index.tsx index 872fa69bd..31980dc6b 100644 --- a/src/frontend/src/alerts/error/index.tsx +++ b/src/frontend/src/alerts/error/index.tsx @@ -39,7 +39,7 @@ export default function ErrorAlert({ removeAlert(id); }, 500); }} - className="rounded-md w-96 mt-6 shadow-xl bg-error-background p-4 cursor-pointer" + className="mt-6 w-96 cursor-pointer rounded-md bg-error-background p-4 shadow-xl" >
diff --git a/src/frontend/src/alerts/notice/index.tsx b/src/frontend/src/alerts/notice/index.tsx index 4d0747919..9af51a531 100644 --- a/src/frontend/src/alerts/notice/index.tsx +++ b/src/frontend/src/alerts/notice/index.tsx @@ -36,7 +36,7 @@ export default function NoticeAlert({ setShow(false); removeAlert(id); }} - className="rounded-md w-96 mt-6 shadow-xl bg-info-background p-4" + className="mt-6 w-96 rounded-md bg-info-background p-4 shadow-xl" >
@@ -44,7 +44,7 @@ export default function NoticeAlert({

{title}

-

+

{link !== "" ? (

diff --git a/src/frontend/src/components/CrashErrorComponent/index.tsx b/src/frontend/src/components/CrashErrorComponent/index.tsx index 8bd32af92..fd7d22c36 100644 --- a/src/frontend/src/components/CrashErrorComponent/index.tsx +++ b/src/frontend/src/components/CrashErrorComponent/index.tsx @@ -1,11 +1,11 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) { return ( -
-
-

+
+
+

Oops! An unknown error has occurred.

-

+

Please click the 'Reset Application' button to restore the application's state. If the error persists, please create an issue on our GitHub page. We apologize for any inconvenience this may have @@ -14,7 +14,7 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) {

@@ -22,7 +22,7 @@ export default function CrashErrorComponent({ error, resetErrorBoundary }) { href="https://github.com/logspace-ai/langflow/issues/new" target="_blank" rel="noopener noreferrer" - className="bg-status-red hover:bg-error-foreground text-background font-bold py-2 px-4 rounded" + className="rounded bg-status-red px-4 py-2 font-bold text-background hover:bg-error-foreground" > Create Issue diff --git a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx index 7aa225056..7ce5f4f26 100644 --- a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx +++ b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx @@ -47,7 +47,7 @@ export const EditFlowSettings: React.FC = ({
Name{" "} {isMaxLength && ( - + Character limit reached )} @@ -71,7 +71,7 @@ export const EditFlowSettings: React.FC = ({ onChange={handleDescriptionChange} value={description ?? ""} placeholder="Flow description" - className="max-h-[100px] mt-2 font-normal" + className="mt-2 max-h-[100px] font-normal" rows={3} /> diff --git a/src/frontend/src/components/ExtraSidebarComponent/index.tsx b/src/frontend/src/components/ExtraSidebarComponent/index.tsx index 913b6b8eb..6bc95cde7 100644 --- a/src/frontend/src/components/ExtraSidebarComponent/index.tsx +++ b/src/frontend/src/components/ExtraSidebarComponent/index.tsx @@ -18,10 +18,10 @@ export default function ExtraSidebar() {