mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +00:00
update single + small fixes
This commit is contained in:
@@ -13,6 +13,8 @@ export default function EventBlock(props) {
|
||||
const { data, selected, next, delay, index, eventsHandler } = props;
|
||||
|
||||
const [more, setMore] = useState(false);
|
||||
// NOTE: cheating to add responsiveness
|
||||
const [visible, setVisible] = useState(data.isPublic || false);
|
||||
|
||||
const updateValues = (field, value) => {
|
||||
// validate field
|
||||
@@ -52,9 +54,10 @@ export default function EventBlock(props) {
|
||||
updateValues('presenter', v);
|
||||
};
|
||||
|
||||
const handleVisibleToggle = (v) => {
|
||||
// setVisible(previousState => !previousState);
|
||||
updateValues('isPublic', !data.isPublic);
|
||||
const handleVisibleToggle = () => {
|
||||
let viz = !data.isPublic || !visible;
|
||||
setVisible(viz);
|
||||
updateValues('isPublic', viz);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -113,10 +116,7 @@ export default function EventBlock(props) {
|
||||
</div>
|
||||
</div>
|
||||
<div className={style.actionOverlay}>
|
||||
<VisibleIconBtn
|
||||
clickhandler={handleVisibleToggle}
|
||||
active={data.isPublic}
|
||||
/>
|
||||
<VisibleIconBtn clickhandler={handleVisibleToggle} active={visible} />
|
||||
<DeleteIconBtn clickhandler={deleteHandler} />
|
||||
<ActionButtons
|
||||
showAdd
|
||||
|
||||
@@ -33,6 +33,7 @@ export default function StageManager(props) {
|
||||
},
|
||||
};
|
||||
|
||||
console.log('debug', events)
|
||||
return (
|
||||
<div className={style.container__gray}>
|
||||
<NavLogo />
|
||||
|
||||
Reference in New Issue
Block a user