diff --git a/.github/workflows/issue-branch.yml b/.github/workflows/issue-branch.yml
deleted file mode 100644
index 0611b521..00000000
--- a/.github/workflows/issue-branch.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-name: Create Branch on Issue Creation
-
-on:
- issues:
- types: [opened]
-
-jobs:
- create-branch:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- with:
- token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
-
- - name: Add issue comment - Branch is Creating...
- run: |
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
- -d '{"body": "Branch is Creating..."}'
- - name: Extract issue details
- id: issue
- run: |
- TITLE="${{ github.event.issue.title }}"
- NUMBER="${{ github.event.issue.number }}"
- # Extract the first word as issue type (e.g., "bugfix: Fix UI" → "bugfix")
- ISSUE_TYPE=$(echo "$TITLE" | awk '{print $1}' | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]-')
- ISSUE_TYPE=$(echo "$ISSUE_TYPE" | sed 's/:$//')
- # Allowed issue types
- ALLOWED_TYPES="feat|fix|bugfix|chore|refactor|docs|test|style|perf|ci|build"
- # If issue type is empty or unrecognized, default to "feat"
- if [[ -z "$ISSUE_TYPE" || ! "$ISSUE_TYPE" =~ ^($ALLOWED_TYPES)$ ]]; then
- ISSUE_TYPE="feat"
- fi
-
- # Remove issue type from the title and format safely
- SAFE_TITLE=$(echo "$TITLE" | sed "s/^$ISSUE_TYPE[:]* *//" | tr ' ' '-' | tr -cd '[:alnum:]-')
-
- # Construct the branch name
- BRANCH_NAME="${ISSUE_TYPE}/#${NUMBER}-${SAFE_TITLE}"
-
- echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- echo "Branch to be created: $BRANCH_NAME"
-
- - name: Create new branch
- run: |
- git config --global user.email "github-actions@github.com"
- git config --global user.name "github-actions"
- git fetch origin
- git checkout -b $BRANCH_NAME origin/main
- git push origin $BRANCH_NAME
- - name: Update issue with checkout command
- run: |
- CHECKOUT_COMMAND="\`\`\`bash\ngit fetch origin\ngit checkout $BRANCH_NAME\n\`\`\`"
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
- -d "{\"body\": \"Branch created successfully! Use the following command to check it out:\n\n$CHECKOUT_COMMAND\"}"
- - name: Link branch to issue in the Development section
- run: |
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/development \
- -d "{\"head_branch\": \"$BRANCH_NAME\"}"
- continue-on-error: true
- error-handling:
- if: failure()
- runs-on: ubuntu-latest
- steps:
- - name: Add error comment to issue
- run: |
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
diff --git a/.github/workflows/pr-auto-review.yml b/.github/workflows/pr-auto-review.yml
deleted file mode 100644
index 09cbfd27..00000000
--- a/.github/workflows/pr-auto-review.yml
+++ /dev/null
@@ -1,121 +0,0 @@
-name: Pull Request Automation
-
-on:
- pull_request:
- types: [opened, ready_for_review]
-
-jobs:
- build-design-system:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }}
- token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
-
- - name: Cache Bun dependencies
- id: cache-deps
- uses: actions/cache@v4
- with:
- path: ~/.bun/install/cache
- key: ${{ runner.os }}-bun-dependencies-${{ hashFiles('**/bun.lockb') }}
- restore-keys: |
- ${{ runner.os }}-bun-dependencies-
-
- - name: Setup Bun
- uses: oven-sh/setup-bun@v1
- with:
- bun-version: latest
-
- - name: Install dependencies
- if: steps.cache-deps.outputs.cache-hit != 'true'
- working-directory: ./packages/design-system
- run: bun install
-
- - name: Run build script
- working-directory: ./packages/design-system
- run: bun run build
-
- - name: Commit and push changes
- uses: stefanzweifel/git-auto-commit-action@v5
- with:
- commit_message: "chore: update design system tokens"
- branch: ${{ github.head_ref }}
- file_pattern: ./packages/design-system/**
- token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
-
- add-reviewer:
- runs-on: ubuntu-latest
- needs: build-design-system
- steps:
- - name: Extract Issue Number from Branch
- id: extract_issue
- run: |
- BRANCH_NAME="${{ github.head_ref }}"
- ISSUE_NUMBER=$(echo "$BRANCH_NAME" | grep -oE '[0-9]+' | head -1)
-
- if [ -z "$ISSUE_NUMBER" ]; then
- echo "No issue number found in branch name!"
- exit 1
- fi
-
- echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_ENV
-
- - name: Add Reviewer
- run: |
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
- -d '{"reviewers":["mrbadri"]}'
-
- - name: Add PR Description Comment
- run: |
- PR_COMMENT="This pull request is related to issue #${{ env.ISSUE_NUMBER }}\n\nCloses #${{ env.ISSUE_NUMBER }}"
-
- curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
- -d "{\"body\": \"$PR_COMMENT\"}"
-
- merge-pr:
- runs-on: ubuntu-latest
- needs: add-reviewer
- steps:
- - name: Check PR Author
- id: check-author
- run: |
- PR_AUTHOR="${{ github.event.pull_request.user.login }}"
- echo "PR_AUTHOR=${PR_AUTHOR}" >> $GITHUB_ENV
- if [[ "$PR_AUTHOR" == "mrbadri" ]]; then
- echo "MERGE_IMMEDIATELY=true" >> $GITHUB_ENV
- else
- echo "MERGE_IMMEDIATELY=false" >> $GITHUB_ENV
- fi
-
- - name: Wait for Approval (if not mrbadri)
- id: check-approval
- if: env.MERGE_IMMEDIATELY == 'false'
- run: |
- APPROVED=0
- while [ $APPROVED -eq 0 ]; do
- echo "Checking for approvals..."
- REVIEWS=$(curl -s -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews)
-
- if echo "$REVIEWS" | grep -q '"state": "APPROVED"'; then
- APPROVED=1
- echo "Pull request has at least one approval!"
- else
- echo "Waiting for at least one approval..."
- sleep 60
- fi
- done
-
- # - name: Merge Pull Request
- # run: |
- # curl -X PUT -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
- # -H "Accept: application/vnd.github.v3+json" \
- # https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge \
- # -d '{"merge_method":"squash"}'
diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml
new file mode 100644
index 00000000..17580a24
--- /dev/null
+++ b/.github/workflows/preview.yaml
@@ -0,0 +1,21 @@
+name: Vercel Preview Deployment
+env:
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
+on:
+ push:
+ branches-ignore:
+ - main
+jobs:
+ Deploy-Preview:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Vercel CLI
+ run: npm install --global vercel@latest
+ - name: Pull Vercel Environment Information
+ run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
+ - name: Build Project Artifacts
+ run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
+ - name: Deploy Project Artifacts to Vercel
+ run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
\ No newline at end of file
diff --git a/.husky/pre-push b/.husky/pre-push
index 735cac74..9de635f3 100644
--- a/.husky/pre-push
+++ b/.husky/pre-push
@@ -1,2 +1 @@
-bun run build
-git pull --rebase origin main
\ No newline at end of file
+bun run build
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index d7ec4b9d..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "tailwindCSS.experimental.classRegex": [
- ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]"],
- ["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]"],
- ["clax\\(([^)]*)\\)", "[\"'`]([^\"'`]+)[\"'`]"]
- ]
-}
diff --git a/apps/core/app/(landing)/_components/addtoCard.tsx b/apps/core/app/(landing)/_components/addtoCard.tsx
index d675d294..6a67bce6 100644
--- a/apps/core/app/(landing)/_components/addtoCard.tsx
+++ b/apps/core/app/(landing)/_components/addtoCard.tsx
@@ -10,16 +10,15 @@ import Securityicon from "@repo/icons/security";
import { Label } from "@repo/ui/components/label";
import { useState } from "react";
import CardSkeleton from "./card-cart-skeleton";
-import { useCartStore } from "../store/cart-store";
-import Typography from "@repo/ui/components/typography";
+import useCartStore from "../store/cart-store";
const Addtocard = () => {
- const { closeAddToCart } = useCartStore();
+ const { isAddToCartOpen, closeAddToCart, addToCart } = useCartStore();
const [cards, setCards] = useState([
+ { id: 1, title: "Traveler - Travel Agency", price: "$15" },
{ id: 2, title: "Explorer - Adventure Company", price: "$20" },
{ id: 3, title: "Explorer - Adventure Company", price: "$20" },
- { id: 1, title: "Traveler - Travel Agency", price: "$15" },
{ id: 4, title: "Explorer - Adventure Company", price: "$20" },
{ id: 5, title: "Explorer - Adventure Company", price: "$20" },
]);
@@ -28,7 +27,6 @@ const Addtocard = () => {
{ id: 1, title: "temp", price: "t" },
{ id: 1, title: "temp", price: "t" },
{ id: 1, title: "temp", price: "t" },
- { id: 1, title: "temp", price: "t" },
];
const activeTemp = temp.splice(cards.length);
@@ -37,13 +35,15 @@ const Addtocard = () => {
setCards(cards.filter((card) => card.id !== id));
};
+ if (!isAddToCartOpen) return null;
+
return (
-
+
-
+
{cards.map((card) => (
{
))}
-
-
- Checkout
-
+
+
Checkout
-
+
-
- Metamask
-
+
Metamask
-
- Tonconnect
-
+
Tonconnect
-
-
+
-
@@ -117,9 +114,9 @@ const Addtocard = () => {
closeAddToCart();
}}
/>
-
+
Your payment is secured by MetaMask
-
+
diff --git a/apps/core/app/(landing)/_components/browseMegaMenu/browse-mega-menu.tsx b/apps/core/app/(landing)/_components/browseMegaMenu/browse-mega-menu.tsx
index 7133d8b2..9fd6e70d 100644
--- a/apps/core/app/(landing)/_components/browseMegaMenu/browse-mega-menu.tsx
+++ b/apps/core/app/(landing)/_components/browseMegaMenu/browse-mega-menu.tsx
@@ -1,16 +1,10 @@
-import { useMegaMenuStore } from "../../store/mega-menu";
import { BottomPartMenu } from "./bottomPart/bottom-part-menu";
import { TopPartMenu } from "./topPart/top-part-menu";
import { RetroGrid } from "@repo/ui/components/retroGrid";
const BrowseMegaMenu = () => {
- const { closeMegaMenu } = useMegaMenuStore();
return (
-
diff --git a/apps/core/app/(landing)/_components/card-cart-skeleton.tsx b/apps/core/app/(landing)/_components/card-cart-skeleton.tsx
index ee237c62..9f03f81e 100644
--- a/apps/core/app/(landing)/_components/card-cart-skeleton.tsx
+++ b/apps/core/app/(landing)/_components/card-cart-skeleton.tsx
@@ -1,12 +1,12 @@
const CardSkeleton = () => {
return (
-
+
-
);
diff --git a/apps/core/app/(landing)/_components/card.tsx b/apps/core/app/(landing)/_components/card.tsx
index f090ce70..819b8ca2 100644
--- a/apps/core/app/(landing)/_components/card.tsx
+++ b/apps/core/app/(landing)/_components/card.tsx
@@ -1,5 +1,4 @@
import Removeicon from "@repo/icons/remove";
-import Typography from "@repo/ui/components/typography";
import Image from "next/image";
interface CardProps {
@@ -13,34 +12,30 @@ const Card: React.FC
= (props) => {
const { id, onRemove, title, price } = props;
return (
-
+
-
+
-
-
- {title}
-
-
- {price}
-
+
onRemove(id)}
>
-
+
diff --git a/apps/core/app/(landing)/_components/desktop-navbar/feature-navbar-authenticated.tsx b/apps/core/app/(landing)/_components/desktop-navbar/feature-navbar-authenticated.tsx
index 08e1e6c1..439d12d9 100644
--- a/apps/core/app/(landing)/_components/desktop-navbar/feature-navbar-authenticated.tsx
+++ b/apps/core/app/(landing)/_components/desktop-navbar/feature-navbar-authenticated.tsx
@@ -1,5 +1,5 @@
import Doorexiticon from "@repo/icons/Doorexiticon";
-import Heart1icon from "@repo/icons/heart";
+import Heart1icon from "@repo/icons/heart1";
import Settingsicon from "@repo/icons/Settingsicon";
import Shoppingbagicon from "@repo/icons/shopping-bag";
import Usercircleicon from "@repo/icons/Usercircleicon";
@@ -13,29 +13,22 @@ import {
} from "@repo/ui/components/dropdown-menu";
import Image from "next/image";
import Link from "next/link";
-import { useCartStore } from "../../store/cart-store";
+import useCartStore from "../../store/cart-store";
import Useractionpixelicon from "@repo/icons/useractionpixel";
import {
AvatarImage,
AvatarFallback,
Avatar,
} from "@repo/ui/components/avatar";
-import { useMegaMenuStore } from "./../../store/mega-menu";
const FeatureNavbarAuthenticated = () => {
const { toggleAddToCart } = useCartStore();
- const { closeMegaMenu } = useMegaMenuStore();
-
- const onClick = () => {
- toggleAddToCart();
- closeMegaMenu();
- };
return (
-
+
{/* TODO: add badge #erfan*/}
diff --git a/apps/core/app/(landing)/_components/desktop-navbar/navbar-links.tsx b/apps/core/app/(landing)/_components/desktop-navbar/navbar-links.tsx
index 24f31067..3bc38e0a 100644
--- a/apps/core/app/(landing)/_components/desktop-navbar/navbar-links.tsx
+++ b/apps/core/app/(landing)/_components/desktop-navbar/navbar-links.tsx
@@ -1,19 +1,9 @@
import Typography from "@repo/ui/components/typography";
-import { useMegaMenuStore } from "./../../store/mega-menu";
-import { useCartStore } from "./../../store/cart-store";
const NavbarLinks = () => {
- const { toggleOpenMegaMenu } = useMegaMenuStore();
- const { closeAddToCart } = useCartStore();
-
- const onClick = () => {
- closeAddToCart();
- toggleOpenMegaMenu();
- };
-
return (
-
+
Browse
diff --git a/apps/core/app/(landing)/_components/desktop-navbar/navbar.tsx b/apps/core/app/(landing)/_components/desktop-navbar/navbar.tsx
index 6d20585c..0f9b23be 100644
--- a/apps/core/app/(landing)/_components/desktop-navbar/navbar.tsx
+++ b/apps/core/app/(landing)/_components/desktop-navbar/navbar.tsx
@@ -1,6 +1,7 @@
"use client";
import PixelIcon from "@repo/icons/pxiel";
import SearchIcon from "@repo/icons/serach";
+import { NavigationMenu } from "@repo/ui/components/navigation-menu";
import { AnimatePresence, motion } from "framer-motion";
import { useRef, useState } from "react";
import Addtocard from "../addtoCard";
@@ -8,12 +9,9 @@ import NavbarLinks from "./navbar-links";
import FeaturesNavbar from "./features-navbar";
import Searchbar, { RefSearchHandle } from "./search-bar";
import { BrowseMegaMenu } from "../browseMegaMenu/browse-mega-menu";
-import { useMegaMenuStore } from "../../store/mega-menu";
-import { useCartStore } from "../../store/cart-store";
const Navbar = ({ islogin }: { islogin: boolean }) => {
- const { isOpenMegaMenu } = useMegaMenuStore();
- const { isAddToCartOpen } = useCartStore();
+ // isSeaching state
const [isSearchActive, setIsSearchActive] = useState(false);
const [isSearchVisible, setIsSearchVisible] = useState(false);
@@ -93,38 +91,9 @@ const Navbar = ({ islogin }: { islogin: boolean }) => {
-
- {isAddToCartOpen && (
-
-
-
- )}
-
-
- {isOpenMegaMenu && (
-
-
-
- )}
-
+
+
+ {/*
*/}
);
};
diff --git a/apps/core/app/(landing)/become-auther/_components/auther-form.tsx b/apps/core/app/(landing)/become-auther/_components/auther-form.tsx
index 77f1c637..61cbb892 100644
--- a/apps/core/app/(landing)/become-auther/_components/auther-form.tsx
+++ b/apps/core/app/(landing)/become-auther/_components/auther-form.tsx
@@ -32,7 +32,6 @@ const AutherForm = () => {
});
const onSubmit = (data: PostRequestAuthorRequest) => {
- console.log("Sign Up Data:", data);
mutation.mutate(data);
};
diff --git a/apps/core/app/(landing)/page.tsx b/apps/core/app/(landing)/page.tsx
index 535517b3..a5c39602 100644
--- a/apps/core/app/(landing)/page.tsx
+++ b/apps/core/app/(landing)/page.tsx
@@ -11,7 +11,6 @@ import Typography from "@repo/ui/components/typography";
import * as htmlToImage from "html-to-image";
import { useTheme } from "next-themes";
import { useState } from "react";
-import Addtocard from "./_components/addtoCard";
export default function Page() {
const { theme, setTheme } = useTheme();
diff --git a/apps/core/app/(landing)/product/[id]/_components/product-footer.tsx b/apps/core/app/(landing)/product/[id]/_components/product-footer.tsx
index 0fd3b97e..9664a8b4 100644
--- a/apps/core/app/(landing)/product/[id]/_components/product-footer.tsx
+++ b/apps/core/app/(landing)/product/[id]/_components/product-footer.tsx
@@ -1,4 +1,4 @@
-import Heart1icon from "@repo/icons/heart";
+import Heart1icon from "@repo/icons/heart1";
import Messagecircleicon from "@repo/icons/message-circle";
import Shopingcartplusicon from "@repo/icons/shopping-cart-plus";
import { SCROLL_TOP_RANGE } from "@repo/ui/components/parallax-scroll-effect";
diff --git a/apps/core/app/(landing)/product/[id]/page.tsx b/apps/core/app/(landing)/product/[id]/page.tsx
index 1c2aced7..d673adda 100644
--- a/apps/core/app/(landing)/product/[id]/page.tsx
+++ b/apps/core/app/(landing)/product/[id]/page.tsx
@@ -5,7 +5,7 @@ import Chevronrighticon from "@repo/icons/chevron-right";
import Circlecheckicon from "@repo/icons/Circle-check";
import Clouddownloadicon from "@repo/icons/cloud-download";
import Figmaicon from "@repo/icons/figma";
-import Heart1icon from "@repo/icons/heart";
+import Heart1icon from "@repo/icons/heart1";
import Instagram from "@repo/icons/instagram";
import Messagecircleicon from "@repo/icons/message-circle";
import Shopingcartplusicon from "@repo/icons/shopping-cart-plus";
diff --git a/apps/core/app/(landing)/product/test/page.tsx b/apps/core/app/(landing)/product/test/page.tsx
index bd7f2d9e..c3473111 100644
--- a/apps/core/app/(landing)/product/test/page.tsx
+++ b/apps/core/app/(landing)/product/test/page.tsx
@@ -5,7 +5,7 @@ import Chevronrighticon from "@repo/icons/chevron-right";
import Circlecheckicon from "@repo/icons/Circle-check";
import Clouddownloadicon from "@repo/icons/cloud-download";
import Figmaicon from "@repo/icons/figma";
-import Heart1icon from "@repo/icons/heart";
+import Heart1icon from "@repo/icons/heart1";
import Instagram from "@repo/icons/instagram";
import Messagecircleicon from "@repo/icons/message-circle";
import Shopingcartplusicon from "@repo/icons/shopping-cart-plus";
diff --git a/apps/core/app/(landing)/store/cart-store.ts b/apps/core/app/(landing)/store/cart-store.ts
index 650fd470..82663051 100644
--- a/apps/core/app/(landing)/store/cart-store.ts
+++ b/apps/core/app/(landing)/store/cart-store.ts
@@ -16,7 +16,7 @@ type CartState = {
toggleAddToCart: () => void;
};
-export const useCartStore = create
((set) => ({
+const useCartStore = create((set) => ({
isAddToCartOpen: false,
cartItems: [],
openAddToCart: () => set({ isAddToCartOpen: true }),
@@ -27,3 +27,5 @@ export const useCartStore = create((set) => ({
cartItems: [...state.cartItems, item],
})),
}));
+
+export default useCartStore;
\ No newline at end of file
diff --git a/apps/core/app/(landing)/store/mega-menu.ts b/apps/core/app/(landing)/store/mega-menu.ts
deleted file mode 100644
index af7ab612..00000000
--- a/apps/core/app/(landing)/store/mega-menu.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { create } from "zustand";
-
-type CartItem = {
- id: string;
- name: string;
- price: number;
- quantity: number;
-};
-
-type MegaMenu = {
- isOpenMegaMenu: boolean;
- setOpenMegaMenu: () => void;
- closeMegaMenu: () => void;
- toggleOpenMegaMenu: () => void;
-};
-
-export const useMegaMenuStore = create((set) => ({
- isOpenMegaMenu: false,
- setOpenMegaMenu: () => {
- set({ isOpenMegaMenu: true });
- },
- closeMegaMenu() {
- set({ isOpenMegaMenu: false });
- },
- toggleOpenMegaMenu: () => {
- set((state) => ({ isOpenMegaMenu: !state.isOpenMegaMenu }));
- },
-}));
diff --git a/apps/core/app/(landing)/test/megaMenuContent/page.tsx b/apps/core/app/(landing)/test/megaMenuContent/page.tsx
new file mode 100644
index 00000000..7332e052
--- /dev/null
+++ b/apps/core/app/(landing)/test/megaMenuContent/page.tsx
@@ -0,0 +1,9 @@
+import { BrowseMegaMenu } from "../../_components/browseMegaMenu/browse-mega-menu";
+
+export default function Page() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/core/app/(landing)/test/page.tsx b/apps/core/app/(landing)/test/page.tsx
new file mode 100644
index 00000000..8bb8bcc0
--- /dev/null
+++ b/apps/core/app/(landing)/test/page.tsx
@@ -0,0 +1,48 @@
+"use client";
+import { AttachmentAdmin } from "@repo/ui/components/attachment/attachmentAdmin/attachmentAdmin";
+import { AttachmentLanding } from "@repo/ui/components/attachment/attachmentLanding/attachmentLanding";
+import { AttachmentThumbnail } from "@repo/ui/components/attachment/attachmentThumbnail/attachmentThumbnail";
+
+export default function Page() {
+ return (
+
+
{
+ console.log(filesId);
+ }}
+ fileCategory="cv"
+ />
+
+ {
+ console.log(filesId);
+ }}
+ />
+
+
+
+
{
+ console.log(filesId);
+ }}
+ />
+
+
+
+ );
+}
diff --git a/apps/core/app/auth/_components/auth-card.tsx b/apps/core/app/auth/_components/auth-card.tsx
index 7be323ba..92b92a6c 100644
--- a/apps/core/app/auth/_components/auth-card.tsx
+++ b/apps/core/app/auth/_components/auth-card.tsx
@@ -8,7 +8,7 @@ import { ReactNode } from "react";
const AuthCard = ({ children }: { children: ReactNode }) => {
return (
-
+
{/* logo */}
diff --git a/apps/core/app/auth/forget-password/_components/form/forgetPasswordForm.tsx b/apps/core/app/auth/forget-password/_components/form/forgetPasswordForm.tsx
index be67ee55..23ab04ee 100644
--- a/apps/core/app/auth/forget-password/_components/form/forgetPasswordForm.tsx
+++ b/apps/core/app/auth/forget-password/_components/form/forgetPasswordForm.tsx
@@ -4,11 +4,11 @@ import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { zodResolver } from "@hookform/resolvers/zod";
-import { postForgetPasswordSchema } from "@repo/apis/core/forgot-password/post/post-forget-password.schema";
-import { PostForgetPasswordRequest } from "@repo/apis/core/forgot-password/post/post-forget-password.types";
-import { UsePostForgetPassword } from "@repo/apis/core/forgot-password/post/use-post-forget-password";
import { Button } from "@repo/ui/components/button";
import { Input } from "@repo/ui/components/input";
+import { postForgetPasswordSchema } from "@repo/apis/core/accounts/users/forgot-password/post/post-forget-password.schema";
+import type { PostForgetPasswordRequest } from "@repo/apis/core/accounts/users/forgot-password/post/post-forget-password.types";
+import { UsePostForgetPassword } from "@repo/apis/core/accounts/users/forgot-password/post/use-post-forget-password";
const ForgetPasswordForm = () => {
const router = useRouter();
@@ -26,12 +26,11 @@ const ForgetPasswordForm = () => {
const mutation = UsePostForgetPassword({
onSuccess: (res, context) => {
toast.info(res.data.message);
- router.push(`/auth/set-password?username=${context.username}`);
+ router.replace(`/auth/set-password?username=${context.username}`);
},
});
const onSubmit = (data: PostForgetPasswordRequest) => {
- console.log("Sign Up Data:", data);
mutation.mutate(data);
};
diff --git a/apps/core/app/auth/layout.tsx b/apps/core/app/auth/layout.tsx
index 77d65b6b..5c794014 100644
--- a/apps/core/app/auth/layout.tsx
+++ b/apps/core/app/auth/layout.tsx
@@ -1,5 +1,6 @@
import "@repo/ui/globals.scss";
import type { Metadata } from "next";
+import Image from "next/image";
export const metadata: Metadata = {
title: "Docs",
@@ -8,16 +9,17 @@ export const metadata: Metadata = {
export default function RootLayout({
children,
-}: {
+}: Readonly<{
children: React.ReactNode;
-}): JSX.Element {
+}>): JSX.Element {
return (
-
{children}
diff --git a/apps/core/app/auth/login/_components/form/loginForm.tsx b/apps/core/app/auth/login/_components/form/loginForm.tsx
index af78dec4..fe288b34 100644
--- a/apps/core/app/auth/login/_components/form/loginForm.tsx
+++ b/apps/core/app/auth/login/_components/form/loginForm.tsx
@@ -30,13 +30,11 @@ const LoginForm = () => {
const loginMutation = usePostLogin({
onSuccess: (res) => {
- console.log(res);
toast.success("Logged in successfully");
setAuthTokens(res.data.data.token);
router.push("/");
},
onError: (res) => {
- console.log(res);
toast.error(res.response?.data.message ?? "Something went wrong");
},
});
@@ -67,7 +65,7 @@ const LoginForm = () => {
helperText={
Forgot password?
diff --git a/apps/core/app/auth/login/page.tsx b/apps/core/app/auth/login/page.tsx
index 0ef4a2f2..f8ab50b8 100644
--- a/apps/core/app/auth/login/page.tsx
+++ b/apps/core/app/auth/login/page.tsx
@@ -26,7 +26,7 @@ const LoginPage = () => {
{/* login with google and linkedin */}
{/*
@@ -34,7 +34,7 @@ const LoginPage = () => {
Log in with Google
diff --git a/apps/core/app/auth/otp/page.tsx b/apps/core/app/auth/otp/page.tsx
deleted file mode 100644
index 34cb331e..00000000
--- a/apps/core/app/auth/otp/page.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-// import components
-"use client";
-import { Button } from "@repo/ui/components/button";
-import {
- InputOTP,
- InputOTPGroup,
- InputOTPSlot,
-} from "@repo/ui/components/input-otp";
-import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
-
-// import icons
-import AuthCard from "../_components/auth-card";
-import { Countdown } from "@repo/ui/components/countdown";
-import Link from "next/link";
-import { AttachmentLanding } from "@repo/ui/components/attachment/attachmentLanding/attachmentLanding";
-
-const Otppage = () => {
- return (
-
- {/* logo */}
-
-
-
Email Verification
-
- We've sent the code to{" "}
-
- example@pixel.design
-
-
-
check your email
-
-
- {/* otp input */}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/* button */}
-
-
- Verify{" "}
-
-
-
-
- didnt recieved code yet?
-
-
-
- );
-};
-
-export default Otppage;
diff --git a/apps/core/app/auth/set-password/page.tsx b/apps/core/app/auth/set-password/page.tsx
index a826f06c..9fc31ad2 100644
--- a/apps/core/app/auth/set-password/page.tsx
+++ b/apps/core/app/auth/set-password/page.tsx
@@ -1,7 +1,5 @@
// import components
"use client";
-import { PostForgetPasswordRequest } from "@repo/apis/core/forgot-password/post/post-forget-password.types";
-import { UsePostForgetPassword } from "@repo/apis/core/forgot-password/post/use-post-forget-password";
import { Button } from "@repo/ui/components/button";
import {
InputOTP,
@@ -9,29 +7,30 @@ import {
InputOTPSlot,
} from "@repo/ui/components/input-otp";
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
-import { useRouter } from "next/navigation";
+import { useRouter, useSearchParams } from "next/navigation";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
// import icons
import { zodResolver } from "@hookform/resolvers/zod";
-import { postForgetPasswordSchema } from "@repo/apis/core/forgot-password/post/post-forget-password.schema";
import { Input } from "@repo/ui/components/input";
import { Suspense, useEffect } from "react";
import AuthCard from "../_components/auth-card";
+import {postResetPasswordSchema} from "@repo/apis/core/accounts/users/reset-password/post/post-reset-password.schema";
+import { usePostResetPassword } from "@repo/apis/core/accounts/users/reset-password/post/use-post-reset-password";
+import type { PostResetPasswordRequest } from "@repo/apis/core/accounts/users/reset-password/post/post-reset-password.types";
+
+
const Setpasswordpage = () => {
const router = useRouter();
- // TODO: Fix this
- // const params = useSearchParams();
- // const username = params.get("username");
-
- const username = "test@gmail.com";
+ const params = useSearchParams();
+ const username = params.get("username");
if (!username) router.replace("/auth/forget-password");
- const form = useForm({
- resolver: zodResolver(postForgetPasswordSchema.request),
+ const form = useForm({
+ resolver: zodResolver(postResetPasswordSchema.request),
});
const {
@@ -41,22 +40,23 @@ const Setpasswordpage = () => {
formState: { errors },
} = form;
+ // biome-ignore lint/correctness/useExhaustiveDependencies:
useEffect(() => {
setValue("username", username as string);
- }, []);
+ }, [username ]);
- const mutation = UsePostForgetPassword({
+ const mutation = usePostResetPassword({
onSuccess: (res) => {
toast.info(res.data.message);
- router.push(`/auth/login`);
+ router.push("/auth/login");
},
onError: (err) => {
- toast.error(err.response?.data.message || "Something went wrong");
+ toast.error(err.response?.data.message ?? "Something went wrong");
},
});
- const handleSubmitForm = (data: PostForgetPasswordRequest) => {
+ const handleSubmitForm = (data: PostResetPasswordRequest) => {
mutation.mutate(data);
};
@@ -104,33 +104,31 @@ const Setpasswordpage = () => {
{/* input */}
-
-
-
- {/* button reset */}
-
-
- Reset
-
-
+
+
+ {/* button reset */}
+
+
+ Reset
+
diff --git a/apps/core/app/auth/signup/otp/_components/signup-otp-form.tsx b/apps/core/app/auth/signup/otp/_components/signup-otp-form.tsx
index c18aa1fb..1a6b09bd 100644
--- a/apps/core/app/auth/signup/otp/_components/signup-otp-form.tsx
+++ b/apps/core/app/auth/signup/otp/_components/signup-otp-form.tsx
@@ -10,23 +10,24 @@ import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
// import icons
import { zodResolver } from "@hookform/resolvers/zod";
-import { postRegisterCompleteSchema } from "@repo/apis/core/accounts/register/complete/post/post-register-complete.schema";
-import type { PostRegisterCompleteRequest } from "@repo/apis/core/accounts/register/complete/post/post-register-complete.types";
-import { UsePostRegisterComplete } from "@repo/apis/core/accounts/register/complete/post/use-post-register-complete";
import { Countdown } from "@repo/ui/components/countdown";
import { useRouter } from "next/navigation";
-import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
+import { usePostVerifyOtp } from "@repo/apis/core/accounts/users/verify_otp/post/use-post-verify-otp";
+import { postVerifyOtpSchema } from "@repo/apis/core/accounts/users/verify_otp/post/post-verify-otp.schema";
+import type { PostVerifyOtpRequest } from "@repo/apis/core/accounts/users/verify_otp/post/post-verify-otp.types";
+import { setAuthTokens } from "@repo/apis/utils/cookies";
+
export interface SignupOtpFormProps {
- email: string;
+ username: string | undefined;
}
export const SignupOtpForm = (props: SignupOtpFormProps) => {
- const { email } = props;
+ const { username } = props;
- const form = useForm
({
- resolver: zodResolver(postRegisterCompleteSchema.request),
+ const form = useForm({
+ resolver: zodResolver(postVerifyOtpSchema.request),
});
const {
@@ -37,25 +38,23 @@ export const SignupOtpForm = (props: SignupOtpFormProps) => {
formState: { errors },
} = form;
- useEffect(() => {
- if (email) setValue("email", email);
- }, [email]);
-
const router = useRouter();
- const muutation = UsePostRegisterComplete({
+ const mutation = usePostVerifyOtp({
onSuccess: (res) => {
- toast.info(res.data.message);
- router.push("/auth/login");
+ toast.success("Registered successfully, Welcome to Pixel Genius!");
+ setAuthTokens(res.data.data.token);
+ router.push("/");
},
onError: (err) => {
- toast.error(err.response?.data.message || "Something went wrong");
+ toast.error(err.response?.data.message ?? "Something went wrong");
},
});
- const handleSubmitForm = (data: PostRegisterCompleteRequest) => {
- muutation.mutate(data);
+ const handleSubmitForm = (data: PostVerifyOtpRequest) => {
+ if (username) mutation.mutate({ ...data, username });
+ else toast.error("username is required");
};
const otpRegister = register("otp");
@@ -96,8 +95,8 @@ export const SignupOtpForm = (props: SignupOtpFormProps) => {
Verify
diff --git a/apps/core/app/auth/signup/otp/page.tsx b/apps/core/app/auth/signup/otp/page.tsx
index a8856f72..07d1d91c 100644
--- a/apps/core/app/auth/signup/otp/page.tsx
+++ b/apps/core/app/auth/signup/otp/page.tsx
@@ -3,14 +3,16 @@ import AuthCard from "../../_components/auth-card";
import { SignupOtpForm } from "./_components/signup-otp-form";
import { redirect } from "next/navigation";
-type SearchParams = { otp: string | string[] | undefined };
+type SearchParams = {
+ username: string | string[] | undefined;
+ email: string | string[] | undefined;
+};
const SignupOtpPage = ({ searchParams }: { searchParams: SearchParams }) => {
- const email = Array.isArray(searchParams.otp)
- ? searchParams.otp[0]
- : searchParams.otp;
-
- if (!email) {
+ const username = Array.isArray(searchParams.username)
+ ? searchParams?.username[0]
+ : searchParams.username;
+ if (!searchParams.email) {
redirect("/auth/signup");
}
@@ -22,7 +24,7 @@ const SignupOtpPage = ({ searchParams }: { searchParams: SearchParams }) => {
We've sent the code to{" "}
- {email}
+ {searchParams.email}
check your email
@@ -30,7 +32,7 @@ const SignupOtpPage = ({ searchParams }: { searchParams: SearchParams }) => {
{/* Form */}
-
+
);
};
diff --git a/apps/core/app/auth/signup/page.tsx b/apps/core/app/auth/signup/page.tsx
index eba0af4a..d3195fba 100644
--- a/apps/core/app/auth/signup/page.tsx
+++ b/apps/core/app/auth/signup/page.tsx
@@ -1,20 +1,20 @@
"use client";
import { zodResolver } from "@hookform/resolvers/zod";
-import { postRegisterSchema } from "@repo/apis/core/accounts/register/post/post-register.schema";
-import { PostRegisterRequest } from "@repo/apis/core/accounts/register/post/post-register.types";
import { Button } from "@repo/ui/components/button";
import { Input } from "@repo/ui/components/input";
// import icons
-import { UsePostRegister } from "@repo/apis/core/accounts/register/post/use-post-register";
-import { useQueryParams } from "@repo/ui/hooks/use-query-params";
-import Link from "next/link";
import { useRouter } from "next/navigation";
-import { Suspense } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import AuthCard from "../_components/auth-card";
+import { useQueryParams } from "@repo/ui/hooks/use-query-params";
+import { Suspense } from "react";
+import Link from "next/link";
+import type { PostRegisterRequest } from "@repo/apis/core/accounts/users/register/post/post-register.types";
+import { postRegisterSchema } from "@repo/apis/core/accounts/users/register/post/post-register.schema";
+import { usePostRegister } from "@repo/apis/core/accounts/users/register/post/use-post-register";
const SignUpPageComponent = () => {
const router = useRouter();
@@ -30,22 +30,24 @@ const SignUpPageComponent = () => {
const { createQueryStringFromObject } = useQueryParams();
- const mutation = UsePostRegister({
+ const mutation = usePostRegister({
onSuccess: (data, context) => {
- console.log("200: data", data);
-
- router.push(
- "/auth/signup/otp" +
- "?" +
- createQueryStringFromObject({ email: context.email }),
- );
-
+ const usernameQuery = createQueryStringFromObject({
+ username: context.username ?? "",
+ });
+ const emailQuery = createQueryStringFromObject({
+ email: context.email ?? "",
+ });
+
+ router.push(`/auth/signup/otp?${usernameQuery}&${emailQuery}`);
toast.success("Send OTP");
},
+ onError: (err) => {
+ toast.error(err.response?.data.message ?? "Something went wrong");
+ },
});
const onSubmit = (data: PostRegisterRequest) => {
- console.log("Sign Up Data:", data);
mutation.mutate(data);
};
@@ -92,8 +94,8 @@ const SignUpPageComponent = () => {
type="password"
label="Confirm Password"
placeholder="********"
- {...register("confirmPassword")}
- error={errors.confirmPassword?.message}
+ {...register("confirm_password")}
+ error={errors.password?.message}
/>
{/* Submit Button */}
@@ -114,12 +116,17 @@ const SignUpPageComponent = () => {
OR
*/}
+
{/* Social Login Buttons */}
{/*
@@ -127,7 +134,7 @@ const SignUpPageComponent = () => {
diff --git a/apps/core/app/auth/template.tsx b/apps/core/app/auth/template.tsx
deleted file mode 100644
index 262368cc..00000000
--- a/apps/core/app/auth/template.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-"use client";
-
-import { AnimatePresence, motion } from "framer-motion";
-import { usePathname } from "next/navigation";
-
-export default function Template({ children }: { children: React.ReactNode }) {
- const pathname = usePathname();
-
- return (
- window.scrollTo(0, 0)}>
-
- {children}
-
-
- );
-}
diff --git a/apps/core/app/foundation/page.tsx b/apps/core/app/foundation/page.tsx
index 1f006212..6bd15657 100644
--- a/apps/core/app/foundation/page.tsx
+++ b/apps/core/app/foundation/page.tsx
@@ -1,158 +1,13 @@
-import Chevrondownicon from "@repo/icons/chevron-down";
-import Hearticon from "@repo/icons/heart";
-import { Button } from "@repo/ui/components/button";
import { FoundationColor } from "@repo/ui/components/foundation-color";
import { Input } from "@repo/ui/components/input";
import Typography from "@repo/ui/components/typography";
-type ButtonGroup = {
- label: string; // Describes the group of buttons
- variants: Array<"primary" | "secondary" | "tertiary">; // The button variants
- sizes: Array<"sm" | "md" | "lg">; // The button sizes
- isLoading: boolean; // Indicates if the button is in a loading state
- disabled: boolean; // Indicates if the button is disabled
- state?: "success" | "warning" | "error"; // Optional status color
-};
-
-const buttonData: ButtonGroup[] = [
- {
- label: "Default",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: false,
- state: undefined,
- },
- {
- label: "Loading",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: true,
- disabled: false,
- state: undefined,
- },
- {
- label: "Disabled",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: true,
- state: undefined,
- },
- {
- label: "Success",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: false,
- state: "success",
- },
- {
- label: "Success Loading",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: true,
- disabled: false,
- state: "success",
- },
- {
- label: "Success Disabled",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: true,
- state: "success",
- },
- {
- label: "Warning",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: false,
- state: "warning",
- },
- {
- label: "Warning Loading",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: true,
- disabled: false,
- state: "warning",
- },
- {
- label: "Warning Loading",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: true,
- state: "warning",
- },
- {
- label: "Error",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: false,
- state: "error",
- },
- {
- label: "Error Disabled",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: true,
- disabled: false,
- state: "error",
- },
- {
- label: "Error Loading",
- variants: ["primary", "secondary", "tertiary"],
- sizes: ["sm", "md", "lg"],
- isLoading: false,
- disabled: true,
- state: "error",
- },
-];
-
const Page = () => {
return (
-
-
Foundation Button
-
- {buttonData.map((group, groupIndex) => (
-
- {/*
{group.label}
*/}
-
- {group.label}
-
- {group.variants.map((variant) =>
- group.sizes.map((size) => (
-
}
- iconRight={
}
- >
- Button
-
- )),
- )}
-
- ))}
-
-
-
- {/* Input */}
-
+
+ {/* Input */}
+
Foundation Input
diff --git a/apps/core/app/layout.tsx b/apps/core/app/layout.tsx
index 12d44095..d6619102 100644
--- a/apps/core/app/layout.tsx
+++ b/apps/core/app/layout.tsx
@@ -25,12 +25,12 @@ export default function RootLayout({
{children}
-
+