Skip to content

Commit

Permalink
Pages dashboard (#318)
Browse files Browse the repository at this point in the history
* Pages + Lint Staged

* UI improvements for pages dashboard

* Protected pages

* UI fixes

---------

Co-authored-by: Rajat Saxena <[email protected]>
  • Loading branch information
rajat1saxena and Rajat Saxena authored Mar 24, 2024
1 parent 998f3a1 commit 8e55335
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/web/components/admin/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ const Index = ({ loading, address, dispatch }: IndexProps) => {
<td align="right">
<div className="flex items-center justify-end gap-2">
<Link
href={`${address.frontend}/p/${page.pageId}`}
href={`${address.frontend}${
page.pageId === "homepage"
? ""
: `/p/${page.pageId}`
}`}
openInSameTab={false}
>
<Button variant="soft">
Expand Down
6 changes: 6 additions & 0 deletions apps/web/components/admin/pages/new-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
BTN_CONTINUE,
BUTTON_CANCEL_TEXT,
NEW_PAGE_FORM_WARNING,
NEW_PAGE_HEADING,
NEW_PAGE_NAME_PLC,
NEW_PAGE_URL_LABEL,
Expand All @@ -24,6 +25,7 @@ import {
setAppMessage,
} from "@courselit/state-management/dist/action-creators";
import { useRouter } from "next/router";
import { Info } from "@courselit/icons";

interface NewPageProps {
address: Address;
Expand Down Expand Up @@ -98,6 +100,10 @@ const NewPage = ({
onChange={(e) => setPageId(e.target.value)}
placeholder={NEW_PAGE_URL_PLC}
/>
<p className="text-slate-500 text-xs flex items-center gap-1">
<Info />
{NEW_PAGE_FORM_WARNING}
</p>
<div className="flex gap-2">
<Button
disabled={
Expand Down
2 changes: 2 additions & 0 deletions apps/web/ui-config/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,5 @@ export const DELETE_PAGE_POPUP_TEXT =
"This is an irreversible action and all the data related to this page will be deleted.";
export const PAGE_TABLE_CONTEXT_MENU_DELETE = "Delete";
export const APP_MESSAGE_PAGE_DELETED = "Page deleted";
export const NEW_PAGE_FORM_WARNING =
"These settings cannot be changed later on, so proceed with caution.";

0 comments on commit 8e55335

Please sign in to comment.