1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

made colorfull lab nodes

This commit is contained in:
Fedor Katurov 2021-10-07 18:22:03 +07:00
parent ba4bf28834
commit 779012a418
6 changed files with 43 additions and 15 deletions

View file

@ -5,6 +5,7 @@ import styles from './styles.module.scss';
import { LabBottomPanel } from '~/components/lab/LabBottomPanel';
import { isAfter, parseISO } from 'date-fns';
import classNames from 'classnames';
import { useColorGradientFromString } from '~/utils/hooks/useColorGradientFromString';
interface IProps {
node: INode;
@ -22,8 +23,10 @@ const LabNode: FC<IProps> = ({ node, isLoading, lastSeen, commentCount }) => {
[node.commented_at, lastSeen]
);
const background = useColorGradientFromString(node.is_heroic ? node.title : '', 3, 2);
return (
<div className={classNames(styles.wrap, { [styles.heroic]: node.is_heroic })}>
<div className={classNames(styles.wrap)} style={{ background }}>
{lab}
<LabBottomPanel
node={node}