diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index a78dd4e..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Deploy job - -on: - release: - types: [published] - -jobs: - setup_and_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - - name: Install Dependencies - run: yarn install - - name: Build - run: yarn build --if-present - - name: 📂 Sync files - uses: SamKirkland/FTP-Deploy-Action@v4.3.5 - with: - server: ${{ secrets.AMITRAIKWAR_FTP_SERVER }} - username: ${{ secrets.AMITRAIKWAR_FTP_ACCOUNT }} - password: ${{ secrets.AMITRAIKWAR_FTP_PASSWORD }} - local-dir: ./build/ - server-dir: ./ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4194682..524be08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,27 +4,79 @@ on: push: branches: ['development'] pull_request: - branches: ['development', 'production'] + branches: ['development'] jobs: - build_test_lint: + install: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x] steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js 22.x uses: actions/setup-node@v3 + with: + node-version: 22.x + cache: 'yarn' + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install Dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install - - name: Build - run: yarn build --if-present + + lint: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 22.x + uses: actions/setup-node@v3 + with: + node-version: 22.x + - name: Restore node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Linting run: yarn lint + + test: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 22.x + uses: actions/setup-node@v3 + with: + node-version: 22.x + - name: Restore node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Test run: yarn test:cov - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} + + build: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 22.x + uses: actions/setup-node@v3 + with: + node-version: 22.x + - name: Restore node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Build + run: yarn build --if-present diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f68ab4e..54cdc5b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,28 +7,57 @@ permissions: contents: write jobs: - release: + release_and_deploy: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [22.x] steps: - name: checkout uses: actions/checkout@v4 with: token: ${{ secrets.PA_TOKEN }} + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: yarn install + + - name: Build + run: yarn build --if-present + + - name: Linting + run: yarn lint + + - name: Test + run: yarn test:cov + + - name: 📂 Sync files (Deploy) + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: ${{ secrets.AMITRAIKWAR_FTP_SERVER }} + username: ${{ secrets.AMITRAIKWAR_FTP_ACCOUNT }} + password: ${{ secrets.AMITRAIKWAR_FTP_PASSWORD }} + local-dir: ./build/ + server-dir: ./ + - name: conventional changelog action id: changelog # https://github.com/TriPSs/conventional-changelog-action uses: TriPSs/conventional-changelog-action@latest with: - # you can also create separate token to trace action github-token: '${{ secrets.PA_TOKEN }}' - git-user-name: 'AR mac Bot' + git-user-name: 'AR portfolio bot' output-file: false + - name: create release # https://github.com/actions/create-release uses: softprops/action-gh-release@v1 if: ${{steps.changelog.outputs.skipped == 'false'}} env: - # This token is provided by Actions, you do not need to create your own token GITHUB_TOKEN: ${{ secrets.PA_TOKEN }} with: tag_name: ${{ steps.changelog.outputs.tag }} diff --git a/src/components/CoverText/Cover.tsx b/src/components/CoverText/Cover.tsx index c386b32..9048070 100644 --- a/src/components/CoverText/Cover.tsx +++ b/src/components/CoverText/Cover.tsx @@ -27,6 +27,8 @@ export const Cover = ({ children }: { children?: React.ReactNode }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [ref.current]); +const SafeAnimatePresence = AnimatePresence as any; + return (
setHovered(true)} @@ -34,7 +36,7 @@ export const Cover = ({ children }: { children?: React.ReactNode }) => { ref={ref} className="relative hover:bg-neutral-900 group/cover inline-block dark:bg-neutral-900 bg-neutral-100 px-2 py-2 transition duration-200 rounded-sm" > - + {hovered && ( { )} - + {beamPositions.map((position, index) => ( (null); - - const vert = /* glsl */ ` +const vert = /* glsl */ ` precision highp float; attribute vec2 position; attribute vec2 uv; @@ -29,7 +20,7 @@ export default function Orb({ } `; - const frag = /* glsl */ ` +const frag = /* glsl */ ` precision highp float; uniform float iTime; @@ -191,6 +182,15 @@ export default function Orb({ } `; +export default function Orb({ + hue = 0, + hoverIntensity = 0.2, + rotateOnHover = true, + forceHoverState = false, + backgroundColor = '#000000', +}: OrbProps) { + const ctnDom = useRef(null); + useEffect(() => { const container = ctnDom.current; if (!container) return; diff --git a/src/components/animateModal/AnimatedModal.tsx b/src/components/animateModal/AnimatedModal.tsx index 68d63fe..0e7ec24 100644 --- a/src/components/animateModal/AnimatedModal.tsx +++ b/src/components/animateModal/AnimatedModal.tsx @@ -79,8 +79,10 @@ export const ModalBody = ({ const { setOpen } = useModal(); useOutsideClick(modalRef, () => setOpen(false)); +const SafeAnimatePresence = AnimatePresence as any; + return ( - + {open && ( )} - + ); }; diff --git a/src/screens/common/SocialNavigation.tsx b/src/screens/common/SocialNavigation.tsx index 08f62a1..cd78cc4 100644 --- a/src/screens/common/SocialNavigation.tsx +++ b/src/screens/common/SocialNavigation.tsx @@ -80,6 +80,8 @@ const SocialNavigation = () => { setCursorInsets(undefined); }; +const SafeAnimatePresence = AnimatePresence as any; + return ( <> {/* Desktop Version */} @@ -197,7 +199,7 @@ const SocialNavigation = () => { }} transition="all 0.2s" /> - + {isOpen && ( { )} - + ); diff --git a/src/screens/mainFlow/contents/Contact.tsx b/src/screens/mainFlow/contents/Contact.tsx index f1ef5d5..c452fbe 100644 --- a/src/screens/mainFlow/contents/Contact.tsx +++ b/src/screens/mainFlow/contents/Contact.tsx @@ -12,6 +12,8 @@ const Contact = () => { const ref = useRef(null); const isContactContainerIntersecting = useIsIntersecting(ref); +const SafeAnimatePresence = AnimatePresence as any; + return ( { > {CONTACT.email} - + {isContactContainerIntersecting && ( { {t('contact.getInTouch')} )} - + ); diff --git a/src/screens/mainFlow/contents/Work.tsx b/src/screens/mainFlow/contents/Work.tsx index b170073..d69ccf1 100644 --- a/src/screens/mainFlow/contents/Work.tsx +++ b/src/screens/mainFlow/contents/Work.tsx @@ -31,100 +31,102 @@ const WorkUIData = () => { content: (() => { // eslint-disable-next-line react-hooks/rules-of-hooks const [isOpen, setIsOpen] = useState(false); - return ( - setIsOpen(true)} - onMouseLeave={() => setIsOpen(false)} - onClick={() => setIsOpen(!isOpen)} - cursor="pointer" - > - - {title} - - {description} - - {isOpen && ( - setIsOpen(true)} + onMouseLeave={() => setIsOpen(false)} + onClick={() => setIsOpen(!isOpen)} + cursor="pointer" + > + - {keyPoints && keyPoints.length > 0 && ( - - )} - {keyPoints.map((point, index) => ( - + {description} + + {isOpen && ( + - {point} - - ))} - {tags && tags.length > 0 && ( - - )} - - {tags.map((tag, index) => ( - - {tag} - - ))} - - - - - {links.map(({ title, link }, index) => ( + {keyPoints && keyPoints.length > 0 && ( + + )} + {keyPoints.map((point, index) => ( - {title} + {point} ))} - - - - )} - + {tags && tags.length > 0 && ( + + )} + + {tags.map((tag, index) => ( + + {tag} + + ))} + + + + + {links.map(({ title, link }, index) => ( + + {title} + + ))} + + + + )} + ); })(), diff --git a/src/services/hooks/common/types.ts b/src/services/hooks/common/types.ts index 0b81db3..1bd3514 100644 --- a/src/services/hooks/common/types.ts +++ b/src/services/hooks/common/types.ts @@ -1,15 +1,13 @@ import { - MutationFunction, - QueryFunction, UseMutationOptions, UseQueryOptions, } from '@tanstack/react-query'; export type useCallSBMutationArgs< - TRequest extends object, - TResponse extends object, + TRequest, + TResponse, > = { - method: MutationFunction; + method: (request: TRequest) => Promise; mutationOptions?: Omit< UseMutationOptions, 'mutationFn' @@ -17,9 +15,9 @@ export type useCallSBMutationArgs< }; export type useCallSBQueryArgs< - TRequest extends object, - TResponse extends object, + TRequest, + TResponse, > = { - method: QueryFunction; + method: (request: any) => Promise | TResponse; queryOptions: Omit, 'queryFn'>; }; diff --git a/src/services/hooks/common/useCallQuery.ts b/src/services/hooks/common/useCallQuery.ts index 3891c0d..653d9e2 100644 --- a/src/services/hooks/common/useCallQuery.ts +++ b/src/services/hooks/common/useCallQuery.ts @@ -7,10 +7,10 @@ import { useCallSBQueryArgs } from './types'; * @param mutationOptions - The options for the mutation. * @returns useQuery result. */ -const useCallQuery = ({ +const useCallQuery = ({ method, queryOptions, -}: useCallSBQueryArgs) => +}: useCallSBQueryArgs) => useQuery({ ...queryOptions, queryFn: (request) => method(request), diff --git a/src/services/hooks/common/useCallSBMutation.ts b/src/services/hooks/common/useCallSBMutation.ts index 40e4b08..572a4a5 100644 --- a/src/services/hooks/common/useCallSBMutation.ts +++ b/src/services/hooks/common/useCallSBMutation.ts @@ -1,10 +1,10 @@ import { useMutation } from '@tanstack/react-query'; import { useCallSBMutationArgs } from './types'; -const useCallSBMutation = ({ +const useCallSBMutation = ({ method, mutationOptions, -}: useCallSBMutationArgs) => +}: useCallSBMutationArgs) => useMutation({ ...mutationOptions, mutationFn: (request) => method(request),