diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2187e3e..9781522 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ name: Deployment (Staging) on: # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: ['main'] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -20,8 +20,8 @@ jobs: - name: Set up Node uses: actions/setup-node@v6 with: - node-version: "lts/*" - cache: "npm" + node-version: 'lts/*' + cache: 'npm' - name: Set environment variables run: | @@ -32,8 +32,8 @@ jobs: if [[ -n "${{ vars.VITE_BC_POSITION }}" ]]; then echo "VITE_BC_POSITION=${{ vars.VITE_BC_POSITION }}" >> .env fi - if [[ -n "${{ vars.VITE_BC_VAT }}" ]]; then - echo "VITE_BC_VAT=${{ vars.VITE_BC_VAT }}" >> .env + if [[ -n "${{ vars.VITE_BC_INSTAGRAM }}" ]]; then + echo "VITE_BC_INSTAGRAM=${{ vars.VITE_BC_INSTAGRAM }}" >> .env fi if [[ -n "${{ vars.VITE_BC_FACEBOOK }}" ]]; then echo "VITE_BC_FACEBOOK=${{ vars.VITE_BC_FACEBOOK }}" >> .env diff --git a/src/components/molecules/EmplyeeCard/index.test.tsx b/src/components/molecules/EmplyeeCard/index.test.tsx index 39b73cb..065cb58 100644 --- a/src/components/molecules/EmplyeeCard/index.test.tsx +++ b/src/components/molecules/EmplyeeCard/index.test.tsx @@ -1,7 +1,7 @@ import { render, screen, fireEvent } from '@testing-library/react' import { vi } from 'vitest' -import EmplyeeCard from './index' +import EmployeeCard from './index' describe('EmplyeeCard', () => { const name = 'John Doe' @@ -9,7 +9,7 @@ describe('EmplyeeCard', () => { const position = 'Blacksmith' it('renders name, image and optional position', () => { - render() + render() expect(screen.getByText(name)).toBeInTheDocument() expect(screen.getByText(position)).toBeInTheDocument() @@ -22,7 +22,7 @@ describe('EmplyeeCard', () => { it('calls onClick with (event, description) payload', () => { const description = { body: ['this is a description for John Doe'] } const handleClick = vi.fn() - render() + render() fireEvent.click(screen.getByText(name)) @@ -43,7 +43,7 @@ describe('EmplyeeCard', () => { body: ['this is a description for Jane Doe'], } const handleClick = vi.fn() - render() + render() fireEvent.click(screen.getByText(name)) diff --git a/src/components/molecules/EmplyeeCard/index.tsx b/src/components/molecules/EmplyeeCard/index.tsx index 122d042..ab1a557 100644 --- a/src/components/molecules/EmplyeeCard/index.tsx +++ b/src/components/molecules/EmplyeeCard/index.tsx @@ -1,5 +1,6 @@ import { FC, useMemo } from 'react' import { Card, CardActionArea, CardContent, CardMedia, CardProps, Typography } from '@mui/material' +import InfoOutline from '@mui/icons-material/InfoOutline' import { EmployeeDescription } from 'components/molecules/EmployeeDescription/index.js' @@ -11,9 +12,9 @@ export type EmployeeCardProps = Omit & { onClick?: (event: React.MouseEvent, description: EmployeeDescription) => void } -export const EmplyeeCard: FC = ({ name, position, image, description = {}, sx, onClick, ...props }) => { +export const EmployeeCard: FC = ({ name, position, image, description = {}, sx, onClick, ...props }) => { const handleClick = (event: React.MouseEvent) => { - onClick(event, { + onClick?.(event, { title: name, image: image, position: position, @@ -22,7 +23,7 @@ export const EmplyeeCard: FC = ({ name, position, image, desc } const content = useMemo( () => [ - , + , {name} @@ -32,9 +33,12 @@ export const EmplyeeCard: FC = ({ name, position, image, desc {position} )} + {typeof onClick !== 'undefined' && ( + + )} , ], - [name, position, image] + [name, position, image, onClick] ) return ( @@ -43,4 +47,4 @@ export const EmplyeeCard: FC = ({ name, position, image, desc ) } -export default EmplyeeCard +export default EmployeeCard diff --git a/src/components/molecules/EmplyeeStack/index.test.tsx b/src/components/molecules/EmplyeeStack/index.test.tsx index eda2731..f2bb17c 100644 --- a/src/components/molecules/EmplyeeStack/index.test.tsx +++ b/src/components/molecules/EmplyeeStack/index.test.tsx @@ -8,7 +8,7 @@ import EmplyeeStack from './index' // Mock EmplyeeCard to make click handling deterministic in tests vi.mock('components/molecules/EmplyeeCard/index.js', () => ({ // eslint-disable-next-line @typescript-eslint/no-explicit-any - EmplyeeCard: (props: any) => ( + EmployeeCard: (props: any) => (
props.onClick?.(e, { title: props.name, image: props.image, position: props.position, ...(props.description || {}) })}> diff --git a/src/components/molecules/EmplyeeStack/index.tsx b/src/components/molecules/EmplyeeStack/index.tsx index a95dd26..87fb228 100644 --- a/src/components/molecules/EmplyeeStack/index.tsx +++ b/src/components/molecules/EmplyeeStack/index.tsx @@ -2,7 +2,7 @@ import { FC, useState } from 'react' import { Box, IconButton } from '@mui/material' import ShuffleIcon from '@mui/icons-material/NextPlan' -import { EmplyeeCard, EmployeeCardProps } from 'components/molecules/EmplyeeCard/index.js' +import { EmployeeCard, EmployeeCardProps } from 'components/molecules/EmplyeeCard/index.js' import { EmployeeDescription } from 'components/molecules/EmployeeDescription/index.js' interface Props { @@ -35,7 +35,7 @@ const EmplyeeStack: FC = ({ } if (items.length === 0) return null - if (items.length === 1) return + if (items.length === 1) return return ( = ({ height: 360 + offsetStep * Math.min(initialItems.length - 1, maxVisible), }}> {items.slice(0, maxVisible).map((props, idx) => ( -