From 7307c2a67a055c76bc9ae1dd0b68ca6848f20a3b Mon Sep 17 00:00:00 2001 From: Ilya Andriyanov Date: Fri, 20 Dec 2024 16:40:52 +0300 Subject: [PATCH] feature: added empty sets texts --- .../components/alert_window/alert_window.scss | 8 +++++ .../components/alert_window/alert_window.tsx | 8 +++-- .../components/item_list/item_list.tsx | 1 + .../pages/not_found_page/not_found_page.scss | 30 +++++++++++++++++++ .../pages/not_found_page/not_found_page.tsx | 16 +++++++++- .../pages/vacancies_page/vacancies_page.scss | 4 +++ .../pages/vacancies_page/vacancies_page.tsx | 5 ++++ 7 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/application/pages/not_found_page/not_found_page.scss diff --git a/src/application/components/alert_window/alert_window.scss b/src/application/components/alert_window/alert_window.scss index 07954a1..fcc319f 100644 --- a/src/application/components/alert_window/alert_window.scss +++ b/src/application/components/alert_window/alert_window.scss @@ -11,4 +11,12 @@ &__text { font-size: var(--text-size-3); } + + &__header { + font-size: var(--text-size-7); + font-weight: var(--text-weight-bold); + color: var(--color-main-100); + margin: 0; + text-align: center; + } } diff --git a/src/application/components/alert_window/alert_window.tsx b/src/application/components/alert_window/alert_window.tsx index 9206517..5c32186 100644 --- a/src/application/components/alert_window/alert_window.tsx +++ b/src/application/components/alert_window/alert_window.tsx @@ -7,14 +7,18 @@ export interface AlertWindowProps { text: string; href: string; buttonText: string; + header?: string; } export class AlertWindow extends Component { - constructor({ elementClass, text, href, buttonText }: AlertWindowProps) { - super({ elementClass, text, href, buttonText }); + constructor({ elementClass, text, href, buttonText, header = '' }: AlertWindowProps) { + super({ elementClass, text, href, buttonText, header }); } render() { return (
+ {(this.props.header || false) && ( +
{this.props.header}
+ )}
{this.props.text}
{this.props.buttonText} diff --git a/src/application/components/item_list/item_list.tsx b/src/application/components/item_list/item_list.tsx index 94810d5..a791dab 100644 --- a/src/application/components/item_list/item_list.tsx +++ b/src/application/components/item_list/item_list.tsx @@ -31,6 +31,7 @@ export class ItemList extends Component { }); return (
+ {listItems && listItems.length === 0 && 'Пока ничего нет'} {this.props.isOwner && (
{this.props.url.toString()} Not Found (404)
; + return ( +
+ +
+ ); } } diff --git a/src/application/pages/vacancies_page/vacancies_page.scss b/src/application/pages/vacancies_page/vacancies_page.scss index 8321ab6..9296495 100644 --- a/src/application/pages/vacancies_page/vacancies_page.scss +++ b/src/application/pages/vacancies_page/vacancies_page.scss @@ -67,6 +67,10 @@ background-color: var(--color-background-900); color: var(--color-main-100); } + + &__no-vacancies { + font-size: var(--text-size-5); + } } /* Vacancy-container component */ diff --git a/src/application/pages/vacancies_page/vacancies_page.tsx b/src/application/pages/vacancies_page/vacancies_page.tsx index 266f8c6..25a755c 100644 --- a/src/application/pages/vacancies_page/vacancies_page.tsx +++ b/src/application/pages/vacancies_page/vacancies_page.tsx @@ -136,6 +136,11 @@ export class VacanciesPage extends Component { {this.getVacancyHeader(this.searchQuery, this.searchCategory)}
+ {vacancyCards.length === 0 && ( +
+ По вашему запросу ничего не найдено +
+ )} {...vacancyCards}