Skip to content

Commit

Permalink
feat: Add VacancyFound
Browse files Browse the repository at this point in the history
  • Loading branch information
Katiene Souza committed Oct 16, 2023
1 parent 3bb1bed commit 578ff26
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/components/VacanciesFound/VacanciesFound.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { render, screen } from '@testing-library/react';
import { expect } from '@jest/globals';
import VacanciesFound from './VacanciesFound';

describe('VacanciesFound component', () => {
let container: HTMLElement;

beforeEach(() => {
container = render(<VacanciesFound allVacancies={'255'} />).container;
});

it('should be defined', () => {
expect(container).toBeDefined();
});
it('to be render allVacancies', () => {
screen.getByText('255 vagas encontradas');
});
});
29 changes: 29 additions & 0 deletions src/components/VacanciesFound/VacanciesFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Text from '@components/Text';
import * as S from './styles';

type props = {
allVacancies: string;
};

const VacanciesFound = ({ allVacancies }: props) => {
return (
<S.Container>
<Text
label={
<p>
Vagas em <b>React</b>
</p>
}
fontSize="large"
fontColor="purple-dark"
/>
<Text
label={`${allVacancies} vagas encontradas`}
fontSize="medium"
fontColor="dark-gray"
/>
</S.Container>
);
};

export default VacanciesFound;
1 change: 1 addition & 0 deletions src/components/VacanciesFound/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './VacanciesFound';
15 changes: 15 additions & 0 deletions src/components/VacanciesFound/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styled from 'styled-components';

export const Container = styled.section`
display: flex;
flex-direction: column;
padding: 3rem 0px 0px 8.438rem;
.text {
justify-content: flex-start;
}
b {
font-weight: bold;
}
`;
2 changes: 2 additions & 0 deletions src/pages/VacanciesPage/VacanciesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useResource from '@hooks/useResource';
import useFetchResource from '@hooks/useFetchResource';

import * as S from './styles';
import VacanciesFound from '@components/VacanciesFound';

const VacanciesPage = () => {
const { query } = useContext(queryContext);
Expand All @@ -27,6 +28,7 @@ const VacanciesPage = () => {
return (
<S.VacanciesPage data-cy="vacancies-page">
<SearchBar />
<VacanciesFound allVacancies={'255'} />
<S.Content>
<Filter />
<S.VacancyChartContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default createGlobalStyle`
--purple-dark-secondary: #6950A1;
--white: #FFFFFF;
--gray: #A6A8AB;
--dark-grey: #4A4A68;
--dark-gray: #4A4A68;
--gray-medium: #8C8CA1;
--gray-light: #D1D1D1;
--yellow: #FBB04D;
Expand Down

0 comments on commit 578ff26

Please sign in to comment.