Maintenance

This commit is contained in:
Prozilla 2023-08-16 19:12:56 +02:00
parent 844f140651
commit 2f0410bfea
No known key found for this signature in database
GPG key ID: 5858DFE71CAF31EE
7 changed files with 31 additions and 28 deletions

View file

@ -56,7 +56,9 @@
"double" "double"
], ],
"default-case": "off", "default-case": "off",
"no-multi-comp": "off", "arrow-parens": "error",
"space-infix-ops": "warn",
"react/no-multi-comp": "error",
"jsdoc/no-undefined-types": "warn", "jsdoc/no-undefined-types": "warn",
"jsdoc/require-param": "warn", "jsdoc/require-param": "warn",
"jsdoc/check-tag-names": "warn", "jsdoc/check-tag-names": "warn",

View file

@ -1,8 +0,0 @@
import { render, screen } from "@testing-library/react";
import App from "./App";
test("renders learn react link", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

View file

@ -29,7 +29,11 @@ export function Desktop() {
}, [settingsManager]); }, [settingsManager]);
return (<> return (<>
<div className={styles.Container} style={{ backgroundImage: `url(${wallpaper})` }} onContextMenu={onContextMenu}> <div
className={styles.Container}
style={{ backgroundImage: wallpaper ? `url(${wallpaper})` : null }}
onContextMenu={onContextMenu}
>
<ModalsView modalsManager={modalsManager} modals={modals}/> <ModalsView modalsManager={modalsManager} modals={modals}/>
</div> </div>
</>); </>);

View file

@ -1,18 +1,18 @@
export const NAME = "ProzillaOS"; export const NAME = "ProzillaOS";
export const ASCII_LOGO = ` export const ASCII_LOGO = `
:. :.
-==. -==.
.=====: .=====:
---::..:=======-. ---::..:=======-.
:===+=----------::.. :===+=----------::..
=+=---------------:.. =+=---------------:..
--------------------:. --------------------:.
.:-+=----*###*--*####=---. .:-+=----*###*--*####=---.
:==+----#%+-+%#-##%*+----:. :==+----#%+-+%#-##%*+----:.
.=----#%+-+%#-*+-%#+---:. .=----#%+-+%#-*+-%#+---:.
==----*###*--*###*----. ==----*###*--*###*----.
==+-------------------:. ==+-------------------:.
...::---------------:. ...::---------------:.
.::---------::.. .::---------::..
....::... `; ....::... `;

View file

@ -7,6 +7,7 @@ import { ASCII_LOGO } from "./constants/branding.js";
export const START_DATE = new Date(); export const START_DATE = new Date();
// Render app
const root = ReactDOM.createRoot(document.getElementById("root")); const root = ReactDOM.createRoot(document.getElementById("root"));
root.render( root.render(
<React.StrictMode> <React.StrictMode>
@ -14,7 +15,11 @@ root.render(
</React.StrictMode> </React.StrictMode>
); );
console.log(ASCII_LOGO); // Log welcome message
const asciiLogoWidth = ASCII_LOGO.split("\n")[1].length;
const welcomeMessage = "Welcome to ProzillaOS";
const space = "\n\n" + " ".repeat(Math.ceil((asciiLogoWidth - welcomeMessage.length) / 2));
console.info(ASCII_LOGO + space + welcomeMessage);
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log)) // to log results (for example: reportWebVitals(console.log))

View file

@ -1,4 +1,4 @@
const reportWebVitals = onPerfEntry => { const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) { if (onPerfEntry && onPerfEntry instanceof Function) {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry); getCLS(onPerfEntry);

View file

@ -2,4 +2,4 @@
// allows you to do things like: // allows you to do things like:
// expect(element).toHaveTextContent(/react/i) // expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom // learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'; import "@testing-library/jest-dom";