Skip to content

Commit

Permalink
fix: "Set As Homepage" functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Dec 19, 2024
1 parent 9f811ee commit fdad369
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions frontend/src/components/Settings/PageGeneral.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@
: "Draft"
}}
</span>
<Tooltip
:text="
store.activePage?.published ? 'Unpublish this page' : 'This page is already unpublished'
">
<BuilderButton
variant="subtle"
@click="store.activePage?.published ? store.unpublishPage() : store.publishPage(false)">
{{ store.activePage?.published ? "Unpublish" : "Publish" }}
</BuilderButton>
</Tooltip>

<BuilderButton
variant="subtle"
@click="store.activePage?.published ? store.unpublishPage() : store.publishPage(false)">
{{ store.activePage?.published ? "Unpublish" : "Publish" }}
</BuilderButton>
</div>
</div>
</div>
Expand Down Expand Up @@ -99,16 +95,19 @@
<span class="text-base font-medium text-ink-gray-9">Homepage</span>
<p class="text-base text-ink-gray-5">Set current page as Homepage</p>
</div>
<Tooltip
:text="
store.isHomePage(store.activePage)
? 'Unset this page as the homepage'
: 'Set this page as the homepage'
<BuilderButton
variant="subtle"
@click="
() => {
if (store.isHomePage(store.activePage)) {
store.unsetHomePage();
} else {
store.setHomePage(store.activePage?.route as string);
}
}
">
<Button variant="outline" @click.stop="handleClick">
{{ store.isHomePage(store.activePage) ? "Unset Homepage" : "Set As Homepage" }}
</Button>
</Tooltip>
{{ store.isHomePage(store.activePage) ? "Unset Homepage" : "Set As Homepage" }}
</BuilderButton>
</div>
<hr class="w-full border-outline-gray-2" />
<Switch
Expand Down Expand Up @@ -155,7 +154,6 @@ import builderProjectFolder from "@/data/builderProjectFolder";
import { builderSettings } from "@/data/builderSettings";
import useStore from "@/store";
import { BuilderProjectFolder } from "@/types/Builder/BuilderProjectFolder";
import { Button, Tooltip } from "frappe-ui";
import FeatherIcon from "frappe-ui/src/components/FeatherIcon.vue";
import { computed } from "vue";
// check route for page id
Expand All @@ -180,8 +178,4 @@ const folderOptions = computed(() => {
return [homeOption, ...options];
});
const handleClick = () => {
console.log("clicked");
};
</script>

0 comments on commit fdad369

Please sign in to comment.