mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
grid recent card initial
This commit is contained in:
parent
746d10ce8b
commit
6f76bec2c0
5 changed files with 65 additions and 8 deletions
|
@ -16,14 +16,21 @@ type IProps = Partial<IFlowState> & {
|
||||||
onChangeCellView: typeof flowSetCellView;
|
onChangeCellView: typeof flowSetCellView;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FlowGrid: FC<IProps> = ({ user, nodes, heroes, recent, onSelect, onChangeCellView }) => (
|
export const FlowGrid: FC<IProps> = ({
|
||||||
|
user,
|
||||||
|
nodes,
|
||||||
|
heroes,
|
||||||
|
recent,
|
||||||
|
onSelect,
|
||||||
|
onChangeCellView,
|
||||||
|
}) => (
|
||||||
<div>
|
<div>
|
||||||
<div className={styles.grid_test}>
|
<div className={styles.grid_test}>
|
||||||
<div className={styles.hero}>
|
<div className={styles.hero}>
|
||||||
<FlowHero heroes={heroes} />
|
<FlowHero heroes={heroes} />
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.stamp}>
|
<div className={styles.stamp}>
|
||||||
<FlowRecent />
|
<FlowRecent recent={recent} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{nodes.map(node => (
|
{nodes.map(node => (
|
||||||
|
|
|
@ -73,7 +73,7 @@ $cols: $content_width / $cell;
|
||||||
|
|
||||||
.stamp {
|
.stamp {
|
||||||
// grid-row: -1 / 3;
|
// grid-row: -1 / 3;
|
||||||
grid-row-end: span 3;
|
grid-row-end: span 2;
|
||||||
grid-column: -2 / -1;
|
grid-column: -2 / -1;
|
||||||
background: darken($content_bg, 8%);
|
background: darken($content_bg, 8%);
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
|
@ -82,4 +82,7 @@ $cols: $content_width / $cell;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font: $font_24_semibold;
|
font: $font_24_semibold;
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: stretch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,21 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import * as styles from './styles.scss';
|
import * as styles from './styles.scss';
|
||||||
|
import { IFlowState } from '~/redux/flow/reducer';
|
||||||
|
|
||||||
interface IProps {}
|
interface IProps {
|
||||||
|
recent: IFlowState['recent'];
|
||||||
|
}
|
||||||
|
|
||||||
const FlowRecent: FC<IProps> = ({}) => <div className={styles.grid} />;
|
const FlowRecent: FC<IProps> = ({ recent }) => (
|
||||||
|
<div className={styles.grid}>
|
||||||
|
{recent &&
|
||||||
|
recent.slice(0, 9).map(node => (
|
||||||
|
<div key={node.id} className={styles.item}>
|
||||||
|
<div className={styles.thumb} />
|
||||||
|
<div className={styles.info}>{node.title}</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
export { FlowRecent };
|
export { FlowRecent };
|
||||||
|
|
|
@ -1,3 +1,36 @@
|
||||||
.grid {
|
.grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
grid-template-rows: repeat(9, 1fr);
|
||||||
|
grid-template-columns: auto;
|
||||||
|
row-gap: $grid_line;
|
||||||
|
justify-content: stretch;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
// background: $content_bg;
|
||||||
|
// @include outer_shadow();
|
||||||
|
// background: darken($content_bg, 4%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font: $font_12_regular;
|
||||||
|
border-radius: $radius;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb {
|
||||||
|
height: 100%;
|
||||||
|
width: 40px;
|
||||||
|
margin-right: $grid_line;
|
||||||
|
// padding-left: 100%;
|
||||||
|
background: red;
|
||||||
|
// flex:
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@ import pick from 'ramda/es/pick';
|
||||||
import { selectUser } from '~/redux/auth/selectors';
|
import { selectUser } from '~/redux/auth/selectors';
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
flow: pick(['nodes', 'heroes'], selectFlow(state)),
|
flow: pick(['nodes', 'heroes', 'recent'], selectFlow(state)),
|
||||||
user: pick(['role', 'id'], selectUser(state)),
|
user: pick(['role', 'id'], selectUser(state)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ const mapDispatchToProps = {
|
||||||
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
|
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
|
||||||
|
|
||||||
const FlowLayoutUnconnected: FC<IProps> = ({
|
const FlowLayoutUnconnected: FC<IProps> = ({
|
||||||
flow: { nodes, heroes },
|
flow: { nodes, heroes, recent },
|
||||||
user,
|
user,
|
||||||
nodeLoadNode,
|
nodeLoadNode,
|
||||||
flowSetCellView,
|
flowSetCellView,
|
||||||
|
@ -28,6 +28,7 @@ const FlowLayoutUnconnected: FC<IProps> = ({
|
||||||
<FlowGrid
|
<FlowGrid
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
heroes={heroes}
|
heroes={heroes}
|
||||||
|
recent={recent}
|
||||||
onSelect={nodeLoadNode}
|
onSelect={nodeLoadNode}
|
||||||
user={user}
|
user={user}
|
||||||
onChangeCellView={flowSetCellView}
|
onChangeCellView={flowSetCellView}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue