mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
Enable public website sharing.
This commit is contained in:
parent
48a524e09c
commit
560f1316c1
36 changed files with 294 additions and 61 deletions
27
components/common/Checkbox.js
Normal file
27
components/common/Checkbox.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import React, { useRef } from 'react';
|
||||
import Icon from 'components/common/Icon';
|
||||
import Check from 'assets/check.svg';
|
||||
import styles from './Checkbox.module.css';
|
||||
|
||||
export default function Checkbox({ name, value, label, onChange }) {
|
||||
const ref = useRef();
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.checkbox} onClick={() => ref.current.click()}>
|
||||
{value && <Icon icon={<Check />} size="small" />}
|
||||
</div>
|
||||
<label className={styles.label} htmlFor={name}>
|
||||
{label}
|
||||
</label>
|
||||
<input
|
||||
ref={ref}
|
||||
className={styles.input}
|
||||
type="checkbox"
|
||||
name={name}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue