Skip to content

Commit 00cc4f7

Browse files
committed
changes in css
Signed-off-by: Rohit <[email protected]>
1 parent d2c3789 commit 00cc4f7

File tree

5 files changed

+72
-45
lines changed

5 files changed

+72
-45
lines changed

Contract-web-app/src/components/Contract.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ function Contract(props) {
4040
<form className="bg-gray-900">
4141
<div className="w-full h-screen mb-4 border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-700 dark:border-gray-600">
4242
<div className="flex items-center justify-between px-3 py-2 border-b dark:border-gray-600">
43-
<div className="flex flex-wrap items-center divide-gray-200 sm:divide-x dark:divide-gray-600">
43+
<div className="flex flex-wrap font-medium items-center divide-gray-200 sm:divide-x dark:divide-gray-600 ">
44+
Editor
4445
</div>
4546
<div
4647
type="submit"

Contract-web-app/src/components/Homepage.jsx

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,66 @@ const Homepage = () => {
7070
if (contractType === "Employee") {
7171
return (
7272
<>
73-
<form onSubmit={handleSubmit} className="flex flex-col">
74-
<label
75-
htmlFor="position"
76-
className=" my-1 sm:my-2 md:my-4 md:text-xl"
77-
>
78-
Position
79-
</label>
80-
<input
81-
type="text"
82-
name="position"
83-
className="bg-slate-950 rounded-md border-2 border-stone-50 my-1 shadow-lg shadow-blue-950/50 hover:shadow-blue-950 sm:my-2 md:my-4 text-center sm:py-1 md:py-1.5 "
84-
/>
85-
<label
86-
htmlFor="organization"
87-
className=" my-1 sm:my-2 md:my-4 md:text-xl"
88-
>
89-
Organization
90-
</label>
91-
<input
92-
type="text"
93-
name="organization"
94-
className="bg-slate-950 rounded-md border-2 border-stone-50 my-1 shadow-lg shadow-blue-950/50 hover:shadow-blue-950 sm:my-2 md:my-4 text-center sm:py-1 md:py-1.5 "
95-
/>
96-
<label
97-
htmlFor="typeOfPosition"
98-
className=" my-1 sm:my-2 md:my-4 md:text-xl"
99-
>
100-
Type of Position
101-
</label>
102-
<input
103-
type="text"
73+
<form
74+
onSubmit={handleSubmit}
75+
className="flex flex-col justify-evenly"
76+
>
77+
<div className="flex flex-row mt-1 sm:mt-3 md:mt-4 justify-between">
78+
<label
79+
htmlFor="designation"
80+
className=" mt-1 mb-0.5 sm:mt-2 sm:mb-1 md:mt-4 md:mb-2 md:text-xl"
81+
>
82+
Designation
83+
</label>
84+
<input
85+
type="text"
86+
name="designation"
87+
className="bg-slate-950 rounded-md border-2 border-stone-50 mt-1 mb-0.5 sm:mt-2 sm:mb-1 md:mb-2 shadow-lg shadow-blue-950/50 hover:shadow-blue-950 text-center sm:py-1 "
88+
/>
89+
</div>
90+
<div className="flex flex-row mt-0.5 sm:mt-3 md:mt-2 justify-between">
91+
<label
92+
htmlFor="organization"
93+
className=" mt-1 mb-0.5 sm:mt-2 sm:mb-1 md:mt-4 md:mb-2 md:text-xl"
94+
>
95+
Organization
96+
</label>
97+
<input
98+
type="text"
99+
name="organization"
100+
className="bg-slate-950 rounded-md border-2 border-stone-50 mt-1 mb-0.5 sm:mt-2 sm:mb-1 md:mt-4 md:mb-2 shadow-lg shadow-blue-950/50 hover:shadow-blue-950 text-center sm:py-1 "
101+
/>
102+
</div>
103+
{/* <div className=""> */}
104+
<select
105+
className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 sm:my-2 md:my-3"
104106
name="typeOfPosition"
105-
className="bg-slate-950 rounded-md border-2 border-stone-50 my-1 shadow-lg shadow-blue-950/50 hover:shadow-blue-950 sm:my-2 md:my-4 text-center sm:py-1 md:py-1.5 "
106-
/>
107-
<div className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
107+
>
108+
<option value="none" selected disabled hidden>
109+
Select a Type
110+
</option>
111+
<option
112+
value="Corporate"
113+
className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
114+
>
115+
Corporate
116+
</option>
117+
<option
118+
value="RnD"
119+
className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
120+
>
121+
RnD
122+
</option>
123+
<option
124+
value="Government"
125+
className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
126+
>
127+
Government
128+
</option>
129+
<option value="Other">Other</option>
130+
</select>
131+
{/* </div> */}
132+
<div className="text-white bg-blue-700 hover:bg-blue-800 mt-0.5 sm:mt-3 md:mt-2 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
108133
<input type="submit" />
109134
</div>
110135
</form>
@@ -122,12 +147,12 @@ const Homepage = () => {
122147
const handleSubmit = async (e) => {
123148
e.preventDefault();
124149
setLoading(true);
125-
const position = e.target.position.value;
150+
const designation = e.target.designation.value;
126151
const organization = e.target.organization.value;
127152
const typeOfPosition = e.target.typeOfPosition.value;
128-
console.log(position, organization);
153+
console.log(designation, organization);
129154
const response = await axios.post(`${backendUrl}/employee`, {
130-
position: position,
155+
designation: designation,
131156
organization: organization,
132157
typeOfPosition: typeOfPosition,
133158
});
@@ -148,8 +173,9 @@ const Homepage = () => {
148173
<>
149174
{loading ? (
150175
<>
151-
<div className="bg-gray-950 min-h-screen max-w-full pt-4 flex flex-col md:flex-row justify-evenly items-center text-center text-white ">
176+
<div className="bg-gray-950 min-h-screen max-w-full pt-4 flex flex-col justify-evenly items-center text-center text-white ">
152177
<img src={Loader} alt="" />
178+
<h1 className="text-2xl">Generating, this may take a while</h1>
153179
</div>
154180
</>
155181
) : (
@@ -165,7 +191,7 @@ const Homepage = () => {
165191
alt=""
166192
/>
167193
</div>
168-
<div className="homepage-right-container flex flex-col items-center">
194+
<div className="homepage-right-container flex flex-col items-stretch">
169195
<h1 className=" text-xl sm:text-2xl md:text-4xl font-bold text-center text-white my-1 sm:my-2 md:my-4">
170196
GET YOUR CONTRACT
171197
</h1>

Contract-web-app/src/components/Navbar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Navbar() {
1212
const navigation = [
1313
{ name: "Home", href: "/", current: true },
1414
{ name: "About", href: "/about", current: false },
15-
{ name: "Why", href: "/why", current: false },
15+
// { name: "Why", href: "/why", current: false },
1616
];
1717

1818
return (

api/generate_contract.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const openai = new OpenAIApi(
77
})
88
);
99

10-
async function fetchEmployeeContract(position, typeOfPosition, organization) {
10+
async function fetchEmployeeContract(designation, typeOfPosition, organization) {
1111
const response = await openai.createCompletion({
1212
model: "text-davinci-003",
1313
prompt: `Write an employee job agreement for ${organization} keeping the following Sections in the document and assign bullet point to every section of the contract. Also assign a proper head and footer for the document.
1414
Sections to keep in document:
15-
1.Position:${position}, Type: ${typeOfPosition}
15+
1.Position:${designation}, Type: ${typeOfPosition}
1616
2.Compensation: Base compensation, Incentive Bonus
1717
3.Benefits: Vacation, Benefits Generally, Indemnification Rights
1818
4.Description of Duties

api/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const generateContract = require("./generate_contract.js");
1111

1212
app.post("/employee", async (req, res) => {
1313
console.log(req.body);
14-
const position = req.body.position;
14+
const designation = req.body.designation;
1515
const typeOfPosition = req.body.typeOfPosition;
1616
const organization = req.body.organization;
1717
let contract = await generateContract.fetchEmployeeContract(
18-
position,
18+
designation,
1919
typeOfPosition,
2020
organization
2121
);

0 commit comments

Comments
 (0)