Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrad77 committed Oct 29, 2024
1 parent a27a8fb commit 142f95a
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 53 deletions.
45 changes: 0 additions & 45 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,6 @@ import './Controller.css';
import { Controller } from './Controller';
import { Projector } from './Projector';

export const defaultVideos = [
{
id: 'video-1',
show: false,
position: { top: '5%', left: '10%' },
size: { width: '320px', height: '180px' },
},
{
id: 'video-2',
show: false,
position: { top: '37%', left: '10%' },
size: { width: '320px', height: '180px' },
},
{
id: 'video-3',
show: false,
position: { top: '70%', left: '10%' },
size: { width: '320px', height: '180px' },
},
];

export const defaultCounters = [
{
id: 'counter-1',
count: 0,
show: false,
position: { top: '0%', left: '60%' },
size: '4em',
},
{
id: 'counter-2',
count: 0,
show: false,
position: { top: '30%', left: '60%' },
size: '4em',
},
{
id: 'counter-3',
count: 0,
show: false,
position: { top: '60%', left: '60%' },
size: '4em',
},
];

export default function App() {
return (
<Router>
Expand Down
24 changes: 19 additions & 5 deletions src/renderer/Controller.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
/* eslint-disable import/prefer-default-export */
/* eslint-disable no-else-return */
import { useState } from 'react';
import type { Counter, Position, Size, Video } from './types';
import { defaultCounters, defaultVideos } from './App';
import { defaultCounters, defaultVideos } from './const';

// Controller Component
export function Controller() {
Expand Down Expand Up @@ -119,7 +122,9 @@ export function Controller() {
return (
<div className="ctrl-controller-container">
<h1>Theater VFX Controller</h1>
<button onClick={handleResetAll}>Reset to Defaults</button>{' '}
<button type="button" onClick={handleResetAll}>
Reset to Defaults
</button>{' '}
<div className="ctrl-video-name-controls" style={{ display: 'none' }}>
<label>
Select Eye:
Expand Down Expand Up @@ -251,13 +256,22 @@ export function Controller() {
)}
{counter.show && (
<div className="ctrl-counter-controls">
<button onClick={() => handleCounterChange(index, 1)}>
<button
type="button"
onClick={() => handleCounterChange(index, 1)}
>
+
</button>
<button onClick={() => handleCounterChange(index, -1)}>
<button
type="button"
onClick={() => handleCounterChange(index, -1)}
>
-
</button>
<button onClick={() => handleResetCounter(index)}>
<button
type="button"
onClick={() => handleResetCounter(index)}
>
Reset
</button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/Projector.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable import/prefer-default-export */
import { useEffect, useState } from 'react';
// import eye1 from '../../assets/media/eye1.mp4';
import eye2 from '../../assets/media/eye2.mp4';
import type { Counter, Video } from './types';

// Projector Component
export function Projector() {
const [eye, setEye] = useState<string>(
const [, setEye] = useState<string>(
() => localStorage.getItem('eye') || 'eye1',
);

Expand Down
44 changes: 44 additions & 0 deletions src/renderer/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const defaultVideos = [
{
id: 'video-1',
show: false,
position: { top: '5%', left: '10%' },
size: { width: '320px', height: '180px' },
},
{
id: 'video-2',
show: false,
position: { top: '37%', left: '10%' },
size: { width: '320px', height: '180px' },
},
{
id: 'video-3',
show: false,
position: { top: '70%', left: '10%' },
size: { width: '320px', height: '180px' },
},
];

export const defaultCounters = [
{
id: 'counter-1',
count: 0,
show: false,
position: { top: '0%', left: '60%' },
size: '4em',
},
{
id: 'counter-2',
count: 0,
show: false,
position: { top: '30%', left: '60%' },
size: '4em',
},
{
id: 'counter-3',
count: 0,
show: false,
position: { top: '60%', left: '60%' },
size: '4em',
},
];
4 changes: 2 additions & 2 deletions src/renderer/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type Position = { top: string; left: string; };
export type Size = { width: string; height: string; };
export type Position = { top: string; left: string };
export type Size = { width: string; height: string };

export type Video = {
id: string;
Expand Down

0 comments on commit 142f95a

Please sign in to comment.