🎥 Make videos programmatically with React
awesome checkbiox
Jonny Burger4fae31df88f3
diff --git a/packages/cli/src/editor/components/Checkbox.tsx b/packages/cli/src/editor/components/Checkbox.tsxnew file mode 100644index 0000000000..8edbb9b28e--- /dev/null+++ b/packages/cli/src/editor/components/Checkbox.tsx@@ -0,0 +1,55 @@+import React from 'react';+import {+ INPUT_BACKGROUND,+ INPUT_BORDER_COLOR_UNHOVERED,+} from '../helpers/colors';+import {Checkmark} from '../icons/Checkmark';++const size = 24;++const background: React.CSSProperties = {+ height: size,+ width: size,+ position: 'relative',+};++const input: React.CSSProperties = {+ appearance: 'none',+ background: INPUT_BACKGROUND,+ border: '1px solid ' + INPUT_BORDER_COLOR_UNHOVERED,+ height: size,+ width: size,+ top: 0,+ left: 0,+ position: 'absolute',+ margin: 0,+};++const box: React.CSSProperties = {+ display: 'flex',+ justifyContent: 'center',+ alignItems: 'center',+ position: 'absolute',+ height: size,+ width: size,+ top: 0,+ left: 0,+ pointerEvents: 'none',+};++export const Checkbox: React.FC<{+ checked: boolean;+ onChange: React.ChangeEventHandler<HTMLInputElement>;+}> = ({checked, onChange}) => {+ return (+ <div style={background}>+ <input+ style={input}+ type={'checkbox'}+ checked={checked}+ onChange={onChange}+ />+ <div style={box}>{checked ? <Checkmark /> : null}</div>+ </div>+ );+};diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsxindex 88fb22f6ae..9fa562f5fd 100644--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx@@ -15,6 +15,7 @@ import type {TComposition} from 'remotion/src/internals';import {Button} from '../../../preview-server/error-overlay/remotion-overlay/Button';import {useFileExistence} from '../../helpers/use-file-existence';import {ModalsContext} from '../../state/modals';+import {Checkbox} from '../Checkbox';import {CollapsableOptions} from '../CollapsableOptions';import {Spacing} from '../layout';import {ModalContainer} from '../ModalContainer';@@ -563,8 +564,7 @@ export const RenderModal: React.FC<{<div style={optionRow}><div style={label}>Verbose logging</div><div style={rightRow}>- <input- type={'checkbox'}+ <Checkboxchecked={verbose}onChange={onVerboseLoggingChanged}/>@@ -666,11 +666,7 @@ export const RenderModal: React.FC<{<div style={optionRow}><div style={label}>Verbose logging</div><div style={rightRow}>- <input- type={'checkbox'}- checked={verbose}- onChange={onVerboseLoggingChanged}- />+ <Checkbox checked={verbose} onChange={onVerboseLoggingChanged} /></div></div></CollapsableOptions>diff --git a/packages/cli/src/editor/icons/Checkmark.tsx b/packages/cli/src/editor/icons/Checkmark.tsxindex 8cb6455544..5493eeda15 100644--- a/packages/cli/src/editor/icons/Checkmark.tsx+++ b/packages/cli/src/editor/icons/Checkmark.tsx@@ -6,17 +6,7 @@ const style: React.CSSProperties = {};export const Checkmark = () => (- <svg- aria-hidden="true"- focusable="false"- data-prefix="far"- data-icon="check"- className="svg-inline--fa fa-check fa-w-16"- role="img"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 512 512"- style={style}- >+ <svg focusable="false" role="img" viewBox="0 0 512 512" style={style}><pathfill="currentColor"d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"