Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #120 from smartive-education/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
monobasic authored Jun 25, 2023
2 parents 4ad92f3 + 81bc3bd commit 69b3624
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Avatar: React.FC<AvatarProps> = ({

if (props.href) {
return (
<Component href={props.href} onClick={props.onClick} data-e2e={props.e2e}>
<Component href={props.href} onClick={props.onClick} data-testid={props.testid}>
<span className={wrapperClasses.join(' ')}>
<ImageComponent
className={imageClasses.join(' ')}
Expand All @@ -45,7 +45,7 @@ export const Avatar: React.FC<AvatarProps> = ({
}

return (
<span className={wrapperClasses.join(' ')} onClick={props.onClick} data-e2e={props.e2e}>
<span className={wrapperClasses.join(' ')} onClick={props.onClick} data-testid={props.testid}>
<ImageComponent className={imageClasses.join(' ')} src={props.src} alt={props.alt} {...props.imageComponentProps} />
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/avatar/avatar.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export type AvatarProps = {
imageComponentProps?: { [key: string]: string };
href?: string;
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
e2e?: string;
testid?: string;
};
4 changes: 2 additions & 2 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const Button: React.FC<ButtonProps> = ({
href={props.href}
className={props.isIconOnly ? iconClasses.join(' ') : baseClasses.join(' ')}
aria-label={props.ariaLabel || props.label}
data-e2e={props.e2e}
data-testid={props.testid}
>
<span hidden={props.isIconOnly}>{props.label}</span>
<span className={props.isIconOnly ? '' : 'pl-xs'}>{props.children}</span>
Expand All @@ -70,7 +70,7 @@ export const Button: React.FC<ButtonProps> = ({
onClick={props.onClick}
aria-label={props.ariaLabel || props.label}
className={props.isIconOnly ? iconClasses.join(' ') : baseClasses.join(' ')}
data-e2e={props.e2e}
data-testid={props.testid}
>
<span hidden={props.isIconOnly}>{props.label}</span>
<span className={props.isIconOnly ? '' : 'pl-xs'}>{props.children}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/button.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export type ButtonProps = {
elementType?: React.ElementType;
href?: string;
ariaLabel?: string;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/hashtag/hashtag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Hashtag: React.FC<HashtagProps> = ({ size = HashtagSize.L, ...props
}

return (
<button onClick={props.onClick} title={props.label} className={baseClasses.join(' ')} data-e2e={props.e2e}>
<button onClick={props.onClick} title={props.label} className={baseClasses.join(' ')} data-testid={props.testid}>
#{props.label}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/hashtag/hashtag.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export type HashtagProps = {
label?: string;
size?: HashtagSize;
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/icon-link/icon-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const IconLink: React.FC<IconLinkProps> = ({ elementType: Component = 'a'
href={props.href}
className={baseClasses.join(' ')}
aria-label={props.label}
data-e2e={props.e2e}
data-testid={props.testid}
>
<span>{props.children}</span>
<span className={'pl-xxs'}>{props.label}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/icon-link/icon-link.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export type IconLinkProps = {
children?: ReactNode;
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
elementType?: React.ElementType;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Input: React.FC<InputProps> = ({ type = InputType.TEXT, ...props })
type={type}
placeholder={props.placeholder}
className={inputBaseClasses.join(' ')}
data-e2e={props.e2e}
data-testid={props.testid}
/>
{(props.children || props.hasError) && (
<span className={iconBaseClasses.join(' ')}>{props.hasError ? <Cancel color="text-red" /> : props.children}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/input.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export type InputProps = {
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
hasError?: boolean;
errorMessage?: string;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/interaction/interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Interaction: React.FC<InteractionProps> = (props) => {
});

return (
<button className={baseClasses.join(' ')} onClick={props.onClick} data-e2e={props.e2e}>
<button className={baseClasses.join(' ')} onClick={props.onClick} data-testid={props.testid}>
{interactionContent}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/interaction/interaction.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export type InteractionProps = {
active?: boolean;
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
children?: ReactNode;
e2e?: string;
testid?: string;
};
4 changes: 2 additions & 2 deletions src/components/navigationItem/navigation-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const NavigationItem: React.FC<NavigationItemProps> = ({ elementType: Com
if (props.href) {
return (
<li className={navigationItemBaseClasses}>
<Component href={props.href} className={buttonBaseClasses} data-e2e={props.e2e}>
<Component href={props.href} className={buttonBaseClasses} data-testid={props.testid}>
{props.children}
<span className={labelBaseClasses}>{props.label}</span>
</Component>
Expand All @@ -20,7 +20,7 @@ export const NavigationItem: React.FC<NavigationItemProps> = ({ elementType: Com

return (
<li className={navigationItemBaseClasses}>
<Component onClick={props.onClick} className={buttonBaseClasses} data-e2e={props.e2e}>
<Component onClick={props.onClick} className={buttonBaseClasses} data-testid={props.testid}>
{props.children}
<span className={labelBaseClasses}>{props.label}</span>
</Component>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigationItem/navigation-item.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export type NavigationItemProps = {
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
elementType?: React.ElementType;
href?: string;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/tabs/tabs-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const TabsItem: React.FC<TabsItemProps> = (props) => {
}

return (
<li onClick={props.onClick} className={baseClasses.join(' ')} data-e2e={props.e2e}>
<li onClick={props.onClick} className={baseClasses.join(' ')} data-testid={props.testid}>
{props.label}
</li>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/tabs.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export type TabsItemProps = {
active: boolean;
label: string;
onClick?: () => void;
e2e?: string;
testid?: string;
};
8 changes: 7 additions & 1 deletion src/components/text-link/text-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ export const TextLink: React.FC<TextLinkProps> = ({ elementType: Component = 'a'
'text-violet-600 border-b-2 border-violet-600 hover:border-violet-200 h-fit text-14 font-semibold cursor-pointer';

return (
<Component target={props.target} href={props.href} className={baseClasses} aria-label={props.label} data-e2e={props.e2e}>
<Component
target={props.target}
href={props.href}
className={baseClasses}
aria-label={props.label}
data-testid={props.testid}
>
{props.label}
</Component>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/text-link/text-link.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export type TextLinkProps = {
href?: string;
target?: HTMLAttributeAnchorTarget;
elementType?: React.ElementType;
e2e?: string;
testid?: string;
};
2 changes: 1 addition & 1 deletion src/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Textarea: React.FC<TextareaProps> = ({ rows = 8, ...props }) => {
placeholder={props.placeholder}
className={textareaBaseClasses.join(' ')}
rows={rows}
data-e2e={props.e2e}
data-testid={props.testid}
/>
{props.hasError && props.errorMessage ? <div className={errorMessageClasses.join(' ')}>{props.errorMessage}</div> : ''}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/textarea/textarea.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export type TextareaProps = {
onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void;
hasError?: boolean;
errorMessage?: string;
e2e?: string;
testid?: string;
};

0 comments on commit 69b3624

Please sign in to comment.