mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Add Icons page for devs
This commit is contained in:
parent
b5afb6e242
commit
4a56fd3029
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -98,6 +98,7 @@
|
|||
"moprho",
|
||||
"multiword",
|
||||
"mypy",
|
||||
"nocheck",
|
||||
"nomn",
|
||||
"nooverlap",
|
||||
"NPRO",
|
||||
|
|
|
@ -2,6 +2,7 @@ import { createBrowserRouter } from 'react-router-dom';
|
|||
|
||||
import CreateItemPage from '@/pages/CreateItemPage';
|
||||
import HomePage from '@/pages/HomePage';
|
||||
import IconsPage from '@/pages/IconsPage';
|
||||
import LibraryPage from '@/pages/LibraryPage';
|
||||
import LoginPage from '@/pages/LoginPage';
|
||||
import ManualsPage from '@/pages/ManualsPage';
|
||||
|
@ -62,6 +63,10 @@ export const Router = createBrowserRouter([
|
|||
path: `${routes.oss}/:id`,
|
||||
element: <OssPage />
|
||||
},
|
||||
{
|
||||
path: `${routes.icons}`,
|
||||
element: <IconsPage />
|
||||
},
|
||||
{
|
||||
path: routes.manuals,
|
||||
element: <ManualsPage />
|
||||
|
|
|
@ -18,7 +18,8 @@ export const routes = {
|
|||
manuals: 'manuals',
|
||||
help: 'manuals',
|
||||
rsforms: 'rsforms',
|
||||
oss: 'oss'
|
||||
oss: 'oss',
|
||||
icons: 'icons'
|
||||
};
|
||||
|
||||
interface SchemaProps {
|
||||
|
|
|
@ -127,7 +127,7 @@ export interface IconProps {
|
|||
className?: string;
|
||||
}
|
||||
|
||||
function IconSVG({ viewBox, size = '1.5rem', className, props, children }: IconSVGProps) {
|
||||
function MetaIconSVG({ viewBox, size = '1.5rem', className, props, children }: IconSVGProps) {
|
||||
return (
|
||||
<svg
|
||||
width={size}
|
||||
|
@ -144,18 +144,18 @@ function IconSVG({ viewBox, size = '1.5rem', className, props, children }: IconS
|
|||
|
||||
export function IconManuals(props: IconProps) {
|
||||
return (
|
||||
<IconSVG viewBox='0 0 20 20' {...props}>
|
||||
<MetaIconSVG viewBox='0 0 20 20' {...props}>
|
||||
<path d='M3.33 8L10 12l10-6-10-6L0 6h10v2H3.33zM0 8v8l2-2.22V9.2L0 8zm10 12l-5-3-2-1.2v-6l7 4.2 7-4.2v6L10 20z' />
|
||||
</IconSVG>
|
||||
</MetaIconSVG>
|
||||
);
|
||||
}
|
||||
|
||||
export function IconLogin(props: IconProps) {
|
||||
return (
|
||||
<IconSVG viewBox='0 0 24 24' {...props}>
|
||||
<MetaIconSVG viewBox='0 0 24 24' {...props}>
|
||||
<path fill='none' d='M0 0h24v24H0z' />
|
||||
<path d='M10 11H4V3a1 1 0 011-1h14a1 1 0 011 1v18a1 1 0 01-1 1H5a1 1 0 01-1-1v-8h6v3l5-4-5-4v3z' />
|
||||
</IconSVG>
|
||||
</MetaIconSVG>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
24
rsconcept/frontend/src/pages/IconsPage.tsx
Normal file
24
rsconcept/frontend/src/pages/IconsPage.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-nocheck
|
||||
import * as icons from '@/components/Icons';
|
||||
|
||||
export function IconsPage() {
|
||||
return (
|
||||
<div className='flex flex-col items-center px-6 py-3'>
|
||||
<h1 className='mb-6'>Список иконок</h1>
|
||||
<div className='grid grid-cols-4'>
|
||||
{Object.keys(icons)
|
||||
.filter(key => key.startsWith('Icon'))
|
||||
.map((key, index) => (
|
||||
<div key={`icons_list_${index}`} className='flex flex-col items-center px-3 pb-6'>
|
||||
<p>{icons[key]({ size: '2rem' })}</p>
|
||||
<p>{key}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default IconsPage;
|
Loading…
Reference in New Issue
Block a user