Skip to content

YH-2318: add IndustryTabs widget - #1371

Open
ally-razum wants to merge 4 commits into
developfrom
feature/YH-2318
Open

YH-2318: add IndustryTabs widget#1371
ally-razum wants to merge 4 commits into
developfrom
feature/YH-2318

Conversation

@ally-razum

Copy link
Copy Markdown
Collaborator

A widget has been created that displays a list of available industries for filtering specializations.

@ally-razum ally-razum added review the task is currently being reviewed feature New functionality or improvements labels Aug 16, 2026
};

return (
<Flex direction="row" align="center" gap="10" className={styles.container}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ISSUE] - Я предполагал, что будет использоваться готовый компонент Tabs
Так что можешь вот как сделать

export const IndustryTabs = ({ availableIndustries = [] }: IndustryTabsProps) => {
	const location = useLocation();

	const tabs: Tab<string>[] = [
		{ id: 'all', label: 'Все', Component: () => <div /> },
		...availableIndustries.map((industry) => ({
			id: industry,
			label: industry,
			Component: () => <div />,
		})),
	];

	const currentHash = location.hash ? location.hash.replace('#', '') : 'all';

	const currentTab = tabs.find((tab) => tab.id === currentHash) ?? tabs[0];

	const [activeTab, setActiveTab] = useState(currentTab);

	useEffect(() => {
		setActiveTab(currentTab);
	}, [currentTab]);

	if (!availableIndustries.length) {
		return null;
	}

	return <Tabs tabs={tabs} activeTab={activeTab} setActiveTab={setActiveTab} />;
};

Соответственно все лишнее можешь удалить, включая файл со стилями

@PerelomaDenis PerelomaDenis added comments Code improvements are required and removed review the task is currently being reviewed labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Code improvements are required feature New functionality or improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants