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

fixed flow hero appearance

This commit is contained in:
Fedor Katurov 2019-11-05 16:57:40 +07:00
parent 56086e7c5f
commit aff052e66d
4 changed files with 45 additions and 16 deletions

View file

@ -100,7 +100,7 @@
.is_text { .is_text {
background: none; background: none;
padding: 10px; padding: 10px;
box-shadow: inset #444 0 0 0 1px; box-shadow: inset $cell_shade 0 0 0 1px;
} }
.thumbnail { .thumbnail {

View file

@ -1,4 +1,4 @@
import React, { FC, useState, useCallback, useEffect, useRef } from 'react'; import React, { FC, useState, useCallback, useEffect, useRef, useMemo } from 'react';
import { IFlowState } from '~/redux/flow/reducer'; import { IFlowState } from '~/redux/flow/reducer';
import classNames from 'classnames'; import classNames from 'classnames';
@ -70,22 +70,34 @@ const FlowHeroUnconnected: FC<IProps> = ({ heroes, history }) => {
history.push(URLS.NODE_URL(current)); history.push(URLS.NODE_URL(current));
}, [current]); }, [current]);
const title = useMemo(() => {
if (loaded.length === 0) return null;
const item = heroes.find(hero => hero.id === current);
if (!item || !item.title) return null;
return item.title;
}, [loaded, current, heroes]);
return ( return (
<div className={styles.wrap} onMouseOver={stopSliding} onFocus={stopSliding}> <div className={styles.wrap} onMouseOver={stopSliding} onFocus={stopSliding}>
<div className={styles.info}> {loaded && loaded.length > 0 && (
<div className={styles.title_wrap}> <div className={styles.info}>
<div className={styles.title}>TITLE!</div> <div className={styles.title_wrap}>
</div> <div className={styles.title}>{title}</div>
</div>
<div className={styles.buttons}> <div className={styles.buttons}>
<div className={styles.button} onClick={onPrevious}> <div className={styles.button} onClick={onPrevious}>
<Icon icon="left" /> <Icon icon="left" />
</div> </div>
<div className={styles.button} onClick={onNextPress}> <div className={styles.button} onClick={onNextPress}>
<Icon icon="right" /> <Icon icon="right" />
</div>
</div> </div>
</div> </div>
</div> )}
{heroes.slice(0, limit).map(hero => ( {heroes.slice(0, limit).map(hero => (
<div <div

View file

@ -27,6 +27,23 @@
pointer-events: none; pointer-events: none;
touch-action: none; touch-action: none;
} }
&::before {
content: ' ';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
182deg,
transparentize($cell_shade, 1) 50%,
transparentize($cell_shade, 0) 95%
);
z-index: 4;
pointer-events: none;
touch-action: none;
}
} }
.hero { .hero {
@ -90,13 +107,13 @@
.title { .title {
flex: 0; flex: 0;
height: 48px; height: 48px;
background: rgba(0, 0, 0, 0.7);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0 $gap; padding: 0 $gap 0 0;
border-radius: $radius; border-radius: $radius;
font: $font_hero_title; font: $font_hero_title;
text-transform: uppercase;
} }
.buttons { .buttons {

View file

@ -51,7 +51,7 @@ $node_title_background: darken($main_bg_color, 8%);
$editor_bg: $content_bg; $editor_bg: $content_bg;
$editor_panel_bg: darken($editor_bg, 4%); $editor_panel_bg: darken($editor_bg, 4%);
$cell_shade: lighten($content_bg, 10%);
$scroll_color: $red_gradient; $scroll_color: $red_gradient;
$scroll_inactive_opacity: 0.5; $scroll_inactive_opacity: 0.5;