Skip to content

Commit

Permalink
account layout
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Apr 22, 2024
1 parent a3cfb3c commit 16218bc
Show file tree
Hide file tree
Showing 54 changed files with 6,440 additions and 20,709 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env.local
.env.local.local
.env.development.local
.env.test.local
.env.production.local
Expand Down Expand Up @@ -60,3 +61,6 @@ next.config.wizardcopy.js

# Prototypr Plus
/.prototypr
.env*.local
.env*.production
.env*.development
4 changes: 2 additions & 2 deletions components/Dashboard/navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Navigation = ({activeTab}) =>{

<Link href="/dashboard/drafts">
<div className={"text-gray-700 mr-4"}>
<div className={`${activeTab==1?"bg-gray-800 font-semibold text-white border-gray-800":'hover:bg-gray-100 border border-gray-400'} border border-1 flex p-2.5 px-4 rounded-full text-sm cursor-pointer w-full`}>
<div className={`${activeTab==1?"bg-gray-800 font-semibold text-white border-gray-800":'hover:bg-gray-100 border border-gray-400'} border border-1 flex p-3 rounded-full text-sm cursor-pointer w-full`}>
<div className="flex">
{/* <svg className="w-4 h-4 mr-2 my-auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16 20V4H4v15a1 1 0 0 0 1 1h11zm3 2H5a3 3 0 0 1-3-3V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v7h4v9a3 3 0 0 1-3 3zm-1-10v7a1 1 0 0 0 2 0v-7h-2zM6 6h6v6H6V6zm2 2v2h2V8H8zm-2 5h8v2H6v-2zm0 3h8v2H6v-2z" fill="currentColor"/></svg> */}

Expand All @@ -18,7 +18,7 @@ const Navigation = ({activeTab}) =>{
</Link>
<Link href="/dashboard/published">
<div className={"text-gray-700 mr-2"}>
<div className={`${activeTab==2?"bg-gray-800 font-semibold text-white border-gray-800":'hover:bg-gray-100 border border-gray-400'} border border-1 flex p-2.5 px-4 rounded-full text-sm cursor-pointer w-full`}>
<div className={`${activeTab==2?"bg-gray-800 font-semibold text-white border-gray-800":'hover:bg-gray-100 border border-gray-400'} border border-1 flex p-3 rounded-full text-sm cursor-pointer w-full`}>
<div className="flex">
{/* <svg className="w-4 h-4 mr-2 my-auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M20 22H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1zm-1-2V4H5v16h14zM8 9h8v2H8V9zm0 4h8v2H8v-2z" fill="currentColor"/></svg> */}
<div className="my-auto text-sm">Published</div>
Expand Down
24 changes: 12 additions & 12 deletions components/DashboardPartners/DashboardNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ const DashboardNavigation = ({ activeTab }) => {
<Link href="/dashboard/partner" className="mb-2">
<div className={"text-gray-700 "}>
<div
className={`${activeTab == 0 ? "bg-blue-100 font-semibold text-blue-900" : "hover:bg-blue-100/80"} flex justify-start p-2.5 px-4 rounded-xl text-sm cursor-pointer w-full`}
className={`${activeTab == 0 ? "bg-blue-100 font-semibold text-black/90" : "hover:bg-blue-100/80"} flex justify-start p-3 rounded-xl text-base cursor-pointer w-full`}
>
<div className="flex justify-start">
<Building size={18} className="mr-3" />
<div className="my-auto text-center mx-auto text-sm">
<Building size={22} className="mr-2" />
<div className="my-auto text-center mx-auto text-base">
Overview
</div>
</div>
Expand All @@ -76,35 +76,35 @@ const DashboardNavigation = ({ activeTab }) => {
<Link href="/dashboard/partner/edit-company" className="mb-2">
<div className={"text-gray-700"}>
<div
className={`${activeTab == 1 ? "bg-blue-100 font-semibold text-blue-900" : "hover:bg-blue-100/80"} flex justify-start p-2.5 px-4 rounded-xl text-sm cursor-pointer w-full`}
className={`${activeTab == 1 ? "bg-blue-100 font-semibold text-black/90" : "hover:bg-blue-100/80"} flex justify-start p-3 rounded-xl text-base cursor-pointer w-full`}
>
<div className="flex justify-start">
<UserSquare size={18} className="mr-3" />
<div className="my-auto text-center text-sm">Company</div>
<UserSquare size={22} className="mr-2" />
<div className="my-auto text-center text-base">Company</div>
</div>
</div>
</div>
</Link>
<Link href="/dashboard/partner/ads" className="mb-2">
<div className={"text-gray-700 "}>
<div
className={`${activeTab == 2 ? "bg-blue-100 font-semibold text-blue-900" : "hover:bg-blue-100/80"} flex justify-start p-2.5 px-4 rounded-xl text-sm cursor-pointer w-full`}
className={`${activeTab == 2 ? "bg-blue-100 font-semibold text-black/90" : "hover:bg-blue-100/80"} flex justify-start p-3 rounded-xl text-base cursor-pointer w-full`}
>
<div className="flex justify-start">
<ShootingStar size={18} className="mr-3" />
<div className="my-auto text-center mx-auto text-sm">Ads</div>
<ShootingStar size={22} className="mr-2" />
<div className="my-auto text-center mx-auto text-base">Ads</div>
</div>
</div>
</div>
</Link>
<Link href="/dashboard/partner/jobs" className="mb-2">
<div className={"text-gray-700"}>
<div
className={`${activeTab == 3 ? "bg-blue-100 font-semibold text-blue-900" : "hover:bg-blue-100/80"} flex justify-start p-2.5 px-4 rounded-xl text-sm cursor-pointer w-full`}
className={`${activeTab == 3 ? "bg-blue-100 font-semibold text-black/90" : "hover:bg-blue-100/80"} flex justify-start p-3 rounded-xl text-base cursor-pointer w-full`}
>
<div className="flex justify-start">
<SignPost size={18} className="mr-3" />
<div className="my-auto text-center text-sm">Jobs</div>
<SignPost size={22} className="mr-2" />
<div className="my-auto text-center text-base">Jobs</div>
</div>
</div>
</div>
Expand Down
66 changes: 39 additions & 27 deletions components/Editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ import { addTwitterScript } from "./editorHooks/libs/addTwitterScript";
import UndoRedoButtons from "./UndoRedoButtons";
import EditorNavButtons from "./EditorNavButtons";

const CustomDocument = Document.extend({
content: "heading block*",
atom: true,
});
// const CustomDocument = Document.extend({
// content: "heading block*",
// atom: true,
// });

const Editor = ({
wrapperClass=false,
postType = "article",
canEdit = false,
initialContent = null,
postStatus = "draft",
postObject = null,
showNavButtons = true,
//functions
refetchPost=false,
refetchPost = false,
savePost = false,
updatePost = false,
updatePostSettings = false,
Expand All @@ -72,7 +75,12 @@ const Editor = ({

const editor = useEditor({
extensions: [
CustomDocument,
// CustomDocument,
//if postType is article, then the document should start with a heading
Document.extend({
content: postType == "article" ? "heading block*" : "block*",
atom: true,
}),
Text,
History,
Paragraph,
Expand Down Expand Up @@ -194,40 +202,44 @@ const Editor = ({

return (
<>
<div className="w-full relative my-4">
<div className={`w-full relative ${postType=='article'?'my-4':''}`}>
{/* NAVIGATION, WITH BUTTONS EMBEDDED AS A PROP */}
{user?.isAdmin && (
{(user?.isAdmin && postType=='article')?
<div className="mt-16">
<div className="fixed bottom-3 z-20 w-full">
<div className="relative bg-gray-100/80 w-[500px] shadow-sm border border-gray-300/20 mx-auto rounded-xl p-3 text-sm backdrop-blur text-gray-800 flex flex-row justify-center items-center">
You're editing as admin.
</div>
</div>
</div>
)}
:null}

{/* undoredo buttons render in a portal on the navbar */}
<UndoRedoNavPortal>
<UndoRedoButtons editor={editor} />
</UndoRedoNavPortal>
{showNavButtons !== false ? (
<UndoRedoNavPortal>
<UndoRedoButtons editor={editor} />
</UndoRedoNavPortal>
) : null}

<EditorButtonsNavPortal>
<EditorNavButtons
user={user}
onSave={onSave}
isSaving={isSaving}
postStatus={postStatus}
canEdit={canEdit}
editor={editor}
//for settings panel
postObject={postObject}
updatePostSettings={updatePostSettings}
refetchPost={refetchPost}
/>
</EditorButtonsNavPortal>
{showNavButtons !== false ? (
<EditorButtonsNavPortal>
<EditorNavButtons
user={user}
onSave={onSave}
isSaving={isSaving}
postStatus={postStatus}
canEdit={canEdit}
editor={editor}
//for settings panel
postObject={postObject}
updatePostSettings={updatePostSettings}
refetchPost={refetchPost}
/>
</EditorButtonsNavPortal>
) : null}

{/* NAVIGATION END */}
<div className="my-4 pt-0 mt-[100px] max-w-[44rem] mx-auto relative pb-10 blog-content">
<div className={wrapperClass?wrapperClass:postType=="article"?"my-4 pt-0 mt-[100px] max-w-[44rem] mx-auto relative pb-10 blog-content":''}>
{editor && <MenuFloating editor={editor} />}
<TextMenu editor={editor} />
{/* <LinkMenu editor={editor} /> */}
Expand Down
Loading

0 comments on commit 16218bc

Please sign in to comment.