Skip to content

Commit

Permalink
fix: color pick background color on change (#3691)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramveeraghanta authored Feb 18, 2024
1 parent 41e812a commit eba5ed2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions web/components/core/theme/custom-theme-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const CustomThemeSelector: React.FC = observer(() => {

const handleValueChange = (val: string | undefined, onChange: any) => {
let hex = val;

// prepend a hashtag if it doesn't exist
if (val && val[0] !== "#") hex = `#${val}`;

Expand Down Expand Up @@ -94,7 +93,7 @@ export const CustomThemeSelector: React.FC = observer(() => {
placeholder="#0d101b"
className="w-full"
style={{
backgroundColor: value,
backgroundColor: watch("background"),
color: watch("text"),
}}
hasError={Boolean(errors?.background)}
Expand All @@ -120,8 +119,8 @@ export const CustomThemeSelector: React.FC = observer(() => {
placeholder="#c5c5c5"
className="w-full"
style={{
backgroundColor: watch("background"),
color: value,
backgroundColor: watch("text"),
color: watch("background"),
}}
hasError={Boolean(errors?.text)}
/>
Expand All @@ -146,7 +145,7 @@ export const CustomThemeSelector: React.FC = observer(() => {
placeholder="#3f76ff"
className="w-full"
style={{
backgroundColor: value,
backgroundColor: watch("primary"),
color: watch("text"),
}}
hasError={Boolean(errors?.primary)}
Expand All @@ -172,7 +171,7 @@ export const CustomThemeSelector: React.FC = observer(() => {
placeholder="#0d101b"
className="w-full"
style={{
backgroundColor: value,
backgroundColor: watch("sidebarBackground"),
color: watch("sidebarText"),
}}
hasError={Boolean(errors?.sidebarBackground)}
Expand Down Expand Up @@ -200,8 +199,8 @@ export const CustomThemeSelector: React.FC = observer(() => {
placeholder="#c5c5c5"
className="w-full"
style={{
backgroundColor: watch("sidebarBackground"),
color: value,
backgroundColor: watch("sidebarText"),
color: watch("sidebarBackground"),
}}
hasError={Boolean(errors?.sidebarText)}
/>
Expand Down

0 comments on commit eba5ed2

Please sign in to comment.