Skip to content

Commit

Permalink
fix(dropdown): update after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin authored and seaerchin committed Sep 12, 2023
1 parent cbd7124 commit 998df5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/layouts/EditHomepage/EditHomepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,8 @@ const EditHomepage = ({ match }) => {
{({ currentSelectedOption }) =>
currentSelectedOption === "dropdown" ? (
<HeroDropdownSection
{...section.hero}
{...section.hero.dropdown}
state={section.hero}
errors={{
...errors,
...errors.sections[0].hero,
Expand Down
11 changes: 5 additions & 6 deletions src/layouts/components/Homepage/HeroDropdownSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ export interface HeroDropdownFormFields {
url: string
}

interface HeroDropdownSectionProps {
interface HeroDropdownSectionProps extends EditorHeroDropdownSection {
errors: {
dropdownElems: HeroDropdownFormFields[]
title: string
dropdown: string
}
state: EditorHeroDropdownSection
title: string
}

export const HeroDropdownSection = ({
errors,
state,
dropdown,
title,
}: HeroDropdownSectionProps) => {
const {
Expand Down Expand Up @@ -67,10 +66,10 @@ export const HeroDropdownSection = ({
<Editable.EmptySection
title="Options you add will appear here"
subtitle="Add options to allow users to quickly navigate your site"
isEmpty={state.dropdown.options.length === 0}
isEmpty={dropdown.options.length === 0}
>
<Editable.Section px={0} spacing="0.75rem" py="1.5rem">
{state.dropdown.options.map(
{dropdown.options.map(
(
{ title: optionTitle, url: optionUrl },
dropdownOptionIndex
Expand Down Expand Up @@ -145,7 +144,7 @@ export const HeroDropdownSection = ({
</Editable.Droppable>
</DragDropContext>
<Button
id={`dropdownelem-${state.dropdown.options.length}-create`}
id={`dropdownelem-${dropdown.options.length}-create`}
onClick={() => onCreate({ target: { id: "dropdownelem" } })}
variant="outline"
w="full"
Expand Down

0 comments on commit 998df5a

Please sign in to comment.