Skip to content

Commit

Permalink
feat:final changres
Browse files Browse the repository at this point in the history
  • Loading branch information
Dospalko committed Nov 26, 2023
1 parent b30d76f commit 1d08d86
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Dashboard/DashboardMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const DashboardMain = () => {
};

return (
<div data-aos="fade-up" className="dashboard-main-container w-[90%] mt-10 m-auto -z-5 relative p-4 bg-white rounded-lg shadow-md">
<div data-aos="fade-up" className="score-main-container w-[90%] mt-10 m-auto -z-5 relative p-4 bg-white rounded-lg shadow-md">
<h2 className="text-2xl text-center font-bold mb-4">Dashboard</h2>
<div className="text-gray-700 text-sm leading-relaxed">
<Bar data={chartData} options={options} />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/LoadingIndicator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const CustomLoadingIndicator = ({ loadingState }) => {

return (
<div className="fixed inset-x-[56%] inset-y-[30%] flex justify-between m-auto items-end">
<div className="flex flex-col w-max items-center">
<div className="flex flex-col w-max items-center">
<HashLoader color={getLoaderColor()} size={150} />
<p className=" w-max text-black font-bold text-xl p-4 mt-4">
<p className=" w-max text-[#e20274] font-bold text-xl p-4 mt-4">
{loadingState === 'analyzing' && 'Analyzing PDF...'}
{loadingState === 'scoring' && 'Calculating Scores...'}
{loadingState === 'dashboard' && 'Building Dashboard...'}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/PdfUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const PdfUpload = () => {
<h2 className="text-2xl font-bold w-max m-auto text-black p-4 text-center mb-4">Upload RFP Document</h2>
<div className="flex flex-col items-center">
<div {...getRootProps()} className="dropzone text-[#e20274] font-bold border-dashed border-2 border-[#e20274] py-8 px-4 rounded text-center cursor-pointer ">
<input {...getInputProps()} disabled={isUploading} />
<input {...getInputProps()} disabled={isUploading} />
{selectedFile ? <p>{selectedFile.name.substring(0, 20) + (selectedFile.name.length > 20 ? '...' : '')}</p> : <p>Drag 'n' drop some files here, or click to select files</p>} </div>

<button
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/Score/ScoreMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const ScoreMain = () => {


const calculateFinalScore = () => {
const scoreValues = Object.values(scores).filter(score => score !== "N/A" && score !== "Not Applicable");
const totalScore = scoreValues.reduce((acc, score) => acc + parseFloat(score), 0);
const scoreValues = Object.values(scores).filter(score => score !== "0" && score !== "Not Applicable");
const totalScore = scoreValues.reduce((acc, score) => acc + parseInt(score), 0);
return (totalScore / scoreValues.length).toFixed(1);
};

Expand All @@ -21,8 +21,8 @@ const ScoreMain = () => {
{Object.entries(scores).map(([section, score]) => (
<div key={section} className="flex justify-between items-center py-2 border-b">
<span className="font-medium">{section}</span>
<span className={`font-bold ${score !== "N/A" && score !== "Not Applicable" && parseFloat(score) >= 7 ? 'text-green-500' : parseFloat(score) >= 4 ? 'text-yellow-500' : 'text-red-500'}`}>
{score !== "N/A" && score !== "Not Applicable" ? `${(parseFloat(score)).toFixed(1)}/10` : score}
<span className={`font-bold ${score !== "0" && score !== "Not Applicable" && parseFloat(score) >= 7 ? 'text-green-500' : parseFloat(score) >= 4 ? 'text-yellow-500' : 'text-red-500'}`}>
{score !== "0" && score !== "Not Applicable" ? `${(parseInt(score))}` : score}
</span>
</div>
))}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Summary/SummaryMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LoadingIndicator from '../LoadingIndicator'; // Import your loading indic

const SummaryMain = () => {
const { summary, isLoading } = useContext(SummaryContext);

const formattedSummary = summary.split('. ').map((sentence, index) => (
<p key={index} className="mb-2">{sentence.trim()}.</p>
));
Expand Down

0 comments on commit 1d08d86

Please sign in to comment.