mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added new flow presets
This commit is contained in:
parent
4e5a6d727a
commit
5cd1064140
18 changed files with 64 additions and 45 deletions
|
@ -3,7 +3,7 @@ import React, { FC, Fragment } from 'react';
|
|||
import classNames from 'classnames';
|
||||
|
||||
import { FlowCell } from '~/components/flow/FlowCell';
|
||||
import { PRESETS, URLS } from '~/constants/urls';
|
||||
import { flowDisplayToPreset, ImagePresets, URLS } from '~/constants/urls';
|
||||
import { FlowDisplay, IFlowNode, INode } from '~/types';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { getURLFromString } from '~/utils/dom';
|
||||
|
@ -30,7 +30,7 @@ export const FlowGrid: FC<Props> = ({ user, nodes, onChangeCellView }) => {
|
|||
id={node.id}
|
||||
color={node.flow.dominant_color}
|
||||
to={URLS.NODE_URL(node.id)}
|
||||
image={getURLFromString(node.thumbnail, PRESETS.cover)}
|
||||
image={getURLFromString(node.thumbnail, flowDisplayToPreset[node.flow.display])}
|
||||
flow={node.flow}
|
||||
text={node.description}
|
||||
title={node.title}
|
||||
|
|
|
@ -7,7 +7,7 @@ import SwiperClass from 'swiper/types/swiper-class';
|
|||
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { LoaderCircle } from '~/components/input/LoaderCircle';
|
||||
import { PRESETS, URLS } from '~/constants/urls';
|
||||
import { ImagePresets, URLS } from '~/constants/urls';
|
||||
import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
||||
import { useNavigation } from '~/hooks/navigation/useNavigation';
|
||||
import { IFlowNode } from '~/types';
|
||||
|
@ -39,7 +39,7 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
|
|||
|
||||
const [controlledSwiper, setControlledSwiper] = useState<SwiperClass | undefined>(undefined);
|
||||
const [currentIndex, setCurrentIndex] = useState(heroes.length);
|
||||
const preset = useMemo(() => (innerWidth <= 768 ? PRESETS.cover : PRESETS.small_hero), [
|
||||
const preset = useMemo(() => (innerWidth <= 768 ? ImagePresets.cover : ImagePresets.small_hero), [
|
||||
innerWidth,
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue