Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
munyanezaarmel committed Nov 22, 2024
1 parent 3404711 commit 638e2f9
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 75 deletions.
12 changes: 6 additions & 6 deletions app/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from "react";
import { Button as AntButton } from "antd";
import React from "react"
import { Button as AntButton } from "antd"

interface ToolMapButtonProps {
onClick: () => void;
onClick: () => void
}

const ToolMapButton: React.FC<ToolMapButtonProps> = ({ onClick }) => (
<AntButton
<AntButton
onClick={onClick}
size="large"
className="bg-[#2D6A4F] text-white hover:bg-[#1B4332] transition-colors"
>
Open Tool Finder
</AntButton>
);
)

export default ToolMapButton;
export default ToolMapButton
2 changes: 1 addition & 1 deletion app/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,4 @@ const EnAccessToolMap = () => {
)
}

export default EnAccessToolMap
export default EnAccessToolMap
109 changes: 57 additions & 52 deletions app/components/Questionairefilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ const tools = [

// Define an interface for the filters
interface Filters {
numberOfClients: string[];
transactionsPerDay: string[];
companyStage: string[];
companyFocus: string[];
toolsCost: string[];
toolSource: string[];
internalExpertise: string[];
businessArea: string[];
functionalArea: string[];
interoperability: string[];
offlineFunctionality: string[];
numberOfClients: string[]
transactionsPerDay: string[]
companyStage: string[]
companyFocus: string[]
toolsCost: string[]
toolSource: string[]
internalExpertise: string[]
businessArea: string[]
functionalArea: string[]
interoperability: string[]
offlineFunctionality: string[]
}

const EnAccessToolMap: React.FC = () => {
Expand Down Expand Up @@ -300,7 +300,8 @@ const EnAccessToolMap: React.FC = () => {
Object.entries(filters).every(([filterKey, selectedValues]) => {
if (selectedValues.length === 0) return true

const metadataValue = tool.metadata[filterKey as keyof typeof tool.metadata]
const metadataValue =
tool.metadata[filterKey as keyof typeof tool.metadata]

if (Array.isArray(metadataValue)) {
return selectedValues.some((value: string) =>
Expand Down Expand Up @@ -339,50 +340,54 @@ const EnAccessToolMap: React.FC = () => {

return (
<div className="bg-white text-gray-800">
<div className="flex justify-center my-5">
<Input
placeholder="Search tools"
className="w-72"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>
</div>

<div className="flex">
<div className="w-1/4 p-4">
<Collapse>
{Object.keys(FILTER_OPTIONS).map((filterKey) =>
renderFilterSection(filterKey as keyof Filters)
)}
</Collapse>
<div className="flex justify-center my-5">
<Input
placeholder="Search tools"
className="w-72"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>
</div>

<div className="w-3/4 p-5">
{!hasActiveFilters ? (
<WelcomeMessage hasFilters={false} />
) : filteredTools.length > 0 ? (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
{filteredTools.map((tool) => (
<Card key={tool.name} className="bg-[#2D6A4F] text-white">
<Title level={3} className="text-white">{tool.name}</Title>
<Paragraph className="text-gray-100">{tool.summary}</Paragraph>
<a
href={tool.link}
target="_blank"
rel="noopener noreferrer"
className="text-blue-200 hover:text-blue-100"
>
Visit Website
</a>
</Card>
))}
</div>
) : (
<WelcomeMessage hasFilters={true} />
)}
<div className="flex">
<div className="w-1/4 p-4">
<Collapse>
{Object.keys(FILTER_OPTIONS).map((filterKey) =>
renderFilterSection(filterKey as keyof Filters)
)}
</Collapse>
</div>

<div className="w-3/4 p-5">
{!hasActiveFilters ? (
<WelcomeMessage hasFilters={false} />
) : filteredTools.length > 0 ? (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
{filteredTools.map((tool) => (
<Card key={tool.name} className="bg-[#2D6A4F] text-white">
<Title level={3} className="text-white">
{tool.name}
</Title>
<Paragraph className="text-gray-100">
{tool.summary}
</Paragraph>
<a
href={tool.link}
target="_blank"
rel="noopener noreferrer"
className="text-blue-200 hover:text-blue-100"
>
Visit Website
</a>
</Card>
))}
</div>
) : (
<WelcomeMessage hasFilters={true} />
)}
</div>
</div>
</div>
</div>
)
}

Expand Down
33 changes: 17 additions & 16 deletions app/components/WelcomeMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import React from "react";
import {
Typography,
Empty,
} from "antd";
import { Search } from "lucide-react";
import React from "react"
import { Typography, Empty } from "antd"
import { Search } from "lucide-react"

const { Title, Paragraph } = Typography;
const { Title, Paragraph } = Typography

interface WelcomeMessageProps {
hasFilters: boolean;
hasFilters: boolean
}

const WelcomeMessage: React.FC<WelcomeMessageProps> = ({ hasFilters }) => (
<div className="flex flex-col items-center justify-center p-8 text-center bg-gray-50 rounded-lg shadow-sm">
<Search className="w-16 h-16 text-gray-400 mb-4" />
<Title level={2} className="mb-4">Welcome to the Tool Finder</Title>
<Title level={2} className="mb-4">
Welcome to the Tool Finder
</Title>
<Paragraph className="text-lg text-gray-600 max-w-2xl">
{hasFilters
? (<div className="col-span-full flex justify-center items-center">
<Empty description="No tools match your filters" />
</div>)
: "Start by answering a few questions about your needs using the filters on the left. We'll help you find the perfect tools for your business."}
{hasFilters ? (
<div className="col-span-full flex justify-center items-center">
<Empty description="No tools match your filters" />
</div>
) : (
"Start by answering a few questions about your needs using the filters on the left. We'll help you find the perfect tools for your business."
)}
</Paragraph>
</div>
);
)

export default WelcomeMessage;
export default WelcomeMessage

0 comments on commit 638e2f9

Please sign in to comment.