From 2b8d0fa88ba9023c0f7534eaf4b57b590a7dcd81 Mon Sep 17 00:00:00 2001 From: IDONTSUDO Date: Tue, 16 Apr 2024 15:44:31 +0300 Subject: [PATCH] icons add --- ui/src/core/ui/icons/icons.tsx | 213 +++++++++++++++++++++++++++++ ui/src/core/ui/pages/main_page.tsx | 21 +-- 2 files changed, 224 insertions(+), 10 deletions(-) diff --git a/ui/src/core/ui/icons/icons.tsx b/ui/src/core/ui/icons/icons.tsx index a065fee..9952268 100644 --- a/ui/src/core/ui/icons/icons.tsx +++ b/ui/src/core/ui/icons/icons.tsx @@ -43,6 +43,219 @@ export function Icon(props: IIconsProps) { } const getIconSvg = (type: string): Result => { switch (type) { + case "": + return Result.ok(); + case "Setting": + return Result.ok( + + + + + + + + + + + ); + case "Assembly": + return Result.ok( + + + + + + + + ); + case "Datasets": + return Result.ok( + + + + + + + + + + ); + case "Layers": + return Result.ok( + + + + + + ); + + case "Rocket": + return Result.ok( + + + + + + + + + ); + case "Simulation": + return Result.ok( + + + + + + + + + ); + case "Grade": + return Result.ok( + + + + + + + + + + + + ); case "DeleteCircle": return Result.ok( diff --git a/ui/src/core/ui/pages/main_page.tsx b/ui/src/core/ui/pages/main_page.tsx index f21ff14..07efdef 100644 --- a/ui/src/core/ui/pages/main_page.tsx +++ b/ui/src/core/ui/pages/main_page.tsx @@ -14,6 +14,7 @@ export interface IBlockProps { name: string; isActive: boolean; path: string; + icon?: string; } const Block = (props: IBlockProps) => { const navigate = useNavigate(); @@ -35,7 +36,7 @@ const Block = (props: IBlockProps) => { : { textAlignLast: "center", alignContent: "center" } } > - +
{props.name}
@@ -48,17 +49,17 @@ export interface IMainPageProps { } export const MainPage = (props: IMainPageProps) => { const blocksNames = [ - { name: "Детали", path: DetailsScreenPath }, - { name: "Сборки", path: AssemblesScreenPath }, - { name: "Датасеты", path: DatasetsScreenPath }, - { name: "Сцена", path: SceneManagerPath }, - { name: "Навыки", path: BehaviorTreeBuilderPath }, - { name: "Симуляция", path: SimulationScreenPath }, - { name: "Оценка", path: EstimateScreenPath }, + { name: "Детали", path: DetailsScreenPath, icon: "Setting" }, + { name: "Сборки", path: AssemblesScreenPath, icon: "Assembly" }, + { name: "Датасеты", path: DatasetsScreenPath, icon: "Datasets" }, + { name: "Сцена", path: SceneManagerPath, icon: "Layers" }, + { name: "Навыки", path: BehaviorTreeBuilderPath, icon: "Rocket" }, + { name: "Симуляция", path: SimulationScreenPath, icon: "Simulation" }, + { name: "Оценка", path: EstimateScreenPath, icon: "Grade" }, ]; const blocks: IBlockProps[] = blocksNames .map((el) => { - return { name: el.name, isActive: false, path: el.path }; + return Object.assign({ isActive: false }, el); }) .map((el) => { if (el.name.isEqual(props.page)) { @@ -104,7 +105,7 @@ export const MainPage = (props: IMainPageProps) => {
{blocks.map((el) => ( - + ))}