Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/color testing #88

Merged
merged 7 commits into from
Aug 9, 2024
Merged

Conversation

ThijsZijdel
Copy link
Contributor

Screenshot 2024-08-08 at 17 49 27

Note: will add the explanations later;

  {
    name: "Tritanomaly",
    description: "0.0001% of men, 0.0001% of women",
    info: "Reduced sensitivity to blue light causing blues to be less bright, and difficulties distinguishing between yellow and red from pink.",
  },

Since I'll create some custom UI blocks like popovers/ tooltips for that.

Cleanup of color-utils

Keeping it more focused on the actual convertion.

  • Space bar & initial randomize
  • Adding exports

Screenshot 2024-08-08 at 17 52 06


const ColorHarmonies = () => {
const [color, setColor] = useState<string>("#61D2C3");

const [colorDeb] = useDebouncedValue(color, 300);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unnecessary rendering on the /color-util tab.

The elements were initially added on the color-utils since they were hidden by default. However, since they are no longer there, it is no longer necessary to debounce them on the /harmonies tab.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. Can you also remove the unused imports and fix any other eslint errors in the same module? I saw some unused vars and imports in prev PR

import { useCallback, useEffect } from "react";
import { getRandomColor } from "./utilities";

export const useColorRandomizer = (setColor: (color: string) => void) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is working it's fine, but ideally if you are creating a custom hook, it's a good idea to have states local to the hook. you can return those states from the hook, react can optimize this.

for example

const [color] = useColorRandomizer();

and then have state inside the hook

const useColorRandomizer() {
	const [color, setColor] = useState();

	// .... rest

	return [color, setColor]
}

Copy link
Member

@Sparkenstein Sparkenstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sparkenstein
Copy link
Member

Once your changes are finalized, let me know, I will merge and release after that

@ThijsZijdel
Copy link
Contributor Author

@Sparkenstein Just pushed the cleanup, will be starting on the UI changes right now in a new branch.

Mantine + scss 👑

@Sparkenstein Sparkenstein merged commit 08599ab into fosslife:master Aug 9, 2024
@ThijsZijdel ThijsZijdel deleted the feat/color-testing branch August 9, 2024 11:11
@Sparkenstein
Copy link
Member

great changes 🙌 thanks.
don't overdo with scss, I will try to hire a designer, keep the structure like we can do theme, and UI changes easily

@ThijsZijdel
Copy link
Contributor Author

ThijsZijdel commented Aug 9, 2024

Yeah for sure, thinking about setting up some more components like the MonacoWrapper and using a full typeof- prop.
Edit: Better to change eg one "custom" input field in our ~/components than in 20 files
Edit: maybe it ain't needed, theme config is quite comprehensive

Just making the ui changes feel a bit more professional and clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants