mirror of https://github.com/mifi/lossless-cut
Make hand icons point up towards timeline #625
parent
5534574df7
commit
d2caed1f09
@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
|
||||
import { getSegColors } from '../util/colors';
|
||||
|
||||
const SegmentCutpointButton = ({ currentCutSeg, side, Icon, onClick, title, style }) => {
|
||||
const {
|
||||
segActiveBgColor: currentSegActiveBgColor,
|
||||
segBorderColor: currentSegBorderColor,
|
||||
} = getSegColors(currentCutSeg);
|
||||
|
||||
const start = side === 'start';
|
||||
const border = `4px solid ${currentSegBorderColor}`;
|
||||
|
||||
return (
|
||||
<Icon
|
||||
size={13}
|
||||
title={title}
|
||||
role="button"
|
||||
style={{ color: 'white', padding: start ? '4px 4px 4px 2px' : '4px 2px 4px 4px', borderLeft: start && border, borderRight: !start && border, background: currentSegActiveBgColor, borderRadius: 6, ...style }}
|
||||
onClick={onClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default SegmentCutpointButton;
|
||||
@ -1,25 +1,12 @@
|
||||
import React from 'react';
|
||||
import { FaHandPointUp } from 'react-icons/fa';
|
||||
|
||||
import { getSegColors } from '../util/colors';
|
||||
import SegmentCutpointButton from './SegmentCutpointButton';
|
||||
import { mirrorTransform } from '../util';
|
||||
|
||||
const SetCutpointButton = ({ currentCutSeg, side, Icon, onClick, title, style }) => {
|
||||
const {
|
||||
segActiveBgColor: currentSegActiveBgColor,
|
||||
segBorderColor: currentSegBorderColor,
|
||||
} = getSegColors(currentCutSeg);
|
||||
|
||||
const start = side === 'start';
|
||||
const border = `4px solid ${currentSegBorderColor}`;
|
||||
|
||||
return (
|
||||
<Icon
|
||||
size={13}
|
||||
title={title}
|
||||
role="button"
|
||||
style={{ color: 'white', padding: start ? '4px 4px 4px 2px' : '4px 2px 4px 4px', borderLeft: start && border, borderRight: !start && border, background: currentSegActiveBgColor, borderRadius: 6, ...style }}
|
||||
onClick={onClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
// constant side because we are mirroring
|
||||
const SetCutpointButton = ({ currentCutSeg, side, title, onClick, style }) => (
|
||||
<SegmentCutpointButton currentCutSeg={currentCutSeg} side="end" Icon={FaHandPointUp} onClick={onClick} title={title} style={{ transform: side === 'start' ? mirrorTransform : undefined, ...style }} />
|
||||
);
|
||||
|
||||
export default SetCutpointButton;
|
||||
|
||||
Loading…
Reference in New Issue