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

Refactor and Cleanup #4

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refactor PageColors component to use statePageColors instead of pageC…
…olors
  • Loading branch information
michael-ortiz committed Jan 27, 2024
commit 8af61314f79586c97dfd09db032cc3ba9937f888
9 changes: 3 additions & 6 deletions react/src/pages/console/page-settings/PageColors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ function PageColors() {

const { state, dispatch } = useContext(GlobalContext);

const pageColors = state.selectedPage.pageColors || {};

console.log(pageColors);
const statePageColors = state.selectedPage.pageColors || {};

const [isLoading, setIsLoading] = React.useState(false);
const [colors, setColors] = React.useState(pageColors || DefaultPageColors);
const [colors, setColors] = React.useState(statePageColors || DefaultPageColors);
const [showColorPicker, setShowColorPicker] = React.useState(ColorPickerState)

const handleSubmit = () => {
Expand Down Expand Up @@ -179,5 +177,4 @@ function PageColors() {
);
}

export default PageColors;

export default PageColors;