🚀 Use Button

This commit is contained in:
Asim Shrestha
2023-04-07 13:36:41 -07:00
parent 3ec6701fb4
commit d8c8f18f05
2 changed files with 7 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import type { ForwardedRef } from "react"; import type { ForwardedRef } from "react";
import { forwardRef, useState } from "react"; import React, { forwardRef, useState } from "react";
import Loader from "./loader"; import Loader from "./loader";
@@ -31,11 +31,11 @@ const Button = forwardRef(
ref={ref} ref={ref}
type={props.type} type={props.type}
disabled={loading || props.disabled} disabled={loading || props.disabled}
onClick={onClick}
className={ className={
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
"text-white transition hover:text-yellow-500 " + props.className "transition-all " + props.className
} }
onClick={onClick}
> >
<div className="flex items-center"> <div className="flex items-center">
{loading ? ( {loading ? (

View File

@@ -6,6 +6,7 @@ import ChatWindow from "../components/ChatWindow";
import axios from "axios"; import axios from "axios";
import Drawer from "../components/Drawer"; import Drawer from "../components/Drawer";
import Input from "../components/Input"; import Input from "../components/Input";
import Button from "../components/Button";
const Home: NextPage = () => { const Home: NextPage = () => {
const [loading, setLoading] = React.useState<boolean>(false); const [loading, setLoading] = React.useState<boolean>(false);
@@ -55,12 +56,12 @@ const Home: NextPage = () => {
onChange={(e) => setGoalInput(e.target.value)} onChange={(e) => setGoalInput(e.target.value)}
/> />
{/* eslint-disable-next-line @typescript-eslint/no-misused-promises */} {/* eslint-disable-next-line @typescript-eslint/no-misused-promises */}
<button <Button
onClick={() => void handleNewGoal()} onClick={() => void handleNewGoal()}
className="w-64 rounded-full bg-gray-300" className="font-bolder text-gray/50 rounded-lg bg-[#1E88E5]/70 px-10 py-5 font-bold text-black/60 hover:bg-[#0084f7] hover:text-white"
> >
Deploy Agent Deploy Agent
</button> </Button>
</div> </div>
</main> </main>
</DefaultLayout> </DefaultLayout>