feat: испытательный срок в подборе, дата приёма по приезду, HR-формы для тестировщиков
Tests / frontend-test (push) Successful in 1m19s
Tests / frontend-test (push) Successful in 1m19s
This commit is contained in:
@@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import styles from './RequestGrid.module.scss';
|
||||
import { Badge, Icon } from '@tnsu/ui-kit';
|
||||
import { IRequestType } from '../../models/types';
|
||||
import { useIsTester } from '../../shared/useIsTester';
|
||||
|
||||
interface IRequestGridProps {
|
||||
requests: IRequestType[];
|
||||
@@ -9,40 +10,47 @@ interface IRequestGridProps {
|
||||
}
|
||||
|
||||
export const RequestGrid: React.FC<IRequestGridProps> = ({ requests, onSelect }) => {
|
||||
// Группа «Тестирование» видит формы «в разработке» открытыми — чтобы проверять
|
||||
// их до запуска для всех (см. shared/useIsTester).
|
||||
const isTester = useIsTester() === true;
|
||||
|
||||
if (requests.length === 0) {
|
||||
return <p className={styles.empty}>В этой категории пока нет заявок.</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.grid}>
|
||||
{requests.map((request) => (
|
||||
<button
|
||||
key={request.id}
|
||||
type="button"
|
||||
className={request.comingSoon ? `${styles.tile} ${styles.tileDisabled}` : styles.tile}
|
||||
disabled={request.comingSoon}
|
||||
onClick={() => onSelect(request)}
|
||||
>
|
||||
<span className={styles.tileIcon}>
|
||||
<Icon name={request.icon} />
|
||||
</span>
|
||||
<span className={styles.tileBody}>
|
||||
<span className={styles.tileTitle}>{request.title}</span>
|
||||
{request.comingSoon ? (
|
||||
<Badge variant="muted" size="sm">
|
||||
В разработке
|
||||
</Badge>
|
||||
) : (
|
||||
request.description && <span className={styles.tileDesc}>{request.description}</span>
|
||||
)}
|
||||
</span>
|
||||
{!request.comingSoon && (
|
||||
<span className={styles.tileArrow}>
|
||||
<Icon name="chevron-right" size="sm" />
|
||||
{requests.map((request) => {
|
||||
const isLocked = !!request.comingSoon && !isTester;
|
||||
return (
|
||||
<button
|
||||
key={request.id}
|
||||
type="button"
|
||||
className={isLocked ? `${styles.tile} ${styles.tileDisabled}` : styles.tile}
|
||||
disabled={isLocked}
|
||||
onClick={() => onSelect(request)}
|
||||
>
|
||||
<span className={styles.tileIcon}>
|
||||
<Icon name={request.icon} />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
<span className={styles.tileBody}>
|
||||
<span className={styles.tileTitle}>{request.title}</span>
|
||||
{request.comingSoon ? (
|
||||
<Badge variant="muted" size="sm">
|
||||
В разработке
|
||||
</Badge>
|
||||
) : (
|
||||
request.description && <span className={styles.tileDesc}>{request.description}</span>
|
||||
)}
|
||||
</span>
|
||||
{!isLocked && (
|
||||
<span className={styles.tileArrow}>
|
||||
<Icon name="chevron-right" size="sm" />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user