From c8a69d0a46e6d2d4ca4b98725c2efdf17f7d4620 Mon Sep 17 00:00:00 2001 From: Alessandro Macanha Date: Wed, 26 Jan 2022 11:37:15 -0300 Subject: [PATCH 1/2] fix: small fixes on cards --- CHANGELOG.md | 12 +++++ src/components/EventCard/index.tsx | 50 ++++++++----------- src/components/ModuleCard/index.tsx | 4 +- .../ProgramCard/ProgramCard.stories.tsx | 24 +-------- src/components/ProgramCard/index.tsx | 32 ++---------- 5 files changed, 40 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd95e9b..1c55332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,10 +21,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changes +- Removed gradient props (gradientInitialColor, gradientMiddleColor, gradientFinalColor) from `ProgramCard` component. +- Removed gradient props (gradientInitialColor, gradientMiddleColor, gradientFinalColor) from `EventCard` component. + ### Added +- Added prop classNameBar to allow changing the styles of bar for the `EventCard` component. +- Added class `outline-none` to `ModuleCard` to prevent outline when focus the button. +- Added class `outline-none` to `ProgramCard` to prevent outline when focus the button. +- Added class `outline-none` to `EventCard` to prevent outline when focus the button. +- Added `onPressButton` callback to `EventCard` button. + ### Fixed +- Fixed problem with `ModuleCard` and `ProgramCard` buttons displaying a black outline when pressed. +- Fixed problem with `EventCard` not having a button callback. + ## [3.4.4] 2022-01-24 ### Added diff --git a/src/components/EventCard/index.tsx b/src/components/EventCard/index.tsx index ade71f9..56ef2e2 100644 --- a/src/components/EventCard/index.tsx +++ b/src/components/EventCard/index.tsx @@ -46,35 +46,29 @@ export type EventCardProps = { */ className?: string; /** - * Gradient bar initial color value - * - * @default string - */ - tags?: string; - /** - * Events Tags + * Extended classes for bar * * @default string */ - tagsLabel?: string; + classNameBar?: string; /** - * Events Tags + * Card button callback * - * @default string + * @default void */ - gradientInitialColor?: string; + onPressButton?: () => void; /** - * Gradient bar initial color value if needed + * Gradient bar initial color value * * @default string */ - gradientMiddleColor?: string; + tags?: string; /** - * Gradient bar final color value + * Events Tags * * @default string */ - gradientFinalColor?: string; + tagsLabel?: string; }; /** @@ -88,11 +82,10 @@ export type EventCardProps = { * @param props.sponsorLabel Set the sponsor image label * @param props.imageUrl Set the sponsor image * @param props.className The input className - * @param props.gradientInitialColor The gradient bar initial color value - * @param props.gradientMiddleColor The input className - * @param props.gradientFinalColor The input className * @param props.tagsLabel The Events tags label * @param props.tags The Events tags + * @param props.classNameBar The bar className + * @param props.onPressButton The callback when pressing the button */ export const EventCard: React.FC = ({ imageUrl, @@ -102,21 +95,19 @@ export const EventCard: React.FC = ({ date, sponsorLabel, className, - gradientInitialColor, - gradientMiddleColor, - gradientFinalColor, tags, - tagsLabel + tagsLabel, + classNameBar, + onPressButton }) => { return (
+ />
@@ -143,10 +134,13 @@ export const EventCard: React.FC = ({ className="h-12 w-32 bg-contain bg-no-repeat" />
- + diff --git a/src/components/ModuleCard/index.tsx b/src/components/ModuleCard/index.tsx index 01e5ec2..e8562d7 100644 --- a/src/components/ModuleCard/index.tsx +++ b/src/components/ModuleCard/index.tsx @@ -99,7 +99,7 @@ export const ModuleCard: React.FC = ({ return (
- {title} + {title} {filter && (
= ({