import React from "react"; import { useTranslation } from "react-i18next"; import { Button, f7, Icon, Range, Sheet } from 'framework7-react'; import SvgIcon from '../../../../common/mobile//lib/component/SvgIcon' import IconDrawPen from '../../../../common/mobile/resources/icons/draw-pen.svg' import IconDrawHighlighter from '../../../../common/mobile/resources/icons/draw-highlighter.svg' import IconClearAll from '../../../../common/mobile/resources/icons/clear-all.svg' import IconClearObject from '../../../../common/mobile/resources/icons/clear-object.svg' import IconScroll from '../../../../common/mobile/resources/icons/scroll.svg' import { WheelColorPicker } from "../component/WheelColorPicker"; import { Device } from "../../utils/device"; export const DrawView = ({ currentTool, setTool, settings, setSettings, colors, addCustomColor, enableErasing }) => { const { t } = useTranslation(); const _t = t('Draw', { returnObjects: true }); const isDrawingTool = currentTool === 'pen' || currentTool === 'highlighter'; return ( {isDrawingTool && (<> f7.sheet.open('.draw-sheet--settings')}>
{_t.textCustomColor}
{ f7.sheet.close('.draw-sheet--color-picker') addCustomColor(color) }} />
{_t.textColor}
{colors.map((color, index) => (
setSettings({ color })} onTouchStart={() => setSettings({ color })} /> ))}
{ f7.sheet.close('.draw-sheet--settings') f7.sheet.open('.draw-sheet--color-picker') }} >
{_t.textLineSize}
{/*{Device.android ? (*/} setSettings({ lineSize: value })} /> {/*) : (*/} {/* setSettings({ lineSize: parseInt(e.target.value) })} />*/} {/* )}*/}
{_t.textOpacity}
setSettings({ opacity: parseInt(e.target.value) })}/>
)}
) }