Skip to content

Commit

Permalink
getting build page off the ground
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenNaihin committed Feb 11, 2024
1 parent 85daaeb commit 82ec6cc
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
36 changes: 36 additions & 0 deletions ui/app/build/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import tw from 'tailwind-styled-components';

import Builder from '../components/build/Builder';

const BuildPage: React.FC = () => {
return (
<Container>
<ContentWrapper>
<div className="mb-4 flex w-full justify-center">
<img className="w-64" src="/stackwise_logo.png" />
</div>
<Builder />
</ContentWrapper>
</Container>
);
};

export default BuildPage;

const Container = tw.div`
flex
flex-col
justify-center
items-center
w-full
h-screen
`;

const ContentWrapper = tw.div`
w-3/5
flex
flex-col
justify-center
items-center
mt-10
`;
60 changes: 60 additions & 0 deletions ui/app/components/build/Builder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use client';

import { useState } from 'react';
import tw from 'tailwind-styled-components';

const Builder: React.FC = () => {
const [input, setInput] = useState<string>(
'Using GPT, summarize all of my Git commits in the last month',
);
const [loading, setLoading] = useState(false);

const handleSubmit = async () => {
setLoading(true);

// This is where the API call would go

setLoading(false);
};

return (
<BuilderWrapper>
<BuilderInput value={input} onChange={(e) => setInput(e.target.value)} />
<Button
onClick={handleSubmit}
type="submit"
disabled={loading}
className={`${loading && 'bg-black text-white'}`}
>
Submit
</Button>
</BuilderWrapper>
);
};

export default Builder;

const BuilderWrapper = tw.div`
flex
w-full
flex-col
items-center
justify-center
`;

const BuilderInput = tw.textarea`
w-1/2
p-2
mb-2
border
border-gray-300
bg-gray-50
rounded
resize-none
focus:outline-none
h-24
`;

const Button = tw.button`
rounded-md border border-black px-3 py-1 font-medium
`;

0 comments on commit 82ec6cc

Please sign in to comment.