Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
SenexCrenshaw committed Oct 31, 2023
1 parent 5522d98 commit f25e59e
Show file tree
Hide file tree
Showing 74 changed files with 432 additions and 809 deletions.
4 changes: 2 additions & 2 deletions streammasterwebui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"browser": true,
"es2022": true
},
"extends": [ "react-app","prettier"],
"extends": ["react-app", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -29,4 +29,4 @@
"version": "18"
}
}
}
}
2 changes: 1 addition & 1 deletion streammasterwebui/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "ZixuanChen.vitest-explorer"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "ZixuanChen.vitest-explorer"]
}
5 changes: 1 addition & 4 deletions streammasterwebui/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"serverReadyAction": {
"pattern": "Local:.+(http://.+)",
"uriFormat": "http://%s",
Expand Down
100 changes: 45 additions & 55 deletions streammasterwebui/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
// "source.sortMembers": true
// "source.organizeImports": true
},

"emmet.excludeLanguages": [],
"emmet.includeLanguages": {
"markdown": "html",
"javascript": "javascriptreact",
"typescript": "typescriptreact"
},
"emmet.showSuggestionsAsSnippets": true,
"emmet.triggerExpansionOnTab": true,
"files.exclude": {
"**/*.js.map": {
"when": "$(basename)"
},
"**/node_modules": true,

"emmet.excludeLanguages": [],
"emmet.includeLanguages": {
"markdown": "html",
"javascript": "javascriptreact",
"typescript": "typescriptreact"
},
"emmet.showSuggestionsAsSnippets": true,
"emmet.triggerExpansionOnTab": true,
"files.exclude": {
"**/*.js.map": {
"when": "$(basename)"
},
"**/node_modules": true
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand All @@ -44,17 +44,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"eslint.validate": [
"css",
"html",
"javascript",
"javascriptreact",
"json",
"markdown",
"typescript",
"typescriptreact",
"yaml"
],
"eslint.validate": ["css", "html", "javascript", "javascriptreact", "json", "markdown", "typescript", "typescriptreact", "yaml"],
"html.customData": ["./node_modules/vidstack/vscode.html-data.json"],
"bookmarks.useWorkaroundForFormatters": true,
"bookmarks.saveBookmarksInProject": true,
Expand All @@ -63,34 +53,34 @@
"prettier.singleQuote": true,
"prettier.singleAttributePerLine": false,
"prettier.printWidth": 120,
"fileNestingUpdater.autoUpdate": true,
"fileNestingUpdater.autoUpdateInterval": 720,
"fileNestingUpdater.promptOnAutoUpdate": true,
"fileNestingUpdater.upstreamRepo": "antfu/vscode-file-nesting-config",
"fileNestingUpdater.upstreamBranch": "main",
"filesize.showGzipInStatusBar": true,
"gremlins.showInProblemPane": true,
"workbench.iconTheme": "material-icon-theme",
"powermode.combo.location": "off",
"powermode.enabled": true,
"powermode.explosions.duration": 300,
"powermode.explosions.size": 5,
"powermode.shake.enabled": false,
"template-string-converter.autoRemoveTemplateString": true,
"template-string-converter.addBracketsToProps": true,
"html.autoClosingTags": true,
"javascript.autoClosingTags": true,
"javascript.suggest.completeFunctionCalls": true,
"typescript.suggest.completeFunctionCalls": true,
"javascript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"javascript.inlayHints.parameterNames.enabled": "all",
"typescript.inlayHints.parameterNames.enabled": "all",
"javascript.suggest.autoImports": true,
"search.exclude": {
"**/coverage": true,
"**/node_modules": true
},
"typescript.autoClosingTags": true,
"typescript.suggest.autoImports": true,
"fileNestingUpdater.autoUpdate": true,
"fileNestingUpdater.autoUpdateInterval": 720,
"fileNestingUpdater.promptOnAutoUpdate": true,
"fileNestingUpdater.upstreamRepo": "antfu/vscode-file-nesting-config",
"fileNestingUpdater.upstreamBranch": "main",
"filesize.showGzipInStatusBar": true,
"gremlins.showInProblemPane": true,
"workbench.iconTheme": "material-icon-theme",
"powermode.combo.location": "off",
"powermode.enabled": true,
"powermode.explosions.duration": 300,
"powermode.explosions.size": 5,
"powermode.shake.enabled": false,
"template-string-converter.autoRemoveTemplateString": true,
"template-string-converter.addBracketsToProps": true,
"html.autoClosingTags": true,
"javascript.autoClosingTags": true,
"javascript.suggest.completeFunctionCalls": true,
"typescript.suggest.completeFunctionCalls": true,
"javascript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"javascript.inlayHints.parameterNames.enabled": "all",
"typescript.inlayHints.parameterNames.enabled": "all",
"javascript.suggest.autoImports": true,
"search.exclude": {
"**/coverage": true,
"**/node_modules": true
},
"typescript.autoClosingTags": true,
"typescript.suggest.autoImports": true
}
13 changes: 7 additions & 6 deletions streammasterwebui/components/ChannelHandlerSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ const ChannelHandlerSelector = ({ className: propertyClassName, onChange, value
const getHandlersOptions = (): SelectItem[] => {
const test = Object.entries(VideoStreamHandlers)
.splice(0, Object.keys(VideoStreamHandlers).length / 2)
.map(([number, word]) => ({
label: word,
value: number
} as SelectItem));
.map(
([number, word]) =>
({
label: word,
value: number
} as SelectItem)
);

return test;
};
Expand All @@ -57,12 +60,10 @@ const ChannelHandlerSelector = ({ className: propertyClassName, onChange, value
options={getHandlersOptions()}
placeholder="Handler"
style={{

backgroundColor: 'var(--mask-bg)',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'

}}
value={channelHandler.toString()}
virtualScrollerOptions={{
Expand Down
59 changes: 17 additions & 42 deletions streammasterwebui/components/InfoMessageOverLayDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,23 @@ import { Dialog } from 'primereact/dialog';
import { OverlayPanel } from 'primereact/overlaypanel';
import React, { useCallback, useEffect, useRef, useState } from 'react';

type Severity = 'error' | 'info' | 'success' | 'warn'
type Severity = 'error' | 'info' | 'success' | 'warn';

interface InfoMessageOverLayDialogProperties {
readonly blocked?: boolean
readonly children: React.ReactNode
readonly closable?: boolean
readonly header?: string
readonly infoMessage: string | undefined
readonly maximizable?: boolean
readonly onClose: () => void
readonly overlayColSize?: number
readonly severity?: Severity | null
readonly show: boolean
readonly blocked?: boolean;
readonly children: React.ReactNode;
readonly closable?: boolean;
readonly header?: string;
readonly infoMessage: string | undefined;
readonly maximizable?: boolean;
readonly onClose: () => void;
readonly overlayColSize?: number;
readonly severity?: Severity | null;
readonly show: boolean;
}

const InfoMessageOverLayDialog: React.FC<InfoMessageOverLayDialogProperties> = (
props
) => {
const {
blocked = false,
children,
closable = true,
header = '',
infoMessage,
maximizable = true,
onClose,
overlayColSize = 4,
severity,
show
} = props;
const InfoMessageOverLayDialog: React.FC<InfoMessageOverLayDialogProperties> = (props) => {
const { blocked = false, children, closable = true, header = '', infoMessage, maximizable = true, onClose, overlayColSize = 4, severity, show } = props;

const [showDialog, setShowDialog] = useState<boolean>(show);

Expand Down Expand Up @@ -76,10 +63,7 @@ const InfoMessageOverLayDialog: React.FC<InfoMessageOverLayDialogProperties> = (
return 'text-yellow-500';
}
default: {
if (
infoMessage?.toLowerCase().includes('error')
|| infoMessage?.toLowerCase().includes('failed')
) {
if (infoMessage?.toLowerCase().includes('error') || infoMessage?.toLowerCase().includes('failed')) {
return 'text-red-500';
}

Expand All @@ -101,23 +85,14 @@ const InfoMessageOverLayDialog: React.FC<InfoMessageOverLayDialogProperties> = (
visible={showDialog}
>
<BlockUI blocked={blocked}>
<div className="flex p-0 pt-3 pb-3 border-1 border-round surface-border justify-contents-center align-items-center">
{children}
</div>
<div className="flex p-0 pt-3 pb-3 border-1 border-round surface-border justify-contents-center align-items-center">{children}</div>
</BlockUI>
</Dialog>

<OverlayPanel
className={`col-${overlayColSize} p-0`}
dismissable={false}
ref={op}
showCloseIcon={false}
>
<OverlayPanel className={`col-${overlayColSize} p-0`} dismissable={false} ref={op} showCloseIcon={false}>
<div className="flex m-0 p-1 border-1 border-round surface-border justify-contents-center">
<div className="surface-overlay surface-overlay min-h-full min-w-full">
<h4 className={`text-center ${determineSeverityColor()}`}>
{infoMessage}
</h4>
<h4 className={`text-center ${determineSeverityColor()}`}>{infoMessage}</h4>
</div>
</div>
</OverlayPanel>
Expand Down
10 changes: 3 additions & 7 deletions streammasterwebui/components/SMTextColor.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
interface SMTextColorProperties {
readonly italicized?: boolean
readonly text: string | undefined // Use a boolean to determine if text should be italicized
readonly italicized?: boolean;
readonly text: string | undefined; // Use a boolean to determine if text should be italicized
}
export const SMTextColor = ({ italicized, text }: SMTextColorProperties) => (
<span className={`orange-color ${italicized ? 'font-italic' : ''}`}>
{text}
</span>
);
export const SMTextColor = ({ italicized, text }: SMTextColorProperties) => <span className={`orange-color ${italicized ? 'font-italic' : ''}`}>{text}</span>;
8 changes: 1 addition & 7 deletions streammasterwebui/components/buttons/AddButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import BaseButton, { type ChildButtonProps as ChildButtonProperties } from './BaseButton';

const AddButton: React.FC<ChildButtonProperties> = ({
disabled = false,
iconFilled,
label,
onClick,
tooltip = 'Add'
}) => (
const AddButton: React.FC<ChildButtonProperties> = ({ disabled = false, iconFilled, label, onClick, tooltip = 'Add' }) => (
<BaseButton
disabled={disabled}
icon="pi-plus"
Expand Down
13 changes: 2 additions & 11 deletions streammasterwebui/components/buttons/AutoSetButton.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import { type ChildButtonProps as ChildButtonProperties } from './BaseButton';
import BaseButton from './BaseButton';

const AutoSetButton: React.FC<ChildButtonProperties> = ({
disabled = true,
onClick,
tooltip = 'Auto Set'
}) => (
<BaseButton
disabled={disabled}
icon="pi-sort-numeric-up-alt"
onClick={onClick}
tooltip={tooltip}
/>
const AutoSetButton: React.FC<ChildButtonProperties> = ({ disabled = true, onClick, tooltip = 'Auto Set' }) => (
<BaseButton disabled={disabled} icon="pi-sort-numeric-up-alt" onClick={onClick} tooltip={tooltip} />
);

export default AutoSetButton;
16 changes: 2 additions & 14 deletions streammasterwebui/components/buttons/BanButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import BaseButton, { type ChildButtonProps as ChildButtonProperties } from './BaseButton';

const BanButton: React.FC<ChildButtonProperties> = ({
className,
disabled = false,
onClick,
tooltip = ''
}) => (
<BaseButton
className={className}
disabled={disabled}
icon="pi-ban"
iconFilled={false}
onClick={onClick}
tooltip={tooltip}
/>
const BanButton: React.FC<ChildButtonProperties> = ({ className, disabled = false, onClick, tooltip = '' }) => (
<BaseButton className={className} disabled={disabled} icon="pi-ban" iconFilled={false} onClick={onClick} tooltip={tooltip} />
);

export default BanButton;
17 changes: 2 additions & 15 deletions streammasterwebui/components/buttons/BookButton.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import BaseButton, { type ChildButtonProps as ChildButtonProperties } from './BaseButton';

const BookButton: React.FC<ChildButtonProperties> = ({
disabled = false,
iconFilled = true,
label,
onClick,
tooltip = ''
}) => (
<BaseButton
disabled={disabled}
icon="pi-book"
iconFilled={iconFilled}
label={label}
onClick={onClick}
tooltip={tooltip}
/>
const BookButton: React.FC<ChildButtonProperties> = ({ disabled = false, iconFilled = true, label, onClick, tooltip = '' }) => (
<BaseButton disabled={disabled} icon="pi-book" iconFilled={iconFilled} label={label} onClick={onClick} tooltip={tooltip} />
);

export default BookButton;
13 changes: 2 additions & 11 deletions streammasterwebui/components/buttons/ClearButton.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import BaseButton, { type ChildButtonProps as ChildButtonProperties } from './BaseButton';

const ClearButton: React.FC<ChildButtonProperties> = ({
disabled = true,
onClick,
tooltip = ''
}) => (
<BaseButton
disabled={disabled}
icon="pi-book"
onClick={onClick}
tooltip={tooltip}
/>
const ClearButton: React.FC<ChildButtonProperties> = ({ disabled = true, onClick, tooltip = '' }) => (
<BaseButton disabled={disabled} icon="pi-book" onClick={onClick} tooltip={tooltip} />
);

export default ClearButton;
4 changes: 3 additions & 1 deletion streammasterwebui/components/buttons/ClockButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import BaseButton, { type ChildButtonProps as ChildButtonProperties } from './BaseButton';

const ClockButton: React.FC<ChildButtonProperties> = ({ disabled = false, label, onClick, tooltip = 'Time Shift', iconFilled }) => <BaseButton disabled={disabled} icon="pi-stopwatch" iconFilled={iconFilled} label={label} onClick={onClick} tooltip={tooltip} />;
const ClockButton: React.FC<ChildButtonProperties> = ({ disabled = false, label, onClick, tooltip = 'Time Shift', iconFilled }) => (
<BaseButton disabled={disabled} icon="pi-stopwatch" iconFilled={iconFilled} label={label} onClick={onClick} tooltip={tooltip} />
);

export default ClockButton;
Loading

0 comments on commit f25e59e

Please sign in to comment.