This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Connection Card and Storybook integration
- Loading branch information
Showing
6 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useState } from 'react' | ||
import { | ||
Card, | ||
CardContent, | ||
} from '../shadcn' | ||
import { Plus } from 'lucide-react' | ||
|
||
export function ConnectionCard({ | ||
logo, | ||
name, | ||
}: { | ||
logo: string | ||
name: string | ||
}) { | ||
const [isHovered, setIsHovered] = useState(false) | ||
|
||
return ( | ||
<Card | ||
className="w-[120px] h-[120px] p-0 relative cursor-pointer border border-gray-300 rounded-lg bg-white transition-colors duration-300 ease-in-out hover:bg-[#F8F7FF] hover:border-[#8A7DFF]" | ||
onMouseEnter={() => setIsHovered(true)} | ||
onMouseLeave={() => setIsHovered(false)} | ||
> | ||
<CardContent className="flex flex-col justify-center items-center h-full pt-6"> | ||
{isHovered ? ( | ||
<div className="flex flex-col justify-center items-center h-full"> | ||
<Plus color="#8A7DFF" size={24} /> | ||
<span className="text-[#8A7DFF] font-semibold text-[14px] font-sans mt-2">Add</span> {/* Set to 14px and semibold */} | ||
</div> | ||
) : ( | ||
<div className="flex flex-col justify-center items-center h-full"> | ||
<img src={logo} alt={`${name} logo`} className="w-8 h-8" style={{ marginBottom: '10px' }} /> {/* 32x32 logo with 10px padding */} | ||
<p className="m-0 text-sm font-semibold font-sans text-center mb-2">{name}</p> {/* Changed to font-semibold */} | ||
</div> | ||
)} | ||
</CardContent> | ||
</Card> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {fn} from '@storybook/test' | ||
import {ConnectionCard} from '../domain-components/ConnectionCard' | ||
import logoGreenhouse from '../../../apps/web/public/_assets/logo-greenhouse.svg'; | ||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||
export default { | ||
title: 'Example/ConnectionCard', | ||
component: ConnectionCard, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: { | ||
backgroundColor: {control: 'color'}, | ||
}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {onClick: fn()}, | ||
} | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args | ||
export const Primary = { | ||
args: { logo: logoGreenhouse, name: 'Greenhouse' }, | ||
}; |