mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 04:22:27 +10:00
Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f29ca3add | |||
| bf498b5972 | |||
| 2bc42493af | |||
| d18ef2e1a5 | |||
| 1191bbca67 | |||
| f5804ab458 | |||
| 748b509b1d | |||
| 696f6f71b5 | |||
| 09ebcdf40f | |||
| 0ee0b6b2e9 | |||
| fe550ccc36 | |||
| 6dcbe78730 | |||
| 73b29f78ab | |||
| 0124db049b | |||
| a033c3eff6 | |||
| 97286739f2 | |||
| a74a8ed044 | |||
| 376f72a22f | |||
| 77dee57324 | |||
| 5d0c92e90d | |||
| 868e6de7d9 | |||
| e24f8850d2 | |||
| f30a76229b | |||
| 02c6318f60 | |||
| 2f87dde48d | |||
| d570b21635 | |||
| b1af5d9339 | |||
| a598a7a7f0 | |||
| f60fc63ee3 | |||
| 94eb549d25 | |||
| 7a8b5d09c6 | |||
| c15d9f7645 | |||
| a102f62e28 | |||
| c1a58118c2 | |||
| b0d26e3230 | |||
| 7e354b74bd | |||
| e20bcb8c14 | |||
| 506058aacb | |||
| a7a0e4e652 | |||
| 7b394f1437 | |||
| e2e2551db4 | |||
| 52e062c0b5 | |||
| e3785030e1 | |||
| e21430a421 | |||
| f66704af88 | |||
| 7a65363296 | |||
| 8180e8c7b8 | |||
| 13b2a5be94 | |||
| 4dd5367572 | |||
| e87b05a93a | |||
| 68252c35fc | |||
| ac9b280bd5 | |||
| 32b8407b1a | |||
| 989e8dee5b | |||
| 5ed561812f | |||
| cba2eda5d0 | |||
| 1c7b44b604 | |||
| 5d61e865a8 | |||
| f32a85cec9 | |||
| c99ce90cf8 | |||
| 6e2b960bdb | |||
| 862c812ee1 | |||
| 6424b15b76 | |||
| 5e32673358 | |||
| 470f187c0b | |||
| 8b966946ea | |||
| 8579a4c98d | |||
| 8deff757a9 | |||
| d227cf64aa | |||
| 458af1d840 | |||
| 0024aec60a | |||
| ec86536ace | |||
| f7e2bfb078 | |||
| 168be7dfb8 | |||
| 832d0002e9 | |||
| 1f9e3aa9d1 | |||
| dd97c6d71f | |||
| 1f5dce2233 | |||
| fe77b14807 | |||
| a36c49fa77 | |||
| 589e782d71 | |||
| 31f396c01a | |||
| 6d20eda423 | |||
| 53b5bdc0b5 | |||
| 709bf0a526 | |||
| 7189c7f203 | |||
| cdef456aac | |||
| 8c879841d7 | |||
| 937e6b053d | |||
| ac9109c2b6 | |||
| fcc68750cf | |||
| afe52da92d | |||
| a578bd1054 | |||
| 116c038861 | |||
| 6e6914fe6b | |||
| 2bf04f2616 | |||
| 6f2e75f22b | |||
| f6c2ae7504 | |||
| 890875ad9d | |||
| 11953af700 | |||
| 3c774102cf | |||
| fbf92160a3 | |||
| a798845865 | |||
| 7db57e04c0 | |||
| b23efa773f | |||
| 3b41b32f09 | |||
| 5513b909e7 | |||
| c1a50d4125 | |||
| 7babde2d62 | |||
| 08a6415ba8 | |||
| 1ee9478200 | |||
| bbe8fb6655 | |||
| 6405102cab | |||
| 32445a5cd7 | |||
| 5494d93e1d | |||
| ad9647a3f4 | |||
| 9ee7e3195b | |||
| 53dfd4cb09 | |||
| 7ceb0f6e39 | |||
| 7496461618 | |||
| b47b7824ff | |||
| ec77d13ebd | |||
| c8f7989c1f | |||
| ec612f0902 | |||
| 10b2ca8bf2 | |||
| 995b1e627b | |||
| f1d4ebb504 | |||
| 6c97c880b3 | |||
| 8fc3c25714 | |||
| 19c4d31710 | |||
| b17919e909 | |||
| 4c1c17c693 | |||
| df99470df8 | |||
| a92528cdb7 | |||
| 219e6999df | |||
| 95ee77f65c | |||
| 71d3cea100 | |||
| befc5a67fc | |||
| 5a2c222d61 | |||
| 6a3c75c15c | |||
| b6162d7bb0 | |||
| 269f4c8b4d | |||
| 21fe2e195c | |||
| 33168aa535 | |||
| 2dce78200b | |||
| b92b4c9936 | |||
| f30d299949 | |||
| fdfcd37061 | |||
| 5d146ca86e | |||
| 8e8b695cbc | |||
| 37a869fa24 | |||
| 176cac4fbe |
@ -1,22 +1,62 @@
|
||||
!README.md
|
||||
.dockerignore
|
||||
# Compiled Output
|
||||
dist
|
||||
tmp
|
||||
/out-tsc
|
||||
|
||||
# Project Dependencies
|
||||
.git
|
||||
.gitignore
|
||||
node_modules
|
||||
|
||||
# Docker
|
||||
compose*.yml
|
||||
Dockerfile
|
||||
|
||||
# IDEs and Editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vs/*
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# Miscellaneous
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.editorconfig
|
||||
.eslint*
|
||||
.git
|
||||
.github
|
||||
.gitignore
|
||||
.husky
|
||||
|
||||
# Generated Files
|
||||
.nx
|
||||
.prettier*
|
||||
.vscode
|
||||
*.env*
|
||||
*.md
|
||||
compose*.yml
|
||||
dist
|
||||
Dockerfile
|
||||
node_modules
|
||||
Thumbs.db
|
||||
tmp
|
||||
.swc
|
||||
fly.toml
|
||||
stats.html
|
||||
tools/compose/*
|
||||
tools/scripts/*
|
||||
tools/scripts/*
|
||||
|
||||
# Environment Variables
|
||||
*.env*
|
||||
!.env.example
|
||||
|
||||
# Lingui Compiled Messages
|
||||
apps/client/src/locales/_build/
|
||||
apps/client/src/locales/*/messages.mjs
|
||||
|
||||
28
.env.example
28
.env.example
@ -4,14 +4,6 @@ NODE_ENV=development
|
||||
# Ports
|
||||
PORT=3000
|
||||
|
||||
# Client Port & URL (for development)
|
||||
__DEV__CLIENT_PORT=5173 # Only used in development
|
||||
__DEV__CLIENT_URL=http://localhost:5173 # Only used in development
|
||||
|
||||
# Artboard Port & URL (for development)
|
||||
__DEV__ARTBOARD_PORT=6173 # Only used in development
|
||||
__DEV__ARTBOARD_URL=http://localhost:6173 # Only used in development
|
||||
|
||||
# URLs
|
||||
# These URLs must reference a publicly accessible domain or IP address, not a docker container ID (depending on your compose setup)
|
||||
PUBLIC_URL=http://localhost:3000
|
||||
@ -38,6 +30,8 @@ REFRESH_TOKEN_SECRET=refresh_token_secret
|
||||
CHROME_PORT=8080
|
||||
CHROME_TOKEN=chrome_token
|
||||
CHROME_URL=ws://localhost:8080
|
||||
# Launch puppeteer with flag to ignore https errors
|
||||
# CHROME_IGNORE_HTTPS_ERRORS=true
|
||||
|
||||
# Mail Server (for e-mails)
|
||||
# For testing, you can use https://ethereal.email/create
|
||||
@ -52,20 +46,18 @@ STORAGE_BUCKET=default
|
||||
STORAGE_ACCESS_KEY=minioadmin
|
||||
STORAGE_SECRET_KEY=minioadmin
|
||||
STORAGE_USE_SSL=false
|
||||
STORAGE_SKIP_BUCKET_CHECK=false
|
||||
|
||||
# Redis (for cache & server session management)
|
||||
REDIS_URL=redis://default:password@localhost:6379
|
||||
|
||||
# Sentry (for error reporting, Optional)
|
||||
# VITE_SENTRY_DSN=
|
||||
# Nx Cloud (Optional)
|
||||
# NX_CLOUD_ACCESS_TOKEN=
|
||||
|
||||
# Crowdin (Optional)
|
||||
CROWDIN_PROJECT_ID=
|
||||
CROWDIN_PERSONAL_TOKEN=
|
||||
# CROWDIN_PROJECT_ID=
|
||||
# CROWDIN_PERSONAL_TOKEN=
|
||||
|
||||
# Email (Optional)
|
||||
# DISABLE_EMAIL_AUTH=true
|
||||
# VITE_DISABLE_SIGNUPS=false
|
||||
# Feature Flags (Optional)
|
||||
# DISABLE_SIGNUPS=false
|
||||
# DISABLE_EMAIL_AUTH=false
|
||||
|
||||
# GitHub (OAuth, Optional)
|
||||
# GITHUB_CLIENT_ID=
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
"extends": ["plugin:prettier/recommended"],
|
||||
"plugins": ["simple-import-sort", "unused-imports"],
|
||||
"rules": {
|
||||
// eslint
|
||||
"no-return-await": "off",
|
||||
|
||||
// simple-import-sort
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error",
|
||||
@ -43,10 +46,38 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"extends": ["plugin:@nx/typescript"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": "latest",
|
||||
"project": ["tsconfig.*?.json"]
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@nx/typescript",
|
||||
"plugin:@typescript-eslint/strict-type-checked",
|
||||
"plugin:@typescript-eslint/stylistic-type-checked",
|
||||
"plugin:unicorn/recommended"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "unicorn"],
|
||||
"rules": {
|
||||
// typescript-eslint
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/return-await": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/no-redundant-type-constituents": "off",
|
||||
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
||||
|
||||
// unicorn
|
||||
"unicorn/no-null": "off",
|
||||
"unicorn/prevent-abbreviations": "off",
|
||||
"unicorn/prefer-string-replace-all": "off",
|
||||
"unicorn/prefer-structured-clone": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@ -21,7 +21,7 @@ body:
|
||||
label: Product Variant
|
||||
description: What variant of Reactive Resume are you using?
|
||||
options:
|
||||
- Cloud (http://rxresu.me)
|
||||
- Cloud (https://rxresu.me)
|
||||
- Self-Hosted
|
||||
validations:
|
||||
required: true
|
||||
|
||||
74
.github/workflows/lint-test-build.yml
vendored
74
.github/workflows/lint-test-build.yml
vendored
@ -1,45 +1,53 @@
|
||||
name: Lint, Test and Build
|
||||
name: Lint, Test & Build
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
NX_BRANCH: ${{ github.event.number || github.ref_name }}
|
||||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Nx Cloud - Main Job
|
||||
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.14.0
|
||||
with:
|
||||
main-branch-name: main
|
||||
number-of-agents: 3
|
||||
init-commands: |
|
||||
pnpm exec prisma generate
|
||||
pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
|
||||
parallel-commands: |
|
||||
pnpm exec nx-cloud record -- pnpm exec nx format:check
|
||||
parallel-commands-on-agents: |
|
||||
pnpm exec nx affected --target=lint --parallel=3
|
||||
pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage
|
||||
pnpm exec nx affected --target=build --parallel=3
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
agents:
|
||||
name: Nx Cloud - Agents
|
||||
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.14.0
|
||||
with:
|
||||
number-of-agents: 3
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3.0.0
|
||||
with:
|
||||
version: 9.1.3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4.0.2
|
||||
with:
|
||||
cache: "pnpm"
|
||||
node-version: 20.13.1
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
env:
|
||||
NODE_ENV: production
|
||||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
||||
|
||||
62
.github/workflows/publish-docker-image.yml
vendored
62
.github/workflows/publish-docker-image.yml
vendored
@ -7,7 +7,7 @@ on:
|
||||
- "*"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
@ -21,7 +21,6 @@ jobs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- linux/amd64
|
||||
@ -29,7 +28,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Extract version from package.json
|
||||
id: version
|
||||
@ -38,38 +37,42 @@ jobs:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.0.0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.0.0
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3.0.0
|
||||
uses: docker/login-action@v3.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registery
|
||||
uses: docker/login-action@v3.0.0
|
||||
uses: docker/login-action@v3.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.3.0
|
||||
|
||||
- name: Extract Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v5.5.1
|
||||
with:
|
||||
tags: type=semver,pattern={{version}},prefix=v,value=${{ steps.version.outputs.version }}
|
||||
images: |
|
||||
${{ env.IMAGE }}
|
||||
ghcr.io/${{ env.IMAGE }}
|
||||
|
||||
- name: Prepare a unique name for Artifacts
|
||||
id: artifact_name
|
||||
run: |
|
||||
name=$(echo -n "${{ matrix.platform }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g')
|
||||
echo "name=$name" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and Push by Digest
|
||||
uses: docker/build-push-action@v5.0.0
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
id: build
|
||||
with:
|
||||
context: .
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||
@ -83,9 +86,9 @@ jobs:
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload Digest
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4.3.3
|
||||
with:
|
||||
name: digests
|
||||
name: digests-${{ steps.artifact_name.outputs.name }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
@ -98,33 +101,34 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.1.4
|
||||
|
||||
- name: Download Digest
|
||||
uses: actions/download-artifact@v3.0.0
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: digests
|
||||
path: /tmp/digests
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.0.0
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3.0.0
|
||||
uses: docker/login-action@v3.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registery
|
||||
uses: docker/login-action@v3.0.0
|
||||
uses: docker/login-action@v3.1.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.3.0
|
||||
|
||||
- name: Extract Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v5.5.1
|
||||
with:
|
||||
tags: type=semver,pattern={{version}},prefix=v,value=${{ needs.build.outputs.version }}
|
||||
images: |
|
||||
@ -142,8 +146,18 @@ jobs:
|
||||
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
- name: Update Repository Description
|
||||
uses: peter-evans/dockerhub-description@v3
|
||||
uses: peter-evans/dockerhub-description@v4.0.0
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- uses: sarisia/actions-status-discord@v1.14.3
|
||||
if: always()
|
||||
with:
|
||||
username: ReleaseBot
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
status: ${{ job.status }}
|
||||
title: "Release `${{ steps.meta.outputs.version }}`"
|
||||
description: "A new version of Reactive Resume just dropped! 🚀"
|
||||
url: "https://github.com/AmruthPillai/Reactive-Resume"
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -16,14 +16,8 @@ node_modules
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# IDE - Visual Studio
|
||||
.vs/*
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
@ -48,7 +42,6 @@ Thumbs.db
|
||||
.swc
|
||||
fly.toml
|
||||
stats.html
|
||||
libs/prisma
|
||||
|
||||
# Environment Variables
|
||||
*.env*
|
||||
|
||||
7
.ncurc.json
Normal file
7
.ncurc.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/raineorshine/npm-check-updates/main/src/types/RunOptions.json",
|
||||
"upgrade": true,
|
||||
"install": "always",
|
||||
"packageManager": "pnpm",
|
||||
"reject": ["eslint", "eslint-plugin-unused-imports", "@reactive-resume/*"]
|
||||
}
|
||||
@ -2,4 +2,6 @@
|
||||
/coverage
|
||||
/.nx/cache
|
||||
stats.html
|
||||
pnpm-lock.yaml
|
||||
pnpm-lock.yaml
|
||||
compose-dev.yml
|
||||
compose.yml
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -10,5 +10,6 @@
|
||||
"tools/compose/*"
|
||||
]
|
||||
},
|
||||
"i18n-ally.localesPaths": ["apps/client/src/locales"]
|
||||
"i18n-ally.localesPaths": ["apps/client/src/locales"],
|
||||
"vitest.disableWorkspaceWarning": true
|
||||
}
|
||||
|
||||
@ -14,6 +14,6 @@ When it comes to **security**, you now have the option to protect your account w
|
||||
|
||||
From a **design** perspective, the motivation behind this is to ensure that Reactive Resume is taken more seriously and not perceived as just another subpar side-project, which is often associated with free software. My goal is to demonstrate that this is not the case, and that **free and open source software can be just as good**, if not better, than paid alternatives.
|
||||
|
||||
From a **self-hosting perspective**, it has never been simpler. Instead of running two separate services on your Docker (one for the client and one for the server) and struggling to establish communication between them, now you only need to pull a single image. Additionally, there are a few dependent services available on Docker (such as Postgres, Redis, Minio etc.) that you can also pull and have them all working together seamlessly.
|
||||
From a **self-hosting perspective**, it has never been simpler. Instead of running two separate services on your Docker (one for the client and one for the server) and struggling to establish communication between them, now you only need to pull a single image. Additionally, there are a few dependent services available on Docker (such as Postgres, Minio etc.) that you can also pull and have them all working together seamlessly.
|
||||
|
||||
I'm excited for you to try out the app, as I've spent months building it to perfection. If you enjoy the experience of building your resume using the app, please consider supporting by [becoming a GitHub Sponsor](https://github.com/sponsors/AmruthPillai).
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## Getting the project set up locally
|
||||
|
||||
There are a number of Docker Compose examples that are suitable for a wide variety of deployment strategies depending on your use-case. All of the examples can be found in the `tools/compose` folder.
|
||||
There are a number of Docker Compose examples that are suitable for a wide variety of deployment strategies depending on your use-case. All the examples can be found in the `tools/compose` folder.
|
||||
|
||||
To run the development environment of the application locally on your computer, please follow these steps:
|
||||
|
||||
@ -57,15 +57,13 @@ You can also visit `http://localhost:3000/api/health`, the health check endpoint
|
||||
"info": {
|
||||
"database": { "status": "up" },
|
||||
"storage": { "status": "up" },
|
||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" },
|
||||
"redis": { "status": "up" }
|
||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" }
|
||||
},
|
||||
"error": {},
|
||||
"details": {
|
||||
"database": { "status": "up" },
|
||||
"storage": { "status": "up" },
|
||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" },
|
||||
"redis": { "status": "up" }
|
||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@ -1,39 +1,45 @@
|
||||
ARG NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
# --- Base Image ---
|
||||
FROM node:lts-bullseye-slim AS base
|
||||
ARG NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
ARG NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
RUN corepack enable
|
||||
RUN corepack enable pnpm && corepack prepare pnpm@9.0.6 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# --- Build Image ---
|
||||
FROM base AS build
|
||||
|
||||
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
||||
ARG NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
COPY .npmrc package.json pnpm-lock.yaml ./
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
COPY ./tools/prisma /app/tools/prisma
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
RUN pnpm run build
|
||||
|
||||
# --- Release Image ---
|
||||
FROM base AS release
|
||||
ARG NX_CLOUD_ACCESS_TOKEN
|
||||
|
||||
RUN apt update && apt install -y dumb-init --no-install-recommends
|
||||
RUN apt update && apt install -y dumb-init --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --chown=node:node --from=build /app/.npmrc /app/package.json /app/pnpm-lock.yaml ./
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
RUN pnpm install --prod --frozen-lockfile
|
||||
|
||||
COPY --chown=node:node --from=build /app/dist ./dist
|
||||
COPY --chown=node:node --from=build /app/tools/prisma ./tools/prisma
|
||||
RUN pnpm run prisma:generate
|
||||
|
||||
ENV TZ=UTC
|
||||
ENV PORT=3000
|
||||
ENV NODE_ENV=production
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
@ -40,11 +40,11 @@ Start creating your standout resume with Reactive Resume today!
|
||||
|
||||
- **Free, forever** and open-source
|
||||
- No telemetry, user tracking or advertising
|
||||
- You can self-host the application in less then 30 seconds
|
||||
- You can self-host the application in less than 30 seconds
|
||||
- **Available in multiple languages** ([help add/improve your language here](https://translate.rxresu.me/))
|
||||
- Use your email address (or a throw-away address, no problem) to create an account
|
||||
- You can also sign in with your GitHub or Google account, and even set up two-factor authentication for extra security
|
||||
- Create as many resumes as you like under a single account, optimising each resume for every job application based on it’s description for a higher ATS score
|
||||
- Create as many resumes as you like under a single account, optimising each resume for every job application based on its description for a higher ATS score
|
||||
- **Bring your own OpenAI API key** and unlock features such as improving your writing, fixing spelling and grammar or changing the tone of your text in one-click
|
||||
- Translate your resume into any language using ChatGPT and import it back for easier editing
|
||||
- Create single page resumes or a resume that spans multiple pages easily
|
||||
@ -69,11 +69,9 @@ Start creating your standout resume with Reactive Resume today!
|
||||
- NestJS, for the backend
|
||||
- Postgres (primary database)
|
||||
- Prisma ORM, which frees you to switch to any other relational database with a few minor changes in the code
|
||||
- Redis (for caching, session storage and resume statistics)
|
||||
- Minio (for object storage: to store avatars, resume PDFs and previews)
|
||||
- Browserless (for headless chrome, to print PDFs and generate previews)
|
||||
- SMTP Server (to send password recovery emails)
|
||||
- Sentry (for error tracing and performance monitoring)
|
||||
- GitHub/Google OAuth (for quickly authenticating users)
|
||||
- LinguiJS and Crowdin (for translation management and localization)
|
||||
|
||||
|
||||
@ -11,4 +11,4 @@
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please raise an issue on GitHub to report any security vulnerabilities in the app. If the vulnerability is potentially lethal, send me an email about it on hello@amruthpillai.com.
|
||||
Please raise an issue on GitHub to report any security vulnerabilities in the app. If the vulnerability is potentially lethal, email me about it on hello@amruthpillai.com.
|
||||
|
||||
@ -12,6 +12,18 @@
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
// react
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/jsx-sort-props": [
|
||||
"error",
|
||||
{
|
||||
"reservedFirst": true,
|
||||
"callbacksLast": true,
|
||||
"shorthandFirst": true,
|
||||
"noSortAlphabetically": true
|
||||
}
|
||||
],
|
||||
|
||||
// react-hooks
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
const { join } = require("path");
|
||||
const path = require("node:path");
|
||||
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {
|
||||
config: join(__dirname, "tailwind.config.js"),
|
||||
config: path.join(__dirname, "tailwind.config.js"),
|
||||
},
|
||||
autoprefixer: {},
|
||||
},
|
||||
|
||||
@ -20,7 +20,7 @@ export const Page = ({ mode = "preview", pageNumber, children }: Props) => {
|
||||
return (
|
||||
<div
|
||||
data-page={pageNumber}
|
||||
className={cn("relative bg-white", mode === "builder" && "shadow-2xl")}
|
||||
className={cn("relative bg-background text-foreground", mode === "builder" && "shadow-2xl")}
|
||||
style={{
|
||||
fontFamily,
|
||||
width: `${pageSizeMap[page.format].width * MM_TO_PX}px`,
|
||||
|
||||
@ -4,7 +4,8 @@ import { RouterProvider } from "react-router-dom";
|
||||
|
||||
import { router } from "./router";
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const root = ReactDOM.createRoot(document.querySelector("#root")!);
|
||||
|
||||
root.render(
|
||||
<StrictMode>
|
||||
|
||||
@ -39,26 +39,19 @@ export const ArtboardPage = () => {
|
||||
`${metadata.typography.lineHeight}`,
|
||||
);
|
||||
|
||||
document.documentElement.style.setProperty("--color-text", `${metadata.theme.text}`);
|
||||
document.documentElement.style.setProperty("--color-primary", `${metadata.theme.primary}`);
|
||||
document.documentElement.style.setProperty(
|
||||
"--color-background",
|
||||
`${metadata.theme.background}`,
|
||||
);
|
||||
document.documentElement.style.setProperty("--color-foreground", metadata.theme.text);
|
||||
document.documentElement.style.setProperty("--color-primary", metadata.theme.primary);
|
||||
document.documentElement.style.setProperty("--color-background", metadata.theme.background);
|
||||
}, [metadata]);
|
||||
|
||||
// Typography Options
|
||||
useEffect(() => {
|
||||
if (metadata.typography.hideIcons) {
|
||||
document.querySelector("#root")!.classList.add("hide-icons");
|
||||
} else {
|
||||
document.querySelector("#root")!.classList.remove("hide-icons");
|
||||
}
|
||||
// eslint-disable-next-line unicorn/prefer-spread
|
||||
const elements = Array.from(document.querySelectorAll(`[data-page]`));
|
||||
|
||||
if (metadata.typography.underlineLinks) {
|
||||
document.querySelector("#root")!.classList.add("underline-links");
|
||||
} else {
|
||||
document.querySelector("#root")!.classList.remove("underline-links");
|
||||
for (const el of elements) {
|
||||
el.classList.toggle("hide-icons", metadata.typography.hideIcons);
|
||||
el.classList.toggle("underline-links", metadata.typography.underlineLinks);
|
||||
}
|
||||
}, [metadata]);
|
||||
|
||||
|
||||
@ -38,11 +38,11 @@ export const BuilderLayout = () => {
|
||||
|
||||
return (
|
||||
<TransformWrapper
|
||||
ref={transformRef}
|
||||
centerOnInit
|
||||
maxScale={2}
|
||||
minScale={0.4}
|
||||
initialScale={0.8}
|
||||
ref={transformRef}
|
||||
limitToBounds={false}
|
||||
>
|
||||
<TransformComponent
|
||||
@ -56,8 +56,8 @@ export const BuilderLayout = () => {
|
||||
<AnimatePresence>
|
||||
{layout.map((columns, pageIndex) => (
|
||||
<motion.div
|
||||
layout
|
||||
key={pageIndex}
|
||||
layout
|
||||
initial={{ opacity: 0, x: -200, y: 0 }}
|
||||
animate={{ opacity: 1, x: 0, transition: { delay: pageIndex * 0.3 } }}
|
||||
exit={{ opacity: 0, x: -200 }}
|
||||
|
||||
@ -20,7 +20,10 @@ export const Providers = () => {
|
||||
};
|
||||
|
||||
const resumeData = window.localStorage.getItem("resume");
|
||||
if (resumeData) return setResume(JSON.parse(resumeData));
|
||||
if (resumeData) {
|
||||
setResume(JSON.parse(resumeData));
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener("message", handleMessage);
|
||||
|
||||
@ -34,6 +37,7 @@ export const Providers = () => {
|
||||
// setResume(sampleResume);
|
||||
// }, [setResume]);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (!resume) return null;
|
||||
|
||||
return <Outlet />;
|
||||
|
||||
@ -8,5 +8,7 @@ export type ArtboardStore = {
|
||||
|
||||
export const useArtboardStore = create<ArtboardStore>()((set) => ({
|
||||
resume: null as unknown as ResumeData,
|
||||
setResume: (resume) => set({ resume }),
|
||||
setResume: (resume) => {
|
||||
set({ resume });
|
||||
},
|
||||
}));
|
||||
|
||||
@ -12,14 +12,14 @@
|
||||
@apply antialiased;
|
||||
}
|
||||
|
||||
#root.hide-icons .ph {
|
||||
[data-page].hide-icons .ph {
|
||||
@apply hidden;
|
||||
}
|
||||
|
||||
#root.underline-links a {
|
||||
[data-page].underline-links a {
|
||||
@apply underline underline-offset-2;
|
||||
}
|
||||
|
||||
.wysiwyg {
|
||||
@apply prose max-w-none text-current prose-headings:mt-0 prose-headings:mb-2 prose-p:mt-0 prose-p:mb-2 prose-ul:mt-0 prose-ul:mb-2 prose-li:mt-0 prose-li:mb-2 prose-ol:mt-0 prose-ol:mb-2 prose-img:mt-0 prose-img:mb-2 prose-hr:mt-0 prose-hr:mb-2 prose-p:leading-normal prose-li:leading-normal;
|
||||
@apply prose max-w-none prose-foreground prose-headings:mt-0 prose-headings:mb-2 prose-p:mt-0 prose-p:mb-2 prose-ul:mt-0 prose-ul:mb-2 prose-li:mt-0 prose-li:mb-2 prose-ol:mt-0 prose-ol:mb-2 prose-img:mt-0 prose-img:mb-2 prose-hr:mt-0 prose-hr:mb-2 prose-p:leading-normal prose-li:leading-normal prose-a:break-all;
|
||||
}
|
||||
|
||||
@ -93,9 +93,9 @@ const Summary = () => {
|
||||
<div className="absolute left-[-4.5px] top-[8px] hidden size-[8px] rounded-full bg-primary group-[.main]:block" />
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</main>
|
||||
</section>
|
||||
@ -117,28 +117,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -158,7 +181,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -196,7 +219,7 @@ const Section = <T,>({
|
||||
<div>{children?.(item as T)}</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -205,7 +228,7 @@ const Section = <T,>({
|
||||
<p className="text-sm">{keywords.join(", ")}</p>
|
||||
)}
|
||||
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
|
||||
<div className="absolute left-[-4.5px] top-px hidden size-[8px] rounded-full bg-primary group-[.main]:block" />
|
||||
</div>
|
||||
@ -241,7 +264,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -255,7 +278,12 @@ const Experience = () => {
|
||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -272,7 +300,12 @@ const Education = () => {
|
||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
<div>{item.studyType}</div>
|
||||
@ -291,7 +324,7 @@ const Awards = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity name={item.awarder} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -307,7 +340,7 @@ const Certifications = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -347,7 +380,12 @@ const Publications = () => {
|
||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
@ -363,7 +401,12 @@ const Volunteer = () => {
|
||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -396,7 +439,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -414,7 +462,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -435,7 +488,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -449,36 +507,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ const Summary = () => {
|
||||
</div>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg col-span-4"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -108,28 +108,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -149,7 +172,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid grid-cols-5 border-t pt-2.5">
|
||||
@ -173,11 +196,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -218,7 +241,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -233,7 +256,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -255,7 +283,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -279,7 +312,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -300,7 +337,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -345,7 +382,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -366,7 +408,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -403,7 +450,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -423,7 +475,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -444,7 +501,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -460,36 +522,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ const Summary = () => {
|
||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -111,28 +111,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -152,7 +175,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -174,11 +197,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -202,7 +225,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -224,7 +252,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -264,7 +297,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -280,7 +313,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -302,6 +339,7 @@ const Certifications = () => {
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -346,7 +384,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -367,7 +410,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -404,7 +452,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -424,7 +477,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -445,7 +503,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -461,36 +524,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -498,7 +575,7 @@ export const Chikorita = ({ columns, isFirstPage = false }: TemplateProps) => {
|
||||
const [main, sidebar] = columns;
|
||||
|
||||
return (
|
||||
<div className="grid h-full grid-cols-3">
|
||||
<div className="grid min-h-[inherit] grid-cols-3">
|
||||
<div className="main p-custom group col-span-2 space-y-4">
|
||||
{isFirstPage && <Header />}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ const Header = () => {
|
||||
<p>{basics.headline}</p>
|
||||
</div>
|
||||
|
||||
<div className="text-text col-span-2 col-start-2 mt-10">
|
||||
<div className="col-span-2 col-start-2 mt-10 text-foreground">
|
||||
<div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm">
|
||||
{basics.location && (
|
||||
<>
|
||||
@ -104,9 +104,9 @@ const Summary = () => {
|
||||
<h4 className="mb-2 text-base font-bold">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -128,28 +128,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -169,7 +192,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -195,14 +218,14 @@ const Section = <T,>({
|
||||
<div className="relative -ml-4 group-[.sidebar]:ml-0">
|
||||
<div className="pl-4 group-[.sidebar]:pl-0">
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
<div className="absolute inset-y-0 -left-px border-l-[4px] border-primary group-[.sidebar]:hidden" />
|
||||
<div className="absolute inset-y-0 -left-px border-l-4 border-primary group-[.sidebar]:hidden" />
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -245,7 +268,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -260,7 +283,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -282,7 +310,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -306,7 +339,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -327,7 +364,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -372,7 +409,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -393,7 +435,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -430,7 +477,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -450,7 +502,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -471,7 +528,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -487,36 +549,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -82,9 +82,9 @@ const Summary = () => {
|
||||
return (
|
||||
<section id={section.id}>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -106,28 +106,57 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-background" />}
|
||||
{!iconOnRight &&
|
||||
(icon ?? (
|
||||
<i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-background" />
|
||||
))}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight &&
|
||||
(icon ?? (
|
||||
<i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-background" />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary group-[.sidebar]:text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -147,7 +176,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -169,11 +198,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -214,7 +243,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -229,7 +258,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -251,7 +285,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -275,7 +314,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||
@ -296,7 +339,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||
@ -341,7 +384,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -362,7 +410,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -399,7 +452,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -419,7 +477,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -440,7 +503,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -456,34 +524,47 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ const Summary = () => {
|
||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -114,28 +114,53 @@ const Rating = ({ level }: RatingProps) => {
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-primary" />}
|
||||
{!iconOnRight &&
|
||||
(icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight &&
|
||||
(icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary group-[.sidebar]:text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -155,7 +180,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -179,11 +204,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -207,7 +232,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -229,7 +259,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -269,7 +304,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -285,7 +320,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -306,7 +345,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -351,7 +390,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -372,7 +416,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -409,7 +458,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -429,7 +483,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -450,7 +509,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -466,36 +530,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -15,31 +15,44 @@ import { Rhyhorn } from "./rhyhorn";
|
||||
|
||||
export const getTemplate = (template: Template) => {
|
||||
switch (template) {
|
||||
case "azurill":
|
||||
case "azurill": {
|
||||
return Azurill;
|
||||
case "bronzor":
|
||||
}
|
||||
case "bronzor": {
|
||||
return Bronzor;
|
||||
case "chikorita":
|
||||
}
|
||||
case "chikorita": {
|
||||
return Chikorita;
|
||||
case "ditto":
|
||||
}
|
||||
case "ditto": {
|
||||
return Ditto;
|
||||
case "gengar":
|
||||
}
|
||||
case "gengar": {
|
||||
return Gengar;
|
||||
case "glalie":
|
||||
}
|
||||
case "glalie": {
|
||||
return Glalie;
|
||||
case "kakuna":
|
||||
}
|
||||
case "kakuna": {
|
||||
return Kakuna;
|
||||
case "leafish":
|
||||
}
|
||||
case "leafish": {
|
||||
return Leafish;
|
||||
case "nosepass":
|
||||
}
|
||||
case "nosepass": {
|
||||
return Nosepass;
|
||||
case "onyx":
|
||||
}
|
||||
case "onyx": {
|
||||
return Onyx;
|
||||
case "pikachu":
|
||||
}
|
||||
case "pikachu": {
|
||||
return Pikachu;
|
||||
case "rhyhorn":
|
||||
}
|
||||
case "rhyhorn": {
|
||||
return Rhyhorn;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
return Onyx;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -110,9 +110,9 @@ const Summary = () => {
|
||||
</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -134,28 +134,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -175,7 +198,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -200,7 +223,7 @@ const Section = <T,>({
|
||||
<div>{children?.(item as T)}</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -209,7 +232,7 @@ const Section = <T,>({
|
||||
<p className="text-sm">{keywords.join(", ")}</p>
|
||||
)}
|
||||
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@ -225,7 +248,12 @@ const Experience = () => {
|
||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -242,7 +270,12 @@ const Education = () => {
|
||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
<div>{item.studyType}</div>
|
||||
@ -261,7 +294,7 @@ const Awards = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity name={item.awarder} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -277,7 +310,7 @@ const Certifications = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -317,7 +350,12 @@ const Publications = () => {
|
||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
@ -333,7 +371,12 @@ const Volunteer = () => {
|
||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -366,7 +409,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
@ -383,7 +431,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -404,7 +457,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -417,34 +475,47 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "summary":
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -44,9 +44,9 @@ const Header = () => {
|
||||
</div>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -131,28 +131,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -172,7 +195,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -197,7 +220,7 @@ const Section = <T,>({
|
||||
<div>{children?.(item as T)}</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -206,7 +229,7 @@ const Section = <T,>({
|
||||
<p className="text-sm">{keywords.join(", ")}</p>
|
||||
)}
|
||||
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@ -222,7 +245,12 @@ const Experience = () => {
|
||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -239,7 +267,12 @@ const Education = () => {
|
||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
<div>{item.studyType}</div>
|
||||
@ -258,7 +291,7 @@ const Awards = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity name={item.awarder} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -274,7 +307,7 @@ const Certifications = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -314,7 +347,12 @@ const Publications = () => {
|
||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
@ -330,7 +368,12 @@ const Volunteer = () => {
|
||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -363,7 +406,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
</div>
|
||||
@ -380,7 +428,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -401,7 +454,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
<div>{item.location}</div>
|
||||
<div className="font-bold">{item.date}</div>
|
||||
@ -414,32 +472,44 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "experience":
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -98,9 +98,9 @@ const Summary = () => {
|
||||
</div>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
@ -110,28 +110,51 @@ const Summary = () => {
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -150,7 +173,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}>
|
||||
@ -184,10 +207,10 @@ const Section = <T,>({
|
||||
<div className="col-span-3 space-y-1">
|
||||
{children?.(item as T)}
|
||||
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{keywords !== undefined && keywords.length > 0 && (
|
||||
@ -219,10 +242,10 @@ const Section = <T,>({
|
||||
<div key={item.id}>
|
||||
{children?.(item as T)}
|
||||
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{keywords !== undefined && keywords.length > 0 && (
|
||||
@ -263,7 +286,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -277,7 +300,12 @@ const Experience = () => {
|
||||
<Section<Experience> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
</div>
|
||||
@ -293,7 +321,12 @@ const Education = () => {
|
||||
<Section<Education> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.studyType}</div>
|
||||
<div>{item.score}</div>
|
||||
@ -311,7 +344,7 @@ const Awards = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity name={item.awarder} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -326,7 +359,7 @@ const Certifications = () => {
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -365,7 +398,12 @@ const Publications = () => {
|
||||
<Section<Publication> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -380,7 +418,12 @@ const Volunteer = () => {
|
||||
<Section<Volunteer> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
<div>{item.location}</div>
|
||||
</div>
|
||||
@ -417,7 +460,12 @@ const Projects = () => {
|
||||
>
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -432,7 +480,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -453,7 +506,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
>
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
<div>{item.location}</div>
|
||||
</div>
|
||||
@ -464,36 +522,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -505,7 +577,7 @@ export const Nosepass = ({ columns, isFirstPage = false }: TemplateProps) => {
|
||||
return (
|
||||
<div className="p-custom space-y-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<img alt="Europass Logo" className="h-[42px]" src="https://i.imgur.com/eRK005p.png" />
|
||||
<img alt="Europass Logo" className="h-[42px]" src="/assets/europass.png" />
|
||||
|
||||
<p className="font-medium text-primary">Curriculum Vitae</p>
|
||||
|
||||
|
||||
@ -113,9 +113,9 @@ const Summary = () => {
|
||||
<h4 className="font-bold text-primary">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -137,28 +137,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -178,7 +201,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -200,11 +223,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -228,7 +251,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -250,7 +278,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -274,7 +307,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -295,7 +332,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -340,7 +377,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -361,7 +403,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -398,7 +445,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -418,7 +470,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -439,7 +496,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -455,34 +517,47 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "summary":
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -105,9 +105,9 @@ const Summary = () => {
|
||||
<h4 className="mb-2 border-b border-primary text-base font-bold">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -137,28 +137,57 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary group-[.summary]:text-background" />}
|
||||
{!iconOnRight &&
|
||||
(icon ?? (
|
||||
<i className="ph ph-bold ph-link text-primary group-[.summary]:text-background" />
|
||||
))}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight &&
|
||||
(icon ?? (
|
||||
<i className="ph ph-bold ph-link text-primary group-[.summary]:text-background" />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary group-[.summary]:text-background" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -178,7 +207,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -200,11 +229,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -245,7 +274,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -260,7 +289,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -282,7 +316,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -306,7 +345,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||
@ -327,7 +370,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||
@ -372,7 +415,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -393,7 +441,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -430,7 +483,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -450,7 +508,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -471,7 +534,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -487,36 +555,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -85,9 +85,9 @@ const Summary = () => {
|
||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
className="wysiwyg"
|
||||
style={{ columns: section.columns }}
|
||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
@ -109,28 +109,51 @@ const Rating = ({ level }: RatingProps) => (
|
||||
type LinkProps = {
|
||||
url: URL;
|
||||
icon?: React.ReactNode;
|
||||
iconOnRight?: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
||||
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||
if (!isUrl(url.href)) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-1.5">
|
||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
||||
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
<a
|
||||
href={url.href}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
className={cn("inline-block", className)}
|
||||
>
|
||||
{label || url.label || url.href}
|
||||
{label ?? (url.label || url.href)}
|
||||
</a>
|
||||
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type LinkedEntityProps = {
|
||||
name: string;
|
||||
url: URL;
|
||||
separateLinks: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const LinkedEntity = ({ name, url, separateLinks, className }: LinkedEntityProps) => {
|
||||
return !separateLinks && isUrl(url.href) ? (
|
||||
<Link
|
||||
url={url}
|
||||
label={name}
|
||||
icon={<i className="ph ph-bold ph-globe text-primary" />}
|
||||
iconOnRight={true}
|
||||
className={className}
|
||||
/>
|
||||
) : (
|
||||
<div className={className}>{name}</div>
|
||||
);
|
||||
};
|
||||
|
||||
type SectionProps<T> = {
|
||||
section: SectionWithItem<T> | CustomSectionGroup;
|
||||
children?: (item: T) => React.ReactNode;
|
||||
@ -150,7 +173,7 @@ const Section = <T,>({
|
||||
summaryKey,
|
||||
keywordsKey,
|
||||
}: SectionProps<T>) => {
|
||||
if (!section.visible || !section.items.length) return null;
|
||||
if (!section.visible || section.items.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section id={section.id} className="grid">
|
||||
@ -172,11 +195,11 @@ const Section = <T,>({
|
||||
<div key={item.id} className={cn("space-y-2", className)}>
|
||||
<div>
|
||||
{children?.(item as T)}
|
||||
{url !== undefined && <Link url={url} />}
|
||||
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||
</div>
|
||||
|
||||
{summary !== undefined && !isEmptyString(summary) && (
|
||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||
)}
|
||||
|
||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||
@ -217,7 +240,7 @@ const Profiles = () => {
|
||||
) : (
|
||||
<p>{item.username}</p>
|
||||
)}
|
||||
<p className="text-sm">{item.network}</p>
|
||||
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||
</div>
|
||||
)}
|
||||
</Section>
|
||||
@ -232,7 +255,12 @@ const Experience = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.company}</div>
|
||||
<LinkedEntity
|
||||
name={item.company}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -254,7 +282,12 @@ const Education = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.institution}</div>
|
||||
<LinkedEntity
|
||||
name={item.institution}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.area}</div>
|
||||
<div>{item.score}</div>
|
||||
</div>
|
||||
@ -278,7 +311,11 @@ const Awards = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.title}</div>
|
||||
<div>{item.awarder}</div>
|
||||
<LinkedEntity
|
||||
name={item.awarder}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -299,7 +336,7 @@ const Certifications = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<div>{item.issuer}</div>
|
||||
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-right">
|
||||
@ -344,7 +381,12 @@ const Publications = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.publisher}</div>
|
||||
</div>
|
||||
|
||||
@ -365,7 +407,12 @@ const Volunteer = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.organization}</div>
|
||||
<LinkedEntity
|
||||
name={item.organization}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.position}</div>
|
||||
</div>
|
||||
|
||||
@ -402,7 +449,12 @@ const Projects = () => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -422,7 +474,12 @@ const References = () => {
|
||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||
{(item) => (
|
||||
<div>
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
)}
|
||||
@ -443,7 +500,12 @@ const Custom = ({ id }: { id: string }) => {
|
||||
{(item) => (
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="text-left">
|
||||
<div className="font-bold">{item.name}</div>
|
||||
<LinkedEntity
|
||||
name={item.name}
|
||||
url={item.url}
|
||||
separateLinks={section.separateLinks}
|
||||
className="font-bold"
|
||||
/>
|
||||
<div>{item.description}</div>
|
||||
</div>
|
||||
|
||||
@ -459,36 +521,50 @@ const Custom = ({ id }: { id: string }) => {
|
||||
|
||||
const mapSectionToComponent = (section: SectionKey) => {
|
||||
switch (section) {
|
||||
case "profiles":
|
||||
case "profiles": {
|
||||
return <Profiles />;
|
||||
case "summary":
|
||||
}
|
||||
case "summary": {
|
||||
return <Summary />;
|
||||
case "experience":
|
||||
}
|
||||
case "experience": {
|
||||
return <Experience />;
|
||||
case "education":
|
||||
}
|
||||
case "education": {
|
||||
return <Education />;
|
||||
case "awards":
|
||||
}
|
||||
case "awards": {
|
||||
return <Awards />;
|
||||
case "certifications":
|
||||
}
|
||||
case "certifications": {
|
||||
return <Certifications />;
|
||||
case "skills":
|
||||
}
|
||||
case "skills": {
|
||||
return <Skills />;
|
||||
case "interests":
|
||||
}
|
||||
case "interests": {
|
||||
return <Interests />;
|
||||
case "publications":
|
||||
}
|
||||
case "publications": {
|
||||
return <Publications />;
|
||||
case "volunteer":
|
||||
}
|
||||
case "volunteer": {
|
||||
return <Volunteer />;
|
||||
case "languages":
|
||||
}
|
||||
case "languages": {
|
||||
return <Languages />;
|
||||
case "projects":
|
||||
}
|
||||
case "projects": {
|
||||
return <Projects />;
|
||||
case "references":
|
||||
}
|
||||
case "references": {
|
||||
return <References />;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -4,8 +4,3 @@ export type TemplateProps = {
|
||||
columns: SectionKey[][];
|
||||
isFirstPage?: boolean;
|
||||
};
|
||||
|
||||
export type BaseProps = {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
@ -11,7 +11,7 @@ module.exports = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
text: "var(--color-text)",
|
||||
foreground: "var(--color-foreground)",
|
||||
primary: "var(--color-primary)",
|
||||
background: "var(--color-background)",
|
||||
},
|
||||
@ -23,6 +23,28 @@ module.exports = {
|
||||
loose: "calc(var(--line-height) + 0.5)",
|
||||
},
|
||||
spacing: { custom: "var(--margin)" },
|
||||
typography: () => ({
|
||||
foreground: {
|
||||
css: {
|
||||
"--tw-prose-body": "var(--color-foreground)",
|
||||
"--tw-prose-headings": "var(--color-foreground)",
|
||||
"--tw-prose-lead": "var(--color-foreground)",
|
||||
"--tw-prose-links": "var(--color-foreground)",
|
||||
"--tw-prose-bold": "var(--color-foreground)",
|
||||
"--tw-prose-counters": "var(--color-foreground)",
|
||||
"--tw-prose-bullets": "var(--color-foreground)",
|
||||
"--tw-prose-hr": "var(--color-foreground)",
|
||||
"--tw-prose-quotes": "var(--color-foreground)",
|
||||
"--tw-prose-quote-borders": "var(--color-foreground)",
|
||||
"--tw-prose-captions": "var(--color-foreground)",
|
||||
"--tw-prose-code": "var(--color-foreground)",
|
||||
"--tw-prose-pre-code": "var(--color-foreground)",
|
||||
"--tw-prose-pre-bg": "var(--color-background)",
|
||||
"--tw-prose-th-borders": "var(--color-foreground)",
|
||||
"--tw-prose-td-borders": "var(--color-foreground)",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
plugins: [require("@tailwindcss/typography")],
|
||||
|
||||
@ -5,14 +5,14 @@
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"types": ["vite/client"],
|
||||
"types": ["vite/client"]
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json",
|
||||
},
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
],
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"extends": "../../tsconfig.base.json"
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import { defineConfig, searchForWorkspaceRoot, splitVendorChunkPlugin } from "vite";
|
||||
import { defineConfig, searchForWorkspaceRoot } from "vite";
|
||||
|
||||
export default defineConfig({
|
||||
base: "/artboard/",
|
||||
@ -11,15 +11,16 @@ export default defineConfig({
|
||||
|
||||
build: {
|
||||
sourcemap: true,
|
||||
emptyOutDir: true,
|
||||
},
|
||||
|
||||
server: {
|
||||
host: true,
|
||||
port: +(process.env.__DEV__ARTBOARD_PORT ?? 6173),
|
||||
port: 6173,
|
||||
fs: { allow: [searchForWorkspaceRoot(process.cwd())] },
|
||||
},
|
||||
|
||||
plugins: [react(), nxViteTsPaths(), splitVendorChunkPlugin()],
|
||||
plugins: [react(), nxViteTsPaths()],
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
@ -11,11 +11,24 @@
|
||||
"settings": {
|
||||
"tailwindcss": {
|
||||
"callees": ["cn", "clsx", "cva"],
|
||||
"config": "tailwind.config.js"
|
||||
"config": "tailwind.config.js",
|
||||
"whitelist": ["ph", "ph-"]
|
||||
}
|
||||
},
|
||||
"plugins": ["lingui"],
|
||||
"rules": {
|
||||
// react
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/jsx-sort-props": [
|
||||
"error",
|
||||
{
|
||||
"reservedFirst": true,
|
||||
"callbacksLast": true,
|
||||
"shorthandFirst": true,
|
||||
"noSortAlphabetically": true
|
||||
}
|
||||
],
|
||||
|
||||
// react-hooks
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
|
||||
|
||||
@ -35,10 +35,13 @@
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="/src/styles/main.css" />
|
||||
</head>
|
||||
<body class="bg-background text-foreground text-sm antialiased print:bg-white print:m-0">
|
||||
<body class="text-sm antialiased bg-background text-foreground print:bg-white print:m-0">
|
||||
<div id="root"></div>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
|
||||
<!-- Phosphor Icons -->
|
||||
<script src="https://unpkg.com/@phosphor-icons/web"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
const { join } = require("path");
|
||||
const path = require("node:path");
|
||||
|
||||
module.exports = {
|
||||
plugins: {
|
||||
"postcss-import": {},
|
||||
"tailwindcss/nesting": {},
|
||||
tailwindcss: { config: join(__dirname, "tailwind.config.js") },
|
||||
tailwindcss: { config: path.join(__dirname, "tailwind.config.js") },
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
|
||||
BIN
apps/client/public/assets/europass.png
Normal file
BIN
apps/client/public/assets/europass.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@ -54,7 +54,7 @@ export const AiActions = ({ value, onChange, className }: Props) => {
|
||||
toast({
|
||||
variant: "error",
|
||||
title: t`Oops, the server returned an error.`,
|
||||
description: (error as Error)?.message,
|
||||
description: (error as Error).message,
|
||||
});
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@ -27,10 +27,7 @@ export const Copyright = ({ className }: Props) => (
|
||||
<span>{t`By the community, for the community.`}</span>
|
||||
<span>
|
||||
<Trans>
|
||||
A passion project by{" "}
|
||||
<a target="_blank" rel="noopener noreferrer nofollow" href="https://www.amruthpillai.com/">
|
||||
Amruth Pillai
|
||||
</a>
|
||||
A passion project by <a href="https://www.amruthpillai.com/">Amruth Pillai</a>
|
||||
</Trans>
|
||||
</span>
|
||||
|
||||
|
||||
@ -12,12 +12,14 @@ export const Icon = ({ size = 32, className }: Props) => {
|
||||
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
||||
|
||||
switch (isDarkMode) {
|
||||
case false:
|
||||
case false: {
|
||||
src = "/icon/dark.svg";
|
||||
break;
|
||||
case true:
|
||||
}
|
||||
case true: {
|
||||
src = "/icon/light.svg";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
@ -37,39 +38,43 @@ export const LocaleCombobox = ({ value, onValueChange }: Props) => {
|
||||
<Command shouldFilter={false}>
|
||||
<CommandInput
|
||||
value={search}
|
||||
onValueChange={setSearch}
|
||||
placeholder={t`Search for a language`}
|
||||
onValueChange={setSearch}
|
||||
/>
|
||||
<CommandEmpty>{t`No results found`}</CommandEmpty>
|
||||
<CommandGroup>
|
||||
<ScrollArea orientation="vertical">
|
||||
<div className="max-h-60">
|
||||
{options.map(({ original }) => (
|
||||
<CommandItem
|
||||
key={original.locale}
|
||||
value={original.locale.trim().toLowerCase()}
|
||||
onSelect={async (selectedValue) => {
|
||||
const result = options.find(
|
||||
({ original }) => original.locale.trim().toLowerCase() === selectedValue,
|
||||
);
|
||||
<CommandList>
|
||||
<CommandEmpty>{t`No results found`}</CommandEmpty>
|
||||
<CommandGroup>
|
||||
<ScrollArea orientation="vertical">
|
||||
<div className="max-h-60">
|
||||
{options.map(({ original }) => (
|
||||
<CommandItem
|
||||
key={original.locale}
|
||||
disabled={false}
|
||||
value={original.locale.trim()}
|
||||
onSelect={(selectedValue) => {
|
||||
const result = options.find(
|
||||
({ original }) => original.locale.trim() === selectedValue,
|
||||
);
|
||||
|
||||
if (!result) return null;
|
||||
if (!result) return null;
|
||||
|
||||
onValueChange(result.original.locale);
|
||||
}}
|
||||
>
|
||||
<Check
|
||||
className={cn(
|
||||
"mr-2 size-4 opacity-0",
|
||||
value === original.locale && "opacity-100",
|
||||
)}
|
||||
/>
|
||||
{original.name} <span className="ml-1 text-xs opacity-50">({original.locale})</span>
|
||||
</CommandItem>
|
||||
))}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</CommandGroup>
|
||||
onValueChange(result.original.locale);
|
||||
}}
|
||||
>
|
||||
<Check
|
||||
className={cn(
|
||||
"mr-2 size-4 opacity-0",
|
||||
value === original.locale && "opacity-100",
|
||||
)}
|
||||
/>
|
||||
{original.name}{" "}
|
||||
<span className="ml-1 text-xs opacity-50">({original.locale})</span>
|
||||
</CommandItem>
|
||||
))}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
</Command>
|
||||
);
|
||||
};
|
||||
|
||||
@ -12,12 +12,14 @@ export const Logo = ({ size = 32, className }: Props) => {
|
||||
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
||||
|
||||
switch (isDarkMode) {
|
||||
case false:
|
||||
case false: {
|
||||
src = "/logo/light.svg";
|
||||
break;
|
||||
case true:
|
||||
}
|
||||
case true: {
|
||||
src = "/logo/dark.svg";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -12,9 +12,18 @@ export const UserAvatar = ({ size = 36, className }: Props) => {
|
||||
|
||||
if (!user) return null;
|
||||
|
||||
let picture: React.ReactNode = null;
|
||||
let picture: React.ReactNode;
|
||||
|
||||
if (!user.picture) {
|
||||
if (user.picture) {
|
||||
picture = (
|
||||
<img
|
||||
alt={user.name}
|
||||
src={user.picture}
|
||||
className="rounded-full"
|
||||
style={{ width: size, height: size }}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
const initials = getInitials(user.name);
|
||||
|
||||
picture = (
|
||||
@ -25,15 +34,6 @@ export const UserAvatar = ({ size = 36, className }: Props) => {
|
||||
{initials}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
picture = (
|
||||
<img
|
||||
alt={user.name}
|
||||
src={user.picture}
|
||||
className="rounded-full"
|
||||
style={{ width: size, height: size }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <div className={className}>{picture}</div>;
|
||||
|
||||
@ -24,7 +24,11 @@ export const UserOptions = ({ children }: Props) => {
|
||||
<DropdownMenuTrigger asChild>{children}</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent side="top" align="start" className="w-48">
|
||||
<DropdownMenuItem onClick={() => navigate("/dashboard/settings")}>
|
||||
<DropdownMenuItem
|
||||
onClick={() => {
|
||||
navigate("/dashboard/settings");
|
||||
}}
|
||||
>
|
||||
{t`Settings`}
|
||||
{/* eslint-disable-next-line lingui/no-unlocalized-strings */}
|
||||
<KeyboardShortcut>⇧S</KeyboardShortcut>
|
||||
|
||||
@ -40,9 +40,9 @@ type Action =
|
||||
toastId?: ToasterToast["id"];
|
||||
};
|
||||
|
||||
interface State {
|
||||
type State = {
|
||||
toasts: ToasterToast[];
|
||||
}
|
||||
};
|
||||
|
||||
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
||||
|
||||
@ -64,17 +64,19 @@ const addToRemoveQueue = (toastId: string) => {
|
||||
|
||||
export const reducer = (state: State, action: Action): State => {
|
||||
switch (action.type) {
|
||||
case "ADD_TOAST":
|
||||
case "ADD_TOAST": {
|
||||
return {
|
||||
...state,
|
||||
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
||||
};
|
||||
}
|
||||
|
||||
case "UPDATE_TOAST":
|
||||
case "UPDATE_TOAST": {
|
||||
return {
|
||||
...state,
|
||||
toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
|
||||
};
|
||||
}
|
||||
|
||||
case "DISMISS_TOAST": {
|
||||
const { toastId } = action;
|
||||
@ -82,9 +84,9 @@ export const reducer = (state: State, action: Action): State => {
|
||||
if (toastId) {
|
||||
addToRemoveQueue(toastId);
|
||||
} else {
|
||||
state.toasts.forEach((toast) => {
|
||||
for (const toast of state.toasts) {
|
||||
addToRemoveQueue(toast.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
@ -99,7 +101,7 @@ export const reducer = (state: State, action: Action): State => {
|
||||
),
|
||||
};
|
||||
}
|
||||
case "REMOVE_TOAST":
|
||||
case "REMOVE_TOAST": {
|
||||
if (action.toastId === undefined) {
|
||||
return {
|
||||
...state,
|
||||
@ -110,18 +112,19 @@ export const reducer = (state: State, action: Action): State => {
|
||||
...state,
|
||||
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const listeners: Array<(state: State) => void> = [];
|
||||
const listeners: ((state: State) => void)[] = [];
|
||||
|
||||
let memoryState: State = { toasts: [] };
|
||||
|
||||
function dispatch(action: Action) {
|
||||
memoryState = reducer(memoryState, action);
|
||||
listeners.forEach((listener) => {
|
||||
for (const listener of listeners) {
|
||||
listener(memoryState);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
type Toast = Omit<ToasterToast, "id">;
|
||||
@ -129,12 +132,15 @@ type Toast = Omit<ToasterToast, "id">;
|
||||
function toast({ ...props }: Toast) {
|
||||
const id = createId();
|
||||
|
||||
const update = (props: ToasterToast) =>
|
||||
const update = (props: ToasterToast) => {
|
||||
dispatch({
|
||||
type: "UPDATE_TOAST",
|
||||
toast: { ...props, id },
|
||||
});
|
||||
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
||||
};
|
||||
const dismiss = () => {
|
||||
dispatch({ type: "DISMISS_TOAST", toastId: id });
|
||||
};
|
||||
|
||||
dispatch({
|
||||
type: "ADD_TOAST",
|
||||
@ -170,7 +176,9 @@ function useToast() {
|
||||
return {
|
||||
...state,
|
||||
toast,
|
||||
dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
||||
dismiss: (toastId?: string) => {
|
||||
dispatch({ type: "DISMISS_TOAST", toastId });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -4,18 +4,13 @@ import _axios from "axios";
|
||||
import createAuthRefreshInterceptor from "axios-auth-refresh";
|
||||
import { redirect } from "react-router-dom";
|
||||
|
||||
import { refreshToken } from "@/client/services/auth";
|
||||
|
||||
import { USER_KEY } from "../constants/query-keys";
|
||||
import { toast } from "../hooks/use-toast";
|
||||
import { refresh } from "../services/auth/refresh";
|
||||
import { translateError } from "../services/errors/translate-error";
|
||||
import { queryClient } from "./query-client";
|
||||
|
||||
export type ServerError = {
|
||||
statusCode: number;
|
||||
message: string;
|
||||
error: string;
|
||||
};
|
||||
|
||||
export const axios = _axios.create({ baseURL: "/api", withCredentials: true });
|
||||
|
||||
// Intercept responses to transform ISO dates to JS date objects
|
||||
@ -36,7 +31,7 @@ axios.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
return Promise.reject(new Error(message));
|
||||
},
|
||||
);
|
||||
|
||||
@ -45,26 +40,12 @@ axios.interceptors.response.use(
|
||||
const axiosForRefresh = _axios.create({ baseURL: "/api", withCredentials: true });
|
||||
|
||||
// Interceptor to handle expired access token errors
|
||||
const handleAuthError = async () => {
|
||||
try {
|
||||
await refresh(axiosForRefresh);
|
||||
|
||||
return Promise.resolve();
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
};
|
||||
const handleAuthError = () => refreshToken(axiosForRefresh);
|
||||
|
||||
// Interceptor to handle expired refresh token errors
|
||||
const handleRefreshError = async () => {
|
||||
try {
|
||||
queryClient.invalidateQueries({ queryKey: USER_KEY });
|
||||
redirect("/auth/login");
|
||||
|
||||
return Promise.resolve();
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
await queryClient.invalidateQueries({ queryKey: USER_KEY });
|
||||
redirect("/auth/login");
|
||||
};
|
||||
|
||||
// Intercept responses to check for 401 and 403 errors, refresh token and retry the request
|
||||
|
||||
@ -13,6 +13,7 @@ export async function dynamicActivate(locale: string) {
|
||||
i18n.loadAndActivate({ locale, messages });
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (dayjsLocales[locale]) {
|
||||
dayjs.locale(await dayjsLocales[locale]());
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1711
apps/client/src/locales/ms-MY/messages.po
Normal file
1711
apps/client/src/locales/ms-MY/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1711
apps/client/src/locales/sq-AL/messages.po
Normal file
1711
apps/client/src/locales/sq-AL/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user