Skip to content

Commit 3c8a1b8

Browse files
Merge pull request #65 from code4rena-dev/leo95oliveira/input-updates
Typescript Updates
2 parents a3b18f6 + c3119ed commit 3c8a1b8

File tree

13 files changed

+26
-26
lines changed

13 files changed

+26
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code4rena/components-library",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "Code4rena's official components library ",
55
"types": "./dist/lib.d.ts",
66
"exports": {

src/lib/Alert/Alert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ import { Icon } from "../Icon";
2323
* @param className - String of custom classes to extend the default styling of the component.
2424
* @param id - HTML element identifier
2525
*/
26-
export const Alert: React.FC<AlertProps> = ({
26+
export const Alert = ({
2727
title = "",
2828
message,
2929
redirectLabel = "",
3030
redirectUrl = "",
3131
variant = AlertVariant.INFO,
3232
className = "",
3333
id = "",
34-
}) => {
34+
}: AlertProps) => {
3535
const styling = clsx({
3636
c4alert: true,
3737
"alert--info": variant === AlertVariant.INFO,

src/lib/Avatar/Avatar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ const generateColor = (str: string) => {
5959
* @param size - The size of the avatar in pixels.
6060
* @param round - The border-radius of the avatar in pixels. Use this to make the avatar round.
6161
*/
62-
export const Avatar: React.FC<AvatarProps> = ({
62+
export const Avatar = ({
6363
imgElement,
6464
name,
6565
size,
6666
round,
67-
}) => {
67+
}: AvatarProps) => {
6868
const clonedImgElement = imgElement
6969
? cloneElement(imgElement, {
7070
className: "avatar__image",

src/lib/Button/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import "./Button.scss";
2424
* @param className - String of custom classes to extend the default styling of the component.
2525
* @param id - HTML element identifier.
2626
*/
27-
export const Button: React.FC<ButtonProps> = ({
27+
export const Button = ({
2828
label,
2929
type = ButtonType.BUTTON,
3030
variant = ButtonVariant.PRIMARY,
@@ -37,7 +37,7 @@ export const Button: React.FC<ButtonProps> = ({
3737
onClick,
3838
className = "",
3939
id = "",
40-
}) => {
40+
}: ButtonProps) => {
4141
const styling = clsx({
4242
c4button: true,
4343
"button--primary": variant === ButtonVariant.PRIMARY,

src/lib/Card/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import "./Card.scss";
2626
* @param title - The title to be rendered at the top of the card body. Can be string or react node.
2727
* @param cta - A call to action button rendered in the top right corner. Includes text and an onClick handler.
2828
*/
29-
export const Card: React.FC<CardProps> = ({
29+
export const Card = ({
3030
children,
3131
className,
3232
variants,
@@ -37,7 +37,7 @@ export const Card: React.FC<CardProps> = ({
3737
imageBorderRadius = CardImageBorderRadius.CIRCLE,
3838
title,
3939
cta,
40-
}) => {
40+
}: CardProps) => {
4141
return (
4242
<div
4343
className={clsx(

src/lib/ContestStatus/ContestStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import "./ContestStatus.scss";
1414
* @param className - String of custom classes to extend the default styling of the component.
1515
* @param id - HTML element identifier.
1616
*/
17-
export const ContestStatus: React.FC<ContestStatusProps> = ({
17+
export const ContestStatus = ({
1818
status,
1919
className = "",
2020
id = "",
21-
}) => {
21+
}: ContestStatusProps) => {
2222
const styling = clsx({
2323
statusindicator: true,
2424
upcoming: status === Status.UPCOMING,

src/lib/ContestTile/ContestTile.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const Countdown = ({
143143
* @param title - Title for the current contest.
144144
* @param description - Description for the current contest.
145145
*/
146-
export const ContestTile: React.FC<ContestTileProps> = ({
146+
export const ContestTile = ({
147147
htmlId = "",
148148
variant = ContestTileVariant.DARK,
149149
contestData,
@@ -153,7 +153,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
153153
title,
154154
description,
155155
hideDropdown = false,
156-
}) => {
156+
}: ContestTileProps) => {
157157
const isDefault =
158158
variant === ContestTileVariant.DARK || variant === ContestTileVariant.LIGHT;
159159

src/lib/EyebrowBar/EyebrowBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import "./EyebrowBar.scss";
1111
* @param id - HTML element identifier.
1212
* @param text - Main text displayed in the component.
1313
*/
14-
export const EyebrowBar: React.FC<EyebrowBarProps> = ({
14+
export const EyebrowBar = ({
1515
buttonLabel = "Learn more",
1616
className = undefined,
1717
external = false,
1818
href = undefined,
1919
id = undefined,
2020
text,
21-
}) => {
21+
}: EyebrowBarProps) => {
2222
return (
2323
<div id={id} className={`eyebrowbar ${className ?? ""}`}>
2424
<p className="eyebrowbar--content">

src/lib/Icon/Icon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ const getIcon = (name: string, size: string, color: string, className?: string)
1717
* @param color - Color value to decorate the icon with.
1818
* @param className - Custom classes to be attached to the icon.
1919
*/
20-
export const Icon: React.FC<IconProps> = ({
20+
export const Icon = ({
2121
name,
2222
size = "medium",
2323
color = "black",
2424
className
25-
}) => {
25+
}: IconProps) => {
2626
let sizeInPx = "24px";
2727

2828
switch (size) {

src/lib/Input/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const mappedTypes = (
7474
* @param validator - A custom function for running additional validation on an input value. Should return an array of error messages (if any).
7575
* @param value - Current value of input field as tracked by state. This does not apply to the SELECT field variant (please see the `selectValue` parameter).
7676
*/
77-
export const Input: React.FC<InputProps> = ({
77+
export const Input = ({
7878
inputId,
7979
fieldType = "text",
8080
isMultiSelect = false,
@@ -91,7 +91,7 @@ export const Input: React.FC<InputProps> = ({
9191
validator,
9292
value,
9393
onChange,
94-
}) => {
94+
}: InputProps) => {
9595
const fieldTypeClassName = clsx({
9696
c4input: true,
9797
"c4input--field": variant === InputVariant.FIELD,

0 commit comments

Comments
 (0)