mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 04:22:27 +10:00
Compare commits
229 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21af624096 | |||
| 227870ac78 | |||
| 33cb3dbd6a | |||
| eb7813ac6f | |||
| 0f8f2fe560 | |||
| 51f38f0884 | |||
| 6b93fd179d | |||
| 9385f36832 | |||
| a5dc15dc08 | |||
| eab996f7e7 | |||
| 43c5a33773 | |||
| 7fb0226ddc | |||
| db6e7a7480 | |||
| 6335ad1571 | |||
| 2d62504895 | |||
| e34d0cebe5 | |||
| 0053d696ff | |||
| 6fb0a72a56 | |||
| 5b3e91e34d | |||
| d1a5a41e4d | |||
| d0a07686a5 | |||
| ffa4747ed6 | |||
| b963813910 | |||
| 58950ed0ef | |||
| 1c7a6c952f | |||
| 3ae651fece | |||
| bd52983780 | |||
| 39daed3502 | |||
| dda47f51ec | |||
| 374b9bcc58 | |||
| f0b18019d5 | |||
| 5c10f3d866 | |||
| 5d839e5420 | |||
| febbdefc0b | |||
| 6110440682 | |||
| d0a174d7b7 | |||
| 6708570c49 | |||
| bb4bbf4174 | |||
| a3ef6520e7 | |||
| 0fec5ce86d | |||
| 26e34b6b83 | |||
| 007243f2c3 | |||
| 9d0a0bba86 | |||
| 89a44cc33a | |||
| 92856b6f06 | |||
| c968188080 | |||
| db36bc9770 | |||
| 35df043f66 | |||
| 3c4a26bc06 | |||
| 62046c49b5 | |||
| 3b73dcf29d | |||
| 9b20c46348 | |||
| 996ef650db | |||
| 1c36ac1d68 | |||
| 198c269790 | |||
| 58ef309b68 | |||
| 54bace451c | |||
| 193b15edc1 | |||
| e4ec678512 | |||
| 29c18c1e89 | |||
| 13d90e8138 | |||
| 02ce1ad48c | |||
| 8a401de5c9 | |||
| 1c5c4d0117 | |||
| d6fee1e3a6 | |||
| d84aeee968 | |||
| c87242142d | |||
| 2c84976e28 | |||
| 31ed9f41a0 | |||
| 700b98fcb7 | |||
| e29f973889 | |||
| 6e25780b25 | |||
| 3f01a9e58e | |||
| 1bed63a4af | |||
| a530fce78c | |||
| 87a395683d | |||
| e3f3b8b464 | |||
| b9de35f0d9 | |||
| 5827576ffb | |||
| acc9becf1a | |||
| c2837838ee | |||
| 304fd93ece | |||
| 491bbcadcc | |||
| df63f4b8a7 | |||
| 29fc7c419b | |||
| 5bc0230a5a | |||
| c9a2c27b2d | |||
| 767573ce6d | |||
| 713ce91683 | |||
| 8478a42cf0 | |||
| 5e33f7e8f4 | |||
| 2292c25158 | |||
| 13a7412498 | |||
| a44846b632 | |||
| 454aa20aa9 | |||
| e3b4105424 | |||
| f0ede57786 | |||
| ab10d026d6 | |||
| a2dbd7ce2b | |||
| eca51decc2 | |||
| 06455da40a | |||
| 700b74a0b7 | |||
| ae64515e93 | |||
| 0992726d7e | |||
| 38a442c40d | |||
| 14bcfb219a | |||
| d0fd1e3ff5 | |||
| 3f29ca3add | |||
| bf498b5972 | |||
| 2bc42493af | |||
| d18ef2e1a5 | |||
| 2409a5786a | |||
| 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 | |||
| 2dce78200b | |||
| b92b4c9936 |
@ -1,22 +1,62 @@
|
|||||||
!README.md
|
# Compiled Output
|
||||||
.dockerignore
|
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
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
.editorconfig
|
.editorconfig
|
||||||
.eslint*
|
.eslint*
|
||||||
.git
|
|
||||||
.github
|
# Generated Files
|
||||||
.gitignore
|
|
||||||
.husky
|
|
||||||
.nx
|
.nx
|
||||||
.prettier*
|
.swc
|
||||||
.vscode
|
fly.toml
|
||||||
*.env*
|
stats.html
|
||||||
*.md
|
|
||||||
compose*.yml
|
|
||||||
dist
|
|
||||||
Dockerfile
|
|
||||||
node_modules
|
|
||||||
Thumbs.db
|
|
||||||
tmp
|
|
||||||
tools/compose/*
|
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
|
||||||
|
|||||||
37
.env.example
37
.env.example
@ -4,14 +4,6 @@ NODE_ENV=development
|
|||||||
# Ports
|
# Ports
|
||||||
PORT=3000
|
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
|
# URLs
|
||||||
# These URLs must reference a publicly accessible domain or IP address, not a docker container ID (depending on your compose setup)
|
# 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
|
PUBLIC_URL=http://localhost:3000
|
||||||
@ -38,6 +30,8 @@ REFRESH_TOKEN_SECRET=refresh_token_secret
|
|||||||
CHROME_PORT=8080
|
CHROME_PORT=8080
|
||||||
CHROME_TOKEN=chrome_token
|
CHROME_TOKEN=chrome_token
|
||||||
CHROME_URL=ws://localhost:8080
|
CHROME_URL=ws://localhost:8080
|
||||||
|
# Launch puppeteer with flag to ignore https errors
|
||||||
|
# CHROME_IGNORE_HTTPS_ERRORS=true
|
||||||
|
|
||||||
# Mail Server (for e-mails)
|
# Mail Server (for e-mails)
|
||||||
# For testing, you can use https://ethereal.email/create
|
# For testing, you can use https://ethereal.email/create
|
||||||
@ -52,20 +46,18 @@ STORAGE_BUCKET=default
|
|||||||
STORAGE_ACCESS_KEY=minioadmin
|
STORAGE_ACCESS_KEY=minioadmin
|
||||||
STORAGE_SECRET_KEY=minioadmin
|
STORAGE_SECRET_KEY=minioadmin
|
||||||
STORAGE_USE_SSL=false
|
STORAGE_USE_SSL=false
|
||||||
|
STORAGE_SKIP_BUCKET_CHECK=false
|
||||||
|
|
||||||
# Redis (for cache & server session management)
|
# Nx Cloud (Optional)
|
||||||
REDIS_URL=redis://default:password@localhost:6379
|
# NX_CLOUD_ACCESS_TOKEN=
|
||||||
|
|
||||||
# Sentry (for error reporting, Optional)
|
|
||||||
# VITE_SENTRY_DSN=
|
|
||||||
|
|
||||||
# Crowdin (Optional)
|
# Crowdin (Optional)
|
||||||
CROWDIN_PROJECT_ID=
|
# CROWDIN_PROJECT_ID=
|
||||||
CROWDIN_PERSONAL_TOKEN=
|
# CROWDIN_PERSONAL_TOKEN=
|
||||||
|
|
||||||
# Email (Optional)
|
# Feature Flags (Optional)
|
||||||
# DISABLE_EMAIL_AUTH=true
|
# DISABLE_SIGNUPS=false
|
||||||
# VITE_DISABLE_SIGNUPS=false
|
# DISABLE_EMAIL_AUTH=false
|
||||||
|
|
||||||
# GitHub (OAuth, Optional)
|
# GitHub (OAuth, Optional)
|
||||||
# GITHUB_CLIENT_ID=
|
# GITHUB_CLIENT_ID=
|
||||||
@ -76,3 +68,12 @@ CROWDIN_PERSONAL_TOKEN=
|
|||||||
# GOOGLE_CLIENT_ID=
|
# GOOGLE_CLIENT_ID=
|
||||||
# GOOGLE_CLIENT_SECRET=
|
# GOOGLE_CLIENT_SECRET=
|
||||||
# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback
|
# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback
|
||||||
|
|
||||||
|
# OpenID (Optional)
|
||||||
|
# OPENID_AUTHORIZATION_URL=
|
||||||
|
# OPENID_CALLBACK_URL=http://localhost:5173/api/auth/openid/callback
|
||||||
|
# OPENID_CLIENT_ID=
|
||||||
|
# OPENID_CLIENT_SECRET=
|
||||||
|
# OPENID_ISSUER=
|
||||||
|
# OPENID_TOKEN_URL=
|
||||||
|
# OPENID_USER_INFO_URL=
|
||||||
|
|||||||
@ -8,6 +8,10 @@
|
|||||||
"extends": ["plugin:prettier/recommended"],
|
"extends": ["plugin:prettier/recommended"],
|
||||||
"plugins": ["simple-import-sort", "unused-imports"],
|
"plugins": ["simple-import-sort", "unused-imports"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
// eslint
|
||||||
|
"no-console": "error",
|
||||||
|
"no-return-await": "off",
|
||||||
|
|
||||||
// simple-import-sort
|
// simple-import-sort
|
||||||
"simple-import-sort/imports": "error",
|
"simple-import-sort/imports": "error",
|
||||||
"simple-import-sort/exports": "error",
|
"simple-import-sort/exports": "error",
|
||||||
@ -38,15 +42,51 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
// prettier
|
||||||
|
"prettier/prettier": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
"endOfLine": "auto"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx"],
|
"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": {
|
"rules": {
|
||||||
// typescript-eslint
|
// 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"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
5
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
5
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@ -21,7 +21,7 @@ body:
|
|||||||
label: Product Variant
|
label: Product Variant
|
||||||
description: What variant of Reactive Resume are you using?
|
description: What variant of Reactive Resume are you using?
|
||||||
options:
|
options:
|
||||||
- Cloud (http://rxresu.me)
|
- Cloud (https://rxresu.me)
|
||||||
- Self-Hosted
|
- Self-Hosted
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@ -76,7 +76,10 @@ body:
|
|||||||
- Bronzor
|
- Bronzor
|
||||||
- Chikorita
|
- Chikorita
|
||||||
- Ditto
|
- Ditto
|
||||||
|
- Gengar
|
||||||
|
- Glalie
|
||||||
- Kakuna
|
- Kakuna
|
||||||
|
- Leafish
|
||||||
- Nosepass
|
- Nosepass
|
||||||
- Onyx
|
- Onyx
|
||||||
- Pikachu
|
- Pikachu
|
||||||
|
|||||||
44
.github/workflows/lint-build.yml
vendored
44
.github/workflows/lint-build.yml
vendored
@ -1,44 +0,0 @@
|
|||||||
name: Lint and Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
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=build --parallel=3
|
|
||||||
|
|
||||||
agents:
|
|
||||||
name: Nx Cloud - Agents
|
|
||||||
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.14.0
|
|
||||||
with:
|
|
||||||
number-of-agents: 3
|
|
||||||
48
.github/workflows/lint-test-build.yml
vendored
Normal file
48
.github/workflows/lint-test-build.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: Lint, Test & Build
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4.0.0
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4.1.0
|
||||||
|
with:
|
||||||
|
cache: "pnpm"
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: pnpm run lint
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: pnpm run format:check
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: pnpm run test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build
|
||||||
66
.github/workflows/publish-docker-image.yml
vendored
66
.github/workflows/publish-docker-image.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -21,7 +21,6 @@ jobs:
|
|||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
platform:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
@ -29,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.4
|
||||||
|
|
||||||
- name: Extract version from package.json
|
- name: Extract version from package.json
|
||||||
id: version
|
id: version
|
||||||
@ -38,38 +37,42 @@ jobs:
|
|||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3.0.0
|
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
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registery
|
- name: Login to GitHub Container Registery
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3.3.0
|
||||||
|
|
||||||
- name: Extract Docker Metadata
|
- name: Extract Docker Metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5.0.0
|
uses: docker/metadata-action@v5.5.1
|
||||||
with:
|
with:
|
||||||
tags: type=semver,pattern={{version}},prefix=v,value=${{ steps.version.outputs.version }}
|
tags: type=semver,pattern={{version}},prefix=v,value=${{ steps.version.outputs.version }}
|
||||||
images: |
|
images: |
|
||||||
${{ env.IMAGE }}
|
${{ env.IMAGE }}
|
||||||
ghcr.io/${{ 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
|
- name: Build and Push by Digest
|
||||||
uses: docker/build-push-action@v5.0.0
|
uses: docker/build-push-action@v5.3.0
|
||||||
id: build
|
id: build
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
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:}"
|
touch "/tmp/digests/${digest#sha256:}"
|
||||||
|
|
||||||
- name: Upload Digest
|
- name: Upload Digest
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
with:
|
with:
|
||||||
name: digests
|
name: digests-${{ steps.artifact_name.outputs.name }}
|
||||||
path: /tmp/digests/*
|
path: /tmp/digests/*
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
@ -98,33 +101,34 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.4
|
||||||
|
|
||||||
- name: Download Digest
|
- name: Download Digest
|
||||||
uses: actions/download-artifact@v3.0.0
|
uses: actions/download-artifact@v4.1.7
|
||||||
with:
|
with:
|
||||||
name: digests
|
|
||||||
path: /tmp/digests
|
path: /tmp/digests
|
||||||
|
pattern: digests-*
|
||||||
- name: Set up Docker Buildx
|
merge-multiple: true
|
||||||
uses: docker/setup-buildx-action@v3.0.0
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registery
|
- name: Login to GitHub Container Registery
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3.3.0
|
||||||
|
|
||||||
- name: Extract Docker Metadata
|
- name: Extract Docker Metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5.0.0
|
uses: docker/metadata-action@v5.5.1
|
||||||
with:
|
with:
|
||||||
tags: type=semver,pattern={{version}},prefix=v,value=${{ needs.build.outputs.version }}
|
tags: type=semver,pattern={{version}},prefix=v,value=${{ needs.build.outputs.version }}
|
||||||
images: |
|
images: |
|
||||||
@ -142,8 +146,22 @@ jobs:
|
|||||||
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
|
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
|
||||||
|
|
||||||
- name: Update Repository Description
|
- name: Update Repository Description
|
||||||
uses: peter-evans/dockerhub-description@v3
|
uses: peter-evans/dockerhub-description@v4.0.0
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.repository }}
|
repository: ${{ github.repository }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Deploy the latest image on rxresu.me
|
||||||
|
run: curl -kX POST ${{ secrets.SERVICE_WEBHOOK }}
|
||||||
|
|
||||||
|
- name: Inform about the release on Discord
|
||||||
|
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"
|
||||||
|
|||||||
@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
|
if: github.repository == 'AmruthPillai/Reactive-Resume'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
11
.gitignore
vendored
11
.gitignore
vendored
@ -16,14 +16,8 @@ node_modules
|
|||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
# IDE - VSCode
|
# IDE - VSCode
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
|
|
||||||
# IDE - Visual Studio
|
|
||||||
.vs/*
|
.vs/*
|
||||||
|
.vscode/*
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
@ -48,7 +42,6 @@ Thumbs.db
|
|||||||
.swc
|
.swc
|
||||||
fly.toml
|
fly.toml
|
||||||
stats.html
|
stats.html
|
||||||
libs/prisma
|
|
||||||
|
|
||||||
# Environment Variables
|
# Environment Variables
|
||||||
*.env*
|
*.env*
|
||||||
@ -56,4 +49,4 @@ libs/prisma
|
|||||||
|
|
||||||
# Lingui Compiled Messages
|
# Lingui Compiled Messages
|
||||||
apps/client/src/locales/_build/
|
apps/client/src/locales/_build/
|
||||||
apps/client/src/locales/*/messages.mjs
|
apps/client/src/locales/*/messages.*js
|
||||||
|
|||||||
14
.ncurc.json
Normal file
14
.ncurc.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/raineorshine/npm-check-updates/main/src/types/RunOptions.json",
|
||||||
|
"upgrade": true,
|
||||||
|
"target": "minor",
|
||||||
|
"install": "always",
|
||||||
|
"packageManager": "pnpm",
|
||||||
|
"reject": [
|
||||||
|
"eslint",
|
||||||
|
"@swc/*",
|
||||||
|
"@swc-node/*",
|
||||||
|
"@reactive-resume/*",
|
||||||
|
"eslint-plugin-unused-imports"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -2,4 +2,6 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/.nx/cache
|
/.nx/cache
|
||||||
stats.html
|
stats.html
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
compose-dev.yml
|
||||||
|
compose.yml
|
||||||
@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"printWidth": 100
|
"printWidth": 100,
|
||||||
|
"endOfLine": "auto",
|
||||||
|
"plugins": ["prettier-plugin-tailwindcss"],
|
||||||
|
"tailwindFunctions": ["cn", "cva"]
|
||||||
}
|
}
|
||||||
|
|||||||
7
.vscode/extensions.json
vendored
7
.vscode/extensions.json
vendored
@ -1,8 +1,3 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
|
||||||
"nrwl.angular-console",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"firsttris.vscode-jest-runner"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
11
.vscode/settings.json
vendored
11
.vscode/settings.json
vendored
@ -1,14 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"css.validate": false,
|
||||||
|
"vitest.disableWorkspaceWarning": true,
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"tailwindCSS.experimental.classRegex": [
|
"tailwindCSS.experimental.classRegex": [
|
||||||
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
|
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
|
||||||
["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
||||||
],
|
]
|
||||||
"yaml.schemas": {
|
|
||||||
"https://json.schemastore.org/github-workflow.json": ".github/workflows/*.yml",
|
|
||||||
"https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json": [
|
|
||||||
"tools/compose/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"i18n-ally.localesPaths": ["apps/client/src/locales"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 **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).
|
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).
|
||||||
|
|||||||
132
CODE_OF_CONDUCT.md
Normal file
132
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||||
|
identity and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
- Demonstrating empathy and kindness toward other people
|
||||||
|
- Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
- Giving and gracefully accepting constructive feedback
|
||||||
|
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
- Focusing on what is best not just for us as individuals, but for the overall
|
||||||
|
community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
- The use of sexualized language or imagery, and sexual attention or advances of
|
||||||
|
any kind
|
||||||
|
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
- Public or private harassment
|
||||||
|
- Publishing others' private information, such as a physical or email address,
|
||||||
|
without their explicit permission
|
||||||
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official email address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
[INSERT CONTACT METHOD].
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series of
|
||||||
|
actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or permanent
|
||||||
|
ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||||
|
community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.1, available at
|
||||||
|
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by
|
||||||
|
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||||
|
[https://www.contributor-covenant.org/translations][translations].
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||||
|
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||||
|
[FAQ]: https://www.contributor-covenant.org/faq
|
||||||
|
[translations]: https://www.contributor-covenant.org/translations
|
||||||
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
## Getting the project set up locally
|
## 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:
|
To run the development environment of the application locally on your computer, please follow these steps:
|
||||||
|
|
||||||
#### Requirements
|
#### Requirements
|
||||||
|
|
||||||
- Docker (with Docker Compose)
|
- Docker (with Docker Compose)
|
||||||
- Node.js 18 or higher (with pnpm)
|
- Node.js 20 or higher (with pnpm)
|
||||||
|
|
||||||
### 1. Fork and Clone the Repository
|
### 1. Fork and Clone the Repository
|
||||||
|
|
||||||
@ -57,15 +57,13 @@ You can also visit `http://localhost:3000/api/health`, the health check endpoint
|
|||||||
"info": {
|
"info": {
|
||||||
"database": { "status": "up" },
|
"database": { "status": "up" },
|
||||||
"storage": { "status": "up" },
|
"storage": { "status": "up" },
|
||||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" },
|
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" }
|
||||||
"redis": { "status": "up" }
|
|
||||||
},
|
},
|
||||||
"error": {},
|
"error": {},
|
||||||
"details": {
|
"details": {
|
||||||
"database": { "status": "up" },
|
"database": { "status": "up" },
|
||||||
"storage": { "status": "up" },
|
"storage": { "status": "up" },
|
||||||
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" },
|
"browser": { "status": "up", "version": "Chrome/119.0.6045.9" }
|
||||||
"redis": { "status": "up" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
20
Dockerfile
20
Dockerfile
@ -1,39 +1,45 @@
|
|||||||
|
ARG NX_CLOUD_ACCESS_TOKEN
|
||||||
|
|
||||||
# --- Base Image ---
|
# --- Base Image ---
|
||||||
FROM node:lts-bullseye-slim AS base
|
FROM node:lts-bullseye-slim AS base
|
||||||
|
ARG NX_CLOUD_ACCESS_TOKEN
|
||||||
|
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
ARG NX_CLOUD_ACCESS_TOKEN
|
|
||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable pnpm && corepack prepare pnpm --activate
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# --- Build Image ---
|
# --- Build Image ---
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
ARG NX_CLOUD_ACCESS_TOKEN
|
||||||
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
|
||||||
|
|
||||||
COPY .npmrc package.json pnpm-lock.yaml ./
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
|
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
||||||
|
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# --- Release Image ---
|
# --- Release Image ---
|
||||||
FROM base AS release
|
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 ./
|
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/dist ./dist
|
||||||
COPY --chown=node:node --from=build /app/tools/prisma ./tools/prisma
|
COPY --chown=node:node --from=build /app/tools/prisma ./tools/prisma
|
||||||
RUN pnpm run prisma:generate
|
RUN pnpm run prisma:generate
|
||||||
|
|
||||||
ENV TZ=UTC
|
ENV TZ=UTC
|
||||||
|
ENV PORT=3000
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
@ -40,15 +40,15 @@ Start creating your standout resume with Reactive Resume today!
|
|||||||
|
|
||||||
- **Free, forever** and open-source
|
- **Free, forever** and open-source
|
||||||
- No telemetry, user tracking or advertising
|
- 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/))
|
- **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
|
- 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
|
- 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
|
- **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
|
- 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
|
- Create single page resumes or a resume that spans multiple pages easily
|
||||||
- Customize the colours and layouts to add a personal touch to your resume.
|
- Customize the colours and layouts to add a personal touch to your resume
|
||||||
- Customise your page layout as you like just by dragging-and-dropping sections
|
- Customise your page layout as you like just by dragging-and-dropping sections
|
||||||
- Create custom sections that are specific to your industry if the existing ones don't fit
|
- Create custom sections that are specific to your industry if the existing ones don't fit
|
||||||
- Jot down personal notes specific to your resume that's only visible to you
|
- Jot down personal notes specific to your resume that's only visible to you
|
||||||
@ -69,11 +69,9 @@ Start creating your standout resume with Reactive Resume today!
|
|||||||
- NestJS, for the backend
|
- NestJS, for the backend
|
||||||
- Postgres (primary database)
|
- Postgres (primary database)
|
||||||
- Prisma ORM, which frees you to switch to any other relational database with a few minor changes in the code
|
- 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)
|
- Minio (for object storage: to store avatars, resume PDFs and previews)
|
||||||
- Browserless (for headless chrome, to print PDFs and generate previews)
|
- Browserless (for headless chrome, to print PDFs and generate previews)
|
||||||
- SMTP Server (to send password recovery emails)
|
- SMTP Server (to send password recovery emails)
|
||||||
- Sentry (for error tracing and performance monitoring)
|
|
||||||
- GitHub/Google OAuth (for quickly authenticating users)
|
- GitHub/Google OAuth (for quickly authenticating users)
|
||||||
- LinguiJS and Crowdin (for translation management and localization)
|
- LinguiJS and Crowdin (for translation management and localization)
|
||||||
|
|
||||||
|
|||||||
@ -11,4 +11,4 @@
|
|||||||
|
|
||||||
## Reporting a Vulnerability
|
## 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,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
// eslint
|
||||||
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
|
|
||||||
|
// react
|
||||||
|
"react/no-unescaped-entities": "off",
|
||||||
|
"react/jsx-sort-props": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"reservedFirst": true,
|
||||||
|
"callbacksLast": true,
|
||||||
|
"shorthandFirst": true,
|
||||||
|
"noSortAlphabetically": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
// react-hooks
|
// react-hooks
|
||||||
"react-hooks/exhaustive-deps": "off",
|
"react-hooks/exhaustive-deps": "off",
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
const { join } = require("path");
|
const path = require("node:path");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: {
|
plugins: {
|
||||||
tailwindcss: {
|
tailwindcss: {
|
||||||
config: join(__dirname, "tailwind.config.js"),
|
config: path.join(__dirname, "tailwind.config.js"),
|
||||||
},
|
},
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
},
|
},
|
||||||
|
|||||||
17
apps/artboard/src/components/brand-icon.tsx
Normal file
17
apps/artboard/src/components/brand-icon.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
type BrandIconProps = {
|
||||||
|
slug: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BrandIcon = ({ slug }: BrandIconProps) => {
|
||||||
|
if (slug === "linkedin") {
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
alt="linkedin"
|
||||||
|
className="size-4"
|
||||||
|
src={`${window.location.origin}/support-logos/linkedin.svg`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <img alt={slug} className="size-4" src={`https://cdn.simpleicons.org/${slug}`} />;
|
||||||
|
};
|
||||||
@ -20,7 +20,7 @@ export const Page = ({ mode = "preview", pageNumber, children }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-page={pageNumber}
|
data-page={pageNumber}
|
||||||
className={cn("relative bg-white", mode === "builder" && "shadow-2xl")}
|
className={cn("relative bg-background text-foreground", mode === "builder" && "shadow-2xl")}
|
||||||
style={{
|
style={{
|
||||||
fontFamily,
|
fontFamily,
|
||||||
width: `${pageSizeMap[page.format].width * MM_TO_PX}px`,
|
width: `${pageSizeMap[page.format].width * MM_TO_PX}px`,
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { StrictMode } from "react";
|
import { StrictMode } from "react";
|
||||||
import * as ReactDOM from "react-dom/client";
|
import * as ReactDOM from "react-dom/client";
|
||||||
import { RouterProvider } from "react-router-dom";
|
import { RouterProvider } from "react-router";
|
||||||
|
|
||||||
import { router } from "./router";
|
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(
|
root.render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Outlet } from "react-router-dom";
|
import { Outlet } from "react-router";
|
||||||
import webfontloader from "webfontloader";
|
import webfontloader from "webfontloader";
|
||||||
|
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
@ -39,21 +39,27 @@ export const ArtboardPage = () => {
|
|||||||
`${metadata.typography.lineHeight}`,
|
`${metadata.typography.lineHeight}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
document.documentElement.style.setProperty("--color-text", `${metadata.theme.text}`);
|
document.documentElement.style.setProperty("--color-foreground", metadata.theme.text);
|
||||||
document.documentElement.style.setProperty("--color-primary", `${metadata.theme.primary}`);
|
document.documentElement.style.setProperty("--color-primary", metadata.theme.primary);
|
||||||
document.documentElement.style.setProperty(
|
document.documentElement.style.setProperty("--color-background", metadata.theme.background);
|
||||||
"--color-background",
|
|
||||||
`${metadata.theme.background}`,
|
|
||||||
);
|
|
||||||
}, [metadata]);
|
}, [metadata]);
|
||||||
|
|
||||||
// Typography Options
|
// Typography Options
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.querySelectorAll(`[data-page]`).forEach((el) => {
|
// eslint-disable-next-line unicorn/prefer-spread
|
||||||
|
const elements = Array.from(document.querySelectorAll(`[data-page]`));
|
||||||
|
|
||||||
|
for (const el of elements) {
|
||||||
el.classList.toggle("hide-icons", metadata.typography.hideIcons);
|
el.classList.toggle("hide-icons", metadata.typography.hideIcons);
|
||||||
el.classList.toggle("underline-links", metadata.typography.underlineLinks);
|
el.classList.toggle("underline-links", metadata.typography.underlineLinks);
|
||||||
});
|
}
|
||||||
}, [metadata]);
|
}, [metadata]);
|
||||||
|
|
||||||
return <Outlet />;
|
return (
|
||||||
|
<>
|
||||||
|
{metadata.css.visible && <style lang="css">{`[data-page] { ${metadata.css.value} }`}</style>}
|
||||||
|
|
||||||
|
<Outlet />
|
||||||
|
</>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { SectionKey } from "@reactive-resume/schema";
|
import { SectionKey } from "@reactive-resume/schema";
|
||||||
import { pageSizeMap, Template } from "@reactive-resume/utils";
|
import { pageSizeMap, Template } from "@reactive-resume/utils";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import { useEffect, useMemo, useRef } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { ReactZoomPanPinchRef, TransformComponent, TransformWrapper } from "react-zoom-pan-pinch";
|
import { ReactZoomPanPinchRef, TransformComponent, TransformWrapper } from "react-zoom-pan-pinch";
|
||||||
|
|
||||||
import { MM_TO_PX, Page } from "../components/page";
|
import { MM_TO_PX, Page } from "../components/page";
|
||||||
@ -9,9 +9,12 @@ import { useArtboardStore } from "../store/artboard";
|
|||||||
import { getTemplate } from "../templates";
|
import { getTemplate } from "../templates";
|
||||||
|
|
||||||
export const BuilderLayout = () => {
|
export const BuilderLayout = () => {
|
||||||
|
const [wheelPanning, setWheelPanning] = useState(true);
|
||||||
|
|
||||||
const transformRef = useRef<ReactZoomPanPinchRef>(null);
|
const transformRef = useRef<ReactZoomPanPinchRef>(null);
|
||||||
const format = useArtboardStore((state) => state.resume.metadata.page.format);
|
|
||||||
const layout = useArtboardStore((state) => state.resume.metadata.layout);
|
const layout = useArtboardStore((state) => state.resume.metadata.layout);
|
||||||
|
const format = useArtboardStore((state) => state.resume.metadata.page.format);
|
||||||
const template = useArtboardStore((state) => state.resume.metadata.template as Template);
|
const template = useArtboardStore((state) => state.resume.metadata.template as Template);
|
||||||
|
|
||||||
const Template = useMemo(() => getTemplate(template), [template]);
|
const Template = useMemo(() => getTemplate(template), [template]);
|
||||||
@ -27,6 +30,9 @@ export const BuilderLayout = () => {
|
|||||||
transformRef.current?.resetTransform(0);
|
transformRef.current?.resetTransform(0);
|
||||||
setTimeout(() => transformRef.current?.centerView(0.8, 0), 10);
|
setTimeout(() => transformRef.current?.centerView(0.8, 0), 10);
|
||||||
}
|
}
|
||||||
|
if (event.data.type === "TOGGLE_PAN_MODE") {
|
||||||
|
setWheelPanning(event.data.panMode);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("message", handleMessage);
|
window.addEventListener("message", handleMessage);
|
||||||
@ -38,12 +44,14 @@ export const BuilderLayout = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TransformWrapper
|
<TransformWrapper
|
||||||
|
ref={transformRef}
|
||||||
centerOnInit
|
centerOnInit
|
||||||
maxScale={2}
|
maxScale={2}
|
||||||
minScale={0.4}
|
minScale={0.4}
|
||||||
initialScale={0.8}
|
initialScale={0.8}
|
||||||
ref={transformRef}
|
|
||||||
limitToBounds={false}
|
limitToBounds={false}
|
||||||
|
wheel={{ wheelDisabled: wheelPanning }}
|
||||||
|
panning={{ wheelPanning: wheelPanning }}
|
||||||
>
|
>
|
||||||
<TransformComponent
|
<TransformComponent
|
||||||
wrapperClass="!w-screen !h-screen"
|
wrapperClass="!w-screen !h-screen"
|
||||||
@ -56,8 +64,8 @@ export const BuilderLayout = () => {
|
|||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{layout.map((columns, pageIndex) => (
|
{layout.map((columns, pageIndex) => (
|
||||||
<motion.div
|
<motion.div
|
||||||
layout
|
|
||||||
key={pageIndex}
|
key={pageIndex}
|
||||||
|
layout
|
||||||
initial={{ opacity: 0, x: -200, y: 0 }}
|
initial={{ opacity: 0, x: -200, y: 0 }}
|
||||||
animate={{ opacity: 1, x: 0, transition: { delay: pageIndex * 0.3 } }}
|
animate={{ opacity: 1, x: 0, transition: { delay: pageIndex * 0.3 } }}
|
||||||
exit={{ opacity: 0, x: -200 }}
|
exit={{ opacity: 0, x: -200 }}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Outlet } from "react-router-dom";
|
import { Outlet } from "react-router";
|
||||||
|
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
|
|
||||||
@ -20,7 +20,10 @@ export const Providers = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const resumeData = window.localStorage.getItem("resume");
|
const resumeData = window.localStorage.getItem("resume");
|
||||||
if (resumeData) return setResume(JSON.parse(resumeData));
|
if (resumeData) {
|
||||||
|
setResume(JSON.parse(resumeData));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener("message", handleMessage);
|
window.addEventListener("message", handleMessage);
|
||||||
|
|
||||||
@ -34,6 +37,7 @@ export const Providers = () => {
|
|||||||
// setResume(sampleResume);
|
// setResume(sampleResume);
|
||||||
// }, [setResume]);
|
// }, [setResume]);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
if (!resume) return null;
|
if (!resume) return null;
|
||||||
|
|
||||||
return <Outlet />;
|
return <Outlet />;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { createBrowserRouter, createRoutesFromChildren, Route } from "react-router-dom";
|
import { createBrowserRouter, createRoutesFromChildren, Route } from "react-router";
|
||||||
|
|
||||||
import { ArtboardPage } from "../pages/artboard";
|
import { ArtboardPage } from "../pages/artboard";
|
||||||
import { BuilderLayout } from "../pages/builder";
|
import { BuilderLayout } from "../pages/builder";
|
||||||
@ -6,7 +6,7 @@ import { PreviewLayout } from "../pages/preview";
|
|||||||
import { Providers } from "../providers";
|
import { Providers } from "../providers";
|
||||||
|
|
||||||
export const routes = createRoutesFromChildren(
|
export const routes = createRoutesFromChildren(
|
||||||
<Route element={<Providers />}>
|
<Route element={<Providers />} hydrateFallbackElement={<div>Loading...</div>}>
|
||||||
<Route path="artboard" element={<ArtboardPage />}>
|
<Route path="artboard" element={<ArtboardPage />}>
|
||||||
<Route path="builder" element={<BuilderLayout />} />
|
<Route path="builder" element={<BuilderLayout />} />
|
||||||
<Route path="preview" element={<PreviewLayout />} />
|
<Route path="preview" element={<PreviewLayout />} />
|
||||||
|
|||||||
@ -8,5 +8,7 @@ export type ArtboardStore = {
|
|||||||
|
|
||||||
export const useArtboardStore = create<ArtboardStore>()((set) => ({
|
export const useArtboardStore = create<ArtboardStore>()((set) => ({
|
||||||
resume: null as unknown as ResumeData,
|
resume: null as unknown as ResumeData,
|
||||||
setResume: (resume) => set({ resume }),
|
setResume: (resume) => {
|
||||||
|
set({ resume });
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -21,5 +21,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.wysiwyg {
|
.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 prose-a:break-all;
|
@apply prose-foreground prose max-w-none prose-headings:mb-2 prose-headings:mt-0 prose-p:mb-2 prose-p:mt-0 prose-p:leading-normal prose-a:break-all prose-ol:mb-2 prose-ol:mt-0 prose-ul:mb-2 prose-ul:mt-0 prose-li:mb-2 prose-li:mt-0 prose-li:leading-normal prose-img:mb-2 prose-img:mt-0 prose-hr:mb-2 prose-hr:mt-0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl, linearTransform } from "@reactive-resume/util
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import React, { Fragment } from "react";
|
import React, { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -64,7 +65,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -93,9 +100,9 @@ const Summary = () => {
|
|||||||
<div className="absolute left-[-4.5px] top-[8px] hidden size-[8px] rounded-full bg-primary group-[.main]:block" />
|
<div className="absolute left-[-4.5px] top-[8px] hidden size-[8px] rounded-full bg-primary group-[.main]:block" />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
@ -117,28 +124,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -158,7 +188,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -196,7 +226,7 @@ const Section = <T,>({
|
|||||||
<div>{children?.(item as T)}</div>
|
<div>{children?.(item as T)}</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -205,7 +235,7 @@ const Section = <T,>({
|
|||||||
<p className="text-sm">{keywords.join(", ")}</p>
|
<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 className="absolute left-[-4.5px] top-px hidden size-[8px] rounded-full bg-primary group-[.main]:block" />
|
||||||
</div>
|
</div>
|
||||||
@ -218,30 +248,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -255,7 +272,12 @@ const Experience = () => {
|
|||||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -272,7 +294,12 @@ const Education = () => {
|
|||||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
<div>{item.studyType}</div>
|
<div>{item.studyType}</div>
|
||||||
@ -291,7 +318,7 @@ const Awards = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.title}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -307,7 +334,7 @@ const Certifications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.name}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -347,7 +374,12 @@ const Publications = () => {
|
|||||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.publisher}</div>
|
<div>{item.publisher}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -363,7 +395,12 @@ const Volunteer = () => {
|
|||||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -396,7 +433,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
|
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -414,7 +456,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -435,7 +482,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
|
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -449,36 +501,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -496,7 +562,9 @@ export const Azurill = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="main group col-span-2 space-y-4">
|
<div
|
||||||
|
className={cn("main group space-y-4", sidebar.length > 0 ? "col-span-2" : "col-span-3")}
|
||||||
|
>
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -64,7 +65,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -84,9 +91,9 @@ const Summary = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg col-span-4"
|
className="wysiwyg col-span-4"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -108,28 +115,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -149,7 +179,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid grid-cols-5 border-t pt-2.5">
|
<section id={section.id} className="grid grid-cols-5 border-t pt-2.5">
|
||||||
@ -173,11 +203,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -195,30 +225,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -233,7 +250,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -255,7 +277,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -279,7 +306,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -300,7 +331,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -345,7 +376,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -366,7 +402,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -403,7 +444,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -423,7 +469,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -444,7 +495,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -460,36 +516,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -65,7 +66,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -84,9 +91,9 @@ const Summary = () => {
|
|||||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -111,28 +118,53 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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 group-[.sidebar]:text-white" />)}
|
||||||
<a
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight &&
|
||||||
|
(icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-white" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -152,7 +184,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -174,11 +206,14 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: summary }}
|
||||||
|
className="wysiwyg group-[.sidebar]:prose-invert"
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -202,7 +237,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -224,7 +264,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -241,30 +286,17 @@ const Education = () => {
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -280,7 +312,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -301,10 +337,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<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">
|
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -346,7 +379,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -367,7 +405,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -404,7 +447,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -424,7 +472,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -445,7 +498,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -461,36 +519,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -498,8 +570,13 @@ export const Chikorita = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
const [main, sidebar] = columns;
|
const [main, sidebar] = columns;
|
||||||
|
|
||||||
return (
|
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">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"main p-custom group space-y-4",
|
||||||
|
sidebar.length > 0 ? "col-span-2" : "col-span-3",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{isFirstPage && <Header />}
|
{isFirstPage && <Header />}
|
||||||
|
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
@ -507,7 +584,12 @@ export const Chikorita = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sidebar p-custom group h-full space-y-4 bg-primary text-background">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"sidebar p-custom group h-full space-y-4 bg-primary text-background",
|
||||||
|
sidebar.length === 0 && "hidden",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{sidebar.map((section) => (
|
{sidebar.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -38,7 +39,7 @@ const Header = () => {
|
|||||||
<p>{basics.headline}</p>
|
<p>{basics.headline}</p>
|
||||||
</div>
|
</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">
|
<div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm">
|
||||||
{basics.location && (
|
{basics.location && (
|
||||||
<>
|
<>
|
||||||
@ -82,7 +83,13 @@ const Header = () => {
|
|||||||
<Fragment key={item.id}>
|
<Fragment key={item.id}>
|
||||||
<div className="flex items-center gap-x-1.5">
|
<div className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="bg-text size-1 rounded-full last:hidden" />
|
<div className="bg-text size-1 rounded-full last:hidden" />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -104,9 +111,9 @@ const Summary = () => {
|
|||||||
<h4 className="mb-2 text-base font-bold">{section.name}</h4>
|
<h4 className="mb-2 text-base font-bold">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -128,28 +135,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -169,7 +199,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -195,14 +225,14 @@ const Section = <T,>({
|
|||||||
<div className="relative -ml-4 group-[.sidebar]:ml-0">
|
<div className="relative -ml-4 group-[.sidebar]:ml-0">
|
||||||
<div className="pl-4 group-[.sidebar]:pl-0">
|
<div className="pl-4 group-[.sidebar]:pl-0">
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -222,30 +252,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -260,7 +277,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -282,7 +304,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -306,7 +333,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -327,7 +358,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -372,7 +403,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -393,7 +429,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -430,7 +471,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -450,7 +496,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -471,7 +522,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -487,36 +543,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -539,7 +609,12 @@ export const Ditto = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="main p-custom group col-span-2 space-y-4">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"main p-custom group space-y-4",
|
||||||
|
sidebar.length > 0 ? "col-span-2" : "col-span-3",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, hexToRgb, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -65,7 +66,13 @@ const Header = () => {
|
|||||||
<Fragment key={item.id}>
|
<Fragment key={item.id}>
|
||||||
<div className="flex items-center gap-x-1.5">
|
<div className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`)} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`)} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
@ -76,17 +83,20 @@ const Header = () => {
|
|||||||
|
|
||||||
const Summary = () => {
|
const Summary = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.summary);
|
const section = useArtboardStore((state) => state.resume.sections.summary);
|
||||||
|
const primaryColor = useArtboardStore((state) => state.resume.metadata.theme.primary);
|
||||||
|
|
||||||
if (!section.visible || isEmptyString(section.content)) return null;
|
if (!section.visible || isEmptyString(section.content)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id}>
|
<div className="p-custom space-y-4" style={{ backgroundColor: hexToRgb(primaryColor, 0.2) }}>
|
||||||
<div
|
<section id={section.id}>
|
||||||
className="wysiwyg"
|
<div
|
||||||
style={{ columns: section.columns }}
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
className="wysiwyg"
|
||||||
/>
|
style={{ columns: section.columns }}
|
||||||
</section>
|
/>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -106,28 +116,57 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight &&
|
||||||
|
(icon ?? (
|
||||||
|
<i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-background" />
|
||||||
|
))}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -147,7 +186,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -169,11 +208,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -191,30 +230,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -229,7 +255,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -251,7 +282,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -275,7 +311,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||||
@ -296,7 +336,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||||
@ -341,7 +381,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -362,7 +407,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -399,7 +449,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -419,7 +474,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -440,7 +500,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -456,34 +521,47 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -512,15 +590,8 @@ export const Gengar = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="main group col-span-2">
|
<div className={cn("main group", sidebar.length > 0 ? "col-span-2" : "col-span-3")}>
|
||||||
{isFirstPage && (
|
{isFirstPage && <Summary />}
|
||||||
<div
|
|
||||||
className="p-custom space-y-4"
|
|
||||||
style={{ backgroundColor: hexToRgb(primaryColor, 0.2) }}
|
|
||||||
>
|
|
||||||
<Summary />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="p-custom space-y-4">
|
<div className="p-custom space-y-4">
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, hexToRgb, isEmptyString, isUrl, linearTransform } from "@reactive-r
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -65,7 +66,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon} text-primary`)} />
|
<i className={cn(`ph ph-bold ph-${item.icon} text-primary`)} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -84,9 +91,9 @@ const Summary = () => {
|
|||||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -114,28 +121,53 @@ const Rating = ({ level }: RatingProps) => {
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight &&
|
||||||
|
(icon ?? <i className="ph ph-bold ph-link text-primary group-[.sidebar]:text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -155,7 +187,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -179,11 +211,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -207,7 +239,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -229,7 +266,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -246,30 +288,17 @@ const Education = () => {
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -285,7 +314,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -306,7 +339,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -351,7 +384,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -372,7 +410,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -409,7 +452,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -429,7 +477,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -450,7 +503,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -466,36 +524,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -507,7 +579,7 @@ export const Glalie = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
return (
|
return (
|
||||||
<div className="grid min-h-[inherit] grid-cols-3">
|
<div className="grid min-h-[inherit] grid-cols-3">
|
||||||
<div
|
<div
|
||||||
className="sidebar p-custom group space-y-4"
|
className={cn("sidebar p-custom group space-y-4", sidebar.length === 0 && "hidden")}
|
||||||
style={{ backgroundColor: hexToRgb(primaryColor, 0.2) }}
|
style={{ backgroundColor: hexToRgb(primaryColor, 0.2) }}
|
||||||
>
|
>
|
||||||
{isFirstPage && <Header />}
|
{isFirstPage && <Header />}
|
||||||
@ -517,7 +589,12 @@ export const Glalie = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="main p-custom group col-span-2 space-y-4">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"main p-custom group space-y-4",
|
||||||
|
sidebar.length > 0 ? "col-span-2" : "col-span-3",
|
||||||
|
)}
|
||||||
|
>
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -15,31 +15,44 @@ import { Rhyhorn } from "./rhyhorn";
|
|||||||
|
|
||||||
export const getTemplate = (template: Template) => {
|
export const getTemplate = (template: Template) => {
|
||||||
switch (template) {
|
switch (template) {
|
||||||
case "azurill":
|
case "azurill": {
|
||||||
return Azurill;
|
return Azurill;
|
||||||
case "bronzor":
|
}
|
||||||
|
case "bronzor": {
|
||||||
return Bronzor;
|
return Bronzor;
|
||||||
case "chikorita":
|
}
|
||||||
|
case "chikorita": {
|
||||||
return Chikorita;
|
return Chikorita;
|
||||||
case "ditto":
|
}
|
||||||
|
case "ditto": {
|
||||||
return Ditto;
|
return Ditto;
|
||||||
case "gengar":
|
}
|
||||||
|
case "gengar": {
|
||||||
return Gengar;
|
return Gengar;
|
||||||
case "glalie":
|
}
|
||||||
|
case "glalie": {
|
||||||
return Glalie;
|
return Glalie;
|
||||||
case "kakuna":
|
}
|
||||||
|
case "kakuna": {
|
||||||
return Kakuna;
|
return Kakuna;
|
||||||
case "leafish":
|
}
|
||||||
|
case "leafish": {
|
||||||
return Leafish;
|
return Leafish;
|
||||||
case "nosepass":
|
}
|
||||||
|
case "nosepass": {
|
||||||
return Nosepass;
|
return Nosepass;
|
||||||
case "onyx":
|
}
|
||||||
|
case "onyx": {
|
||||||
return Onyx;
|
return Onyx;
|
||||||
case "pikachu":
|
}
|
||||||
|
case "pikachu": {
|
||||||
return Pikachu;
|
return Pikachu;
|
||||||
case "rhyhorn":
|
}
|
||||||
|
case "rhyhorn": {
|
||||||
return Rhyhorn;
|
return Rhyhorn;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
return Onyx;
|
return Onyx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import React, { Fragment } from "react";
|
import React, { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -27,7 +28,6 @@ import { TemplateProps } from "../types/template";
|
|||||||
const Header = () => {
|
const Header = () => {
|
||||||
const basics = useArtboardStore((state) => state.resume.basics);
|
const basics = useArtboardStore((state) => state.resume.basics);
|
||||||
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center space-y-2 pb-2 text-center">
|
<div className="flex flex-col items-center justify-center space-y-2 pb-2 text-center">
|
||||||
@ -61,11 +61,19 @@ const Header = () => {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Link url={basics.url} />
|
<Link url={basics.url} />
|
||||||
|
|
||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -80,15 +88,7 @@ const Header = () => {
|
|||||||
url={item.url}
|
url={item.url}
|
||||||
label={item.username}
|
label={item.username}
|
||||||
className="text-sm"
|
className="text-sm"
|
||||||
icon={
|
icon={<BrandIcon slug={item.icon} />}
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@ -110,9 +110,9 @@ const Summary = () => {
|
|||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -134,28 +134,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -175,7 +198,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -200,7 +223,7 @@ const Section = <T,>({
|
|||||||
<div>{children?.(item as T)}</div>
|
<div>{children?.(item as T)}</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -209,7 +232,7 @@ const Section = <T,>({
|
|||||||
<p className="text-sm">{keywords.join(", ")}</p>
|
<p className="text-sm">{keywords.join(", ")}</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@ -225,7 +248,12 @@ const Experience = () => {
|
|||||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -242,7 +270,12 @@ const Education = () => {
|
|||||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
<div>{item.studyType}</div>
|
<div>{item.studyType}</div>
|
||||||
@ -261,7 +294,7 @@ const Awards = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.title}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -277,7 +310,7 @@ const Certifications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.name}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -317,7 +350,12 @@ const Publications = () => {
|
|||||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.publisher}</div>
|
<div>{item.publisher}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -333,7 +371,12 @@ const Volunteer = () => {
|
|||||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -366,7 +409,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -383,7 +431,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -404,7 +457,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -417,34 +475,47 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "summary":
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { cn, hexToRgb, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import React, { Fragment } from "react";
|
import React, { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -29,7 +30,6 @@ const Header = () => {
|
|||||||
const section = useArtboardStore((state) => state.resume.sections.summary);
|
const section = useArtboardStore((state) => state.resume.sections.summary);
|
||||||
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const primaryColor = useArtboardStore((state) => state.resume.metadata.theme.primary);
|
const primaryColor = useArtboardStore((state) => state.resume.metadata.theme.primary);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -44,9 +44,9 @@ const Header = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -81,7 +81,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -96,15 +102,7 @@ const Header = () => {
|
|||||||
url={item.url}
|
url={item.url}
|
||||||
label={item.username}
|
label={item.username}
|
||||||
className="text-sm"
|
className="text-sm"
|
||||||
icon={
|
icon={<BrandIcon slug={item.icon} />}
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@ -131,28 +129,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -172,7 +193,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -197,7 +218,7 @@ const Section = <T,>({
|
|||||||
<div>{children?.(item as T)}</div>
|
<div>{children?.(item as T)}</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -206,7 +227,7 @@ const Section = <T,>({
|
|||||||
<p className="text-sm">{keywords.join(", ")}</p>
|
<p className="text-sm">{keywords.join(", ")}</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@ -222,7 +243,12 @@ const Experience = () => {
|
|||||||
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
<Section<Experience> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -239,7 +265,12 @@ const Education = () => {
|
|||||||
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
<Section<Education> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
<div>{item.studyType}</div>
|
<div>{item.studyType}</div>
|
||||||
@ -258,7 +289,7 @@ const Awards = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.title}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -274,7 +305,7 @@ const Certifications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.name}</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 className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -314,7 +345,12 @@ const Publications = () => {
|
|||||||
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
<Section<Publication> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.publisher}</div>
|
<div>{item.publisher}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -330,7 +366,12 @@ const Volunteer = () => {
|
|||||||
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
<Section<Volunteer> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -363,7 +404,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -380,7 +426,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -401,7 +452,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<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.description}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
<div className="font-bold">{item.date}</div>
|
<div className="font-bold">{item.date}</div>
|
||||||
@ -414,32 +470,44 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "experience":
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -451,13 +519,13 @@ export const Leafish = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
{isFirstPage && <Header />}
|
{isFirstPage && <Header />}
|
||||||
|
|
||||||
<div className="p-custom grid grid-cols-2 items-start space-x-6">
|
<div className="p-custom grid grid-cols-2 items-start space-x-6">
|
||||||
<div className="grid gap-y-4">
|
<div className={cn("grid gap-y-4", sidebar.length === 0 && "col-span-2")}>
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-y-4">
|
<div className={cn("grid gap-y-4", sidebar.length === 0 && "hidden")}>
|
||||||
{sidebar.map((section) => (
|
{sidebar.map((section) => (
|
||||||
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -70,8 +71,16 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span className="text-primary">{item.name}</span>
|
{isUrl(item.value) ? (
|
||||||
<span>{item.value}</span>
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<span className="text-primary">{item.name}</span>
|
||||||
|
<span>{item.value}</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -98,9 +107,9 @@ const Summary = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -110,28 +119,51 @@ const Summary = () => {
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -150,7 +182,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}>
|
<section id={section.id} className={cn("grid", dateKey !== undefined && "gap-y-4")}>
|
||||||
@ -184,10 +216,10 @@ const Section = <T,>({
|
|||||||
<div className="col-span-3 space-y-1">
|
<div className="col-span-3 space-y-1">
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
|
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{keywords !== undefined && keywords.length > 0 && (
|
{keywords !== undefined && keywords.length > 0 && (
|
||||||
@ -219,10 +251,10 @@ const Section = <T,>({
|
|||||||
<div key={item.id}>
|
<div key={item.id}>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
|
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{keywords !== undefined && keywords.length > 0 && (
|
{keywords !== undefined && keywords.length > 0 && (
|
||||||
@ -240,30 +272,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -277,7 +296,12 @@ const Experience = () => {
|
|||||||
<Section<Experience> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
<Section<Experience> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -293,7 +317,12 @@ const Education = () => {
|
|||||||
<Section<Education> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
<Section<Education> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.area}</div>
|
||||||
<div>{item.studyType}</div>
|
<div>{item.studyType}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
@ -311,7 +340,7 @@ const Awards = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity name={item.awarder} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -326,7 +355,7 @@ const Certifications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -365,7 +394,12 @@ const Publications = () => {
|
|||||||
<Section<Publication> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
<Section<Publication> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.publisher}</div>
|
<div>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -380,7 +414,12 @@ const Volunteer = () => {
|
|||||||
<Section<Volunteer> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
<Section<Volunteer> section={section} urlKey="url" dateKey="date" summaryKey="summary">
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<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.position}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -417,7 +456,12 @@ const Projects = () => {
|
|||||||
>
|
>
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -432,7 +476,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -453,7 +502,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
>
|
>
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
<div>{item.location}</div>
|
<div>{item.location}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -464,36 +518,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -505,7 +573,7 @@ export const Nosepass = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
return (
|
return (
|
||||||
<div className="p-custom space-y-6">
|
<div className="p-custom space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<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>
|
<p className="font-medium text-primary">Curriculum Vitae</p>
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import React, { Fragment } from "react";
|
import React, { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -27,7 +28,6 @@ import { TemplateProps } from "../types/template";
|
|||||||
const Header = () => {
|
const Header = () => {
|
||||||
const basics = useArtboardStore((state) => state.resume.basics);
|
const basics = useArtboardStore((state) => state.resume.basics);
|
||||||
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
const profiles = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-between space-x-4 border-b border-primary pb-5">
|
<div className="flex items-center justify-between space-x-4 border-b border-primary pb-5">
|
||||||
@ -66,7 +66,13 @@ const Header = () => {
|
|||||||
{basics.customFields.map((item) => (
|
{basics.customFields.map((item) => (
|
||||||
<div key={item.id} className="flex items-center gap-x-1.5">
|
<div key={item.id} className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -85,15 +91,7 @@ const Header = () => {
|
|||||||
url={item.url}
|
url={item.url}
|
||||||
label={item.username}
|
label={item.username}
|
||||||
className="text-sm"
|
className="text-sm"
|
||||||
icon={
|
icon={<BrandIcon slug={item.icon} />}
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@ -113,9 +111,9 @@ const Summary = () => {
|
|||||||
<h4 className="font-bold text-primary">{section.name}</h4>
|
<h4 className="font-bold text-primary">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -137,28 +135,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -178,7 +199,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -200,11 +221,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -228,7 +249,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -250,7 +276,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -274,7 +305,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -295,7 +330,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -340,7 +375,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -361,7 +401,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -398,7 +443,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -418,7 +468,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -439,7 +494,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -455,34 +515,47 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "summary":
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -84,7 +85,13 @@ const Header = () => {
|
|||||||
<Fragment key={item.id}>
|
<Fragment key={item.id}>
|
||||||
<div className="flex items-center gap-x-1.5">
|
<div className="flex items-center gap-x-1.5">
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`)} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`)} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="size-1 rounded-full bg-background last:hidden" />
|
<div className="size-1 rounded-full bg-background last:hidden" />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -105,9 +112,9 @@ const Summary = () => {
|
|||||||
<h4 className="mb-2 border-b border-primary text-base font-bold">{section.name}</h4>
|
<h4 className="mb-2 border-b border-primary text-base font-bold">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -137,28 +144,57 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<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
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight &&
|
||||||
|
(icon ?? (
|
||||||
|
<i className="ph ph-bold ph-link text-primary group-[.summary]:text-background" />
|
||||||
|
))}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -178,7 +214,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -200,11 +236,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -222,30 +258,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -260,7 +283,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -282,7 +310,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</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="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||||
@ -327,7 +364,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
<div className="shrink-0 text-right group-[.sidebar]:text-left">
|
||||||
@ -372,7 +409,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -393,7 +435,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -430,7 +477,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -450,7 +502,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -471,7 +528,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
<div className="flex items-start justify-between group-[.sidebar]:flex-col group-[.sidebar]:items-start">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -487,36 +549,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -533,7 +609,7 @@ export const Pikachu = ({ columns, isFirstPage = false }: TemplateProps) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="main group col-span-2 space-y-4">
|
<div className={cn("main group space-y-4", sidebar.length > 0 ? "col-span-2" : "col-span-3")}>
|
||||||
{isFirstPage && <Header />}
|
{isFirstPage && <Header />}
|
||||||
|
|
||||||
{main.map((section) => (
|
{main.map((section) => (
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { cn, isEmptyString, isUrl } from "@reactive-resume/utils";
|
|||||||
import get from "lodash.get";
|
import get from "lodash.get";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
import { BrandIcon } from "../components/brand-icon";
|
||||||
import { Picture } from "../components/picture";
|
import { Picture } from "../components/picture";
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
import { TemplateProps } from "../types/template";
|
import { TemplateProps } from "../types/template";
|
||||||
@ -66,7 +67,13 @@ const Header = () => {
|
|||||||
className="flex items-center gap-x-1.5 border-r pr-2 last:border-r-0 last:pr-0"
|
className="flex items-center gap-x-1.5 border-r pr-2 last:border-r-0 last:pr-0"
|
||||||
>
|
>
|
||||||
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
<i className={cn(`ph ph-bold ph-${item.icon}`, "text-primary")} />
|
||||||
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
{isUrl(item.value) ? (
|
||||||
|
<a href={item.value} target="_blank" rel="noreferrer noopener nofollow">
|
||||||
|
{item.name || item.value}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span>{[item.name, item.value].filter(Boolean).join(": ")}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@ -85,9 +92,9 @@ const Summary = () => {
|
|||||||
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
<h4 className="mb-2 border-b pb-0.5 text-sm font-bold">{section.name}</h4>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
dangerouslySetInnerHTML={{ __html: section.content }}
|
||||||
className="wysiwyg"
|
className="wysiwyg"
|
||||||
style={{ columns: section.columns }}
|
style={{ columns: section.columns }}
|
||||||
dangerouslySetInnerHTML={{ __html: section.content }}
|
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
@ -109,28 +116,51 @@ const Rating = ({ level }: RatingProps) => (
|
|||||||
type LinkProps = {
|
type LinkProps = {
|
||||||
url: URL;
|
url: URL;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
|
iconOnRight?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Link = ({ url, icon, label, className }: LinkProps) => {
|
const Link = ({ url, icon, iconOnRight, label, className }: LinkProps) => {
|
||||||
if (!isUrl(url.href)) return null;
|
if (!isUrl(url.href)) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-x-1.5">
|
<div className="flex items-center gap-x-1.5 border-r pr-2 last:border-r-0 last:pr-0">
|
||||||
{icon ?? <i className="ph ph-bold ph-link text-primary" />}
|
{!iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
<a
|
<a
|
||||||
href={url.href}
|
href={url.href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener nofollow"
|
rel="noreferrer noopener nofollow"
|
||||||
className={cn("inline-block", className)}
|
className={cn("inline-block", className)}
|
||||||
>
|
>
|
||||||
{label || url.label || url.href}
|
{label ?? (url.label || url.href)}
|
||||||
</a>
|
</a>
|
||||||
|
{iconOnRight && (icon ?? <i className="ph ph-bold ph-link text-primary" />)}
|
||||||
</div>
|
</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> = {
|
type SectionProps<T> = {
|
||||||
section: SectionWithItem<T> | CustomSectionGroup;
|
section: SectionWithItem<T> | CustomSectionGroup;
|
||||||
children?: (item: T) => React.ReactNode;
|
children?: (item: T) => React.ReactNode;
|
||||||
@ -150,7 +180,7 @@ const Section = <T,>({
|
|||||||
summaryKey,
|
summaryKey,
|
||||||
keywordsKey,
|
keywordsKey,
|
||||||
}: SectionProps<T>) => {
|
}: SectionProps<T>) => {
|
||||||
if (!section.visible || !section.items.length) return null;
|
if (!section.visible || section.items.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id={section.id} className="grid">
|
<section id={section.id} className="grid">
|
||||||
@ -172,11 +202,11 @@ const Section = <T,>({
|
|||||||
<div key={item.id} className={cn("space-y-2", className)}>
|
<div key={item.id} className={cn("space-y-2", className)}>
|
||||||
<div>
|
<div>
|
||||||
{children?.(item as T)}
|
{children?.(item as T)}
|
||||||
{url !== undefined && <Link url={url} />}
|
{url !== undefined && section.separateLinks && <Link url={url} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{summary !== undefined && !isEmptyString(summary) && (
|
{summary !== undefined && !isEmptyString(summary) && (
|
||||||
<div className="wysiwyg" dangerouslySetInnerHTML={{ __html: summary }} />
|
<div dangerouslySetInnerHTML={{ __html: summary }} className="wysiwyg" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{level !== undefined && level > 0 && <Rating level={level} />}
|
{level !== undefined && level > 0 && <Rating level={level} />}
|
||||||
@ -194,30 +224,17 @@ const Section = <T,>({
|
|||||||
|
|
||||||
const Profiles = () => {
|
const Profiles = () => {
|
||||||
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
const section = useArtboardStore((state) => state.resume.sections.profiles);
|
||||||
const fontSize = useArtboardStore((state) => state.resume.metadata.typography.font.size);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section<Profile> section={section}>
|
<Section<Profile> section={section}>
|
||||||
{(item) => (
|
{(item) => (
|
||||||
<div>
|
<div>
|
||||||
{isUrl(item.url.href) ? (
|
{isUrl(item.url.href) ? (
|
||||||
<Link
|
<Link url={item.url} label={item.username} icon={<BrandIcon slug={item.icon} />} />
|
||||||
url={item.url}
|
|
||||||
label={item.username}
|
|
||||||
icon={
|
|
||||||
<img
|
|
||||||
className="ph"
|
|
||||||
width={fontSize}
|
|
||||||
height={fontSize}
|
|
||||||
alt={item.network}
|
|
||||||
src={`https://cdn.simpleicons.org/${item.icon}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<p>{item.username}</p>
|
<p>{item.username}</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-sm">{item.network}</p>
|
{!item.icon && <p className="text-sm">{item.network}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -232,7 +249,12 @@ const Experience = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -254,7 +276,12 @@ const Education = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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.area}</div>
|
||||||
<div>{item.score}</div>
|
<div>{item.score}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -278,7 +305,11 @@ const Awards = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.title}</div>
|
<div className="font-bold">{item.title}</div>
|
||||||
<div>{item.awarder}</div>
|
<LinkedEntity
|
||||||
|
name={item.awarder}
|
||||||
|
url={item.url}
|
||||||
|
separateLinks={section.separateLinks}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -299,7 +330,7 @@ const Certifications = () => {
|
|||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-bold">{item.name}</div>
|
<div className="font-bold">{item.name}</div>
|
||||||
<div>{item.issuer}</div>
|
<LinkedEntity name={item.issuer} url={item.url} separateLinks={section.separateLinks} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="shrink-0 text-right">
|
<div className="shrink-0 text-right">
|
||||||
@ -344,7 +375,12 @@ const Publications = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.publisher}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -365,7 +401,12 @@ const Volunteer = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.position}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -402,7 +443,12 @@ const Projects = () => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -422,7 +468,12 @@ const References = () => {
|
|||||||
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
<Section<Reference> section={section} urlKey="url" summaryKey="summary">
|
||||||
{(item) => (
|
{(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.description}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -443,7 +494,12 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
{(item) => (
|
{(item) => (
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="text-left">
|
<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>{item.description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -459,36 +515,50 @@ const Custom = ({ id }: { id: string }) => {
|
|||||||
|
|
||||||
const mapSectionToComponent = (section: SectionKey) => {
|
const mapSectionToComponent = (section: SectionKey) => {
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case "profiles":
|
case "profiles": {
|
||||||
return <Profiles />;
|
return <Profiles />;
|
||||||
case "summary":
|
}
|
||||||
|
case "summary": {
|
||||||
return <Summary />;
|
return <Summary />;
|
||||||
case "experience":
|
}
|
||||||
|
case "experience": {
|
||||||
return <Experience />;
|
return <Experience />;
|
||||||
case "education":
|
}
|
||||||
|
case "education": {
|
||||||
return <Education />;
|
return <Education />;
|
||||||
case "awards":
|
}
|
||||||
|
case "awards": {
|
||||||
return <Awards />;
|
return <Awards />;
|
||||||
case "certifications":
|
}
|
||||||
|
case "certifications": {
|
||||||
return <Certifications />;
|
return <Certifications />;
|
||||||
case "skills":
|
}
|
||||||
|
case "skills": {
|
||||||
return <Skills />;
|
return <Skills />;
|
||||||
case "interests":
|
}
|
||||||
|
case "interests": {
|
||||||
return <Interests />;
|
return <Interests />;
|
||||||
case "publications":
|
}
|
||||||
|
case "publications": {
|
||||||
return <Publications />;
|
return <Publications />;
|
||||||
case "volunteer":
|
}
|
||||||
|
case "volunteer": {
|
||||||
return <Volunteer />;
|
return <Volunteer />;
|
||||||
case "languages":
|
}
|
||||||
|
case "languages": {
|
||||||
return <Languages />;
|
return <Languages />;
|
||||||
case "projects":
|
}
|
||||||
|
case "projects": {
|
||||||
return <Projects />;
|
return <Projects />;
|
||||||
case "references":
|
}
|
||||||
|
case "references": {
|
||||||
return <References />;
|
return <References />;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
if (section.startsWith("custom.")) return <Custom id={section.split(".")[1]} />;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,3 @@ export type TemplateProps = {
|
|||||||
columns: SectionKey[][];
|
columns: SectionKey[][];
|
||||||
isFirstPage?: boolean;
|
isFirstPage?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type BaseProps = {
|
|
||||||
children?: React.ReactNode;
|
|
||||||
className?: string;
|
|
||||||
};
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ module.exports = {
|
|||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
colors: {
|
colors: {
|
||||||
text: "var(--color-text)",
|
foreground: "var(--color-foreground)",
|
||||||
primary: "var(--color-primary)",
|
primary: "var(--color-primary)",
|
||||||
background: "var(--color-background)",
|
background: "var(--color-background)",
|
||||||
},
|
},
|
||||||
@ -23,6 +23,28 @@ module.exports = {
|
|||||||
loose: "calc(var(--line-height) + 0.5)",
|
loose: "calc(var(--line-height) + 0.5)",
|
||||||
},
|
},
|
||||||
spacing: { custom: "var(--margin)" },
|
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")],
|
plugins: [require("@tailwindcss/typography")],
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
|
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
|
||||||
import react from "@vitejs/plugin-react-swc";
|
import react from "@vitejs/plugin-react-swc";
|
||||||
import { defineConfig, searchForWorkspaceRoot, splitVendorChunkPlugin } from "vite";
|
import { defineConfig, searchForWorkspaceRoot } from "vite";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: "/artboard/",
|
base: "/artboard/",
|
||||||
@ -11,15 +11,16 @@ export default defineConfig({
|
|||||||
|
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
emptyOutDir: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
port: +(process.env.__DEV__ARTBOARD_PORT ?? 6173),
|
port: 6173,
|
||||||
fs: { allow: [searchForWorkspaceRoot(process.cwd())] },
|
fs: { allow: [searchForWorkspaceRoot(process.cwd())] },
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [react(), nxViteTsPaths(), splitVendorChunkPlugin()],
|
plugins: [react(), nxViteTsPaths()],
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
@ -3,19 +3,38 @@
|
|||||||
"ignorePatterns": ["!**/*"],
|
"ignorePatterns": ["!**/*"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx"],
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:tailwindcss/recommended",
|
"plugin:tailwindcss/recommended",
|
||||||
"plugin:@tanstack/eslint-plugin-query/recommended"
|
"plugin:@tanstack/eslint-plugin-query/recommended"
|
||||||
],
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"projectService": "./apps/client/tsconfig.json"
|
||||||
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"tailwindcss": {
|
"tailwindcss": {
|
||||||
"callees": ["cn", "clsx", "cva"],
|
"callees": ["cn", "clsx", "cva"],
|
||||||
"config": "tailwind.config.js"
|
"config": "tailwind.config.js",
|
||||||
|
"whitelist": ["ph", "ph\\-.*", "si", "si\\-.*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins": ["lingui"],
|
"plugins": ["lingui"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
// eslint
|
||||||
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
|
|
||||||
|
// react
|
||||||
|
"react/no-unescaped-entities": "off",
|
||||||
|
"react/jsx-sort-props": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"reservedFirst": true,
|
||||||
|
"callbacksLast": true,
|
||||||
|
"shorthandFirst": true,
|
||||||
|
"noSortAlphabetically": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
// react-hooks
|
// react-hooks
|
||||||
"react-hooks/exhaustive-deps": "off",
|
"react-hooks/exhaustive-deps": "off",
|
||||||
|
|
||||||
@ -23,8 +42,59 @@
|
|||||||
"lingui/no-unlocalized-strings": [
|
"lingui/no-unlocalized-strings": [
|
||||||
2,
|
2,
|
||||||
{
|
{
|
||||||
"ignoreFunction": ["cn"],
|
"ignore": [
|
||||||
"ignoreAttribute": ["alt"]
|
// Ignore strings which are a single "word" (no spaces)
|
||||||
|
// and doesn't start with an uppercase letter
|
||||||
|
"^(?![A-Z])\\S+$",
|
||||||
|
// Ignore UPPERCASE literals
|
||||||
|
// Example: const test = "FOO"
|
||||||
|
"^[A-Z0-9_-]+$"
|
||||||
|
],
|
||||||
|
"ignoreNames": [
|
||||||
|
// Ignore matching className (case-insensitive)
|
||||||
|
{ "regex": { "pattern": "className", "flags": "i" } },
|
||||||
|
// Ignore UPPERCASE names
|
||||||
|
// Example: test.FOO = "ola!"
|
||||||
|
{ "regex": { "pattern": "^[A-Z0-9_-]+$" } },
|
||||||
|
"id",
|
||||||
|
"src",
|
||||||
|
"srcSet",
|
||||||
|
"styleName",
|
||||||
|
"placeholder",
|
||||||
|
"alt",
|
||||||
|
"type",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"displayName",
|
||||||
|
"Authorization"
|
||||||
|
],
|
||||||
|
"ignoreFunctions": [
|
||||||
|
"cn",
|
||||||
|
"cva",
|
||||||
|
"track",
|
||||||
|
"Error",
|
||||||
|
"console.*",
|
||||||
|
"*headers.set",
|
||||||
|
"*.addEventListener",
|
||||||
|
"*.removeEventListener",
|
||||||
|
"*.postMessage",
|
||||||
|
"*.getElementById",
|
||||||
|
"*.dispatch",
|
||||||
|
"*.commit",
|
||||||
|
"*.includes",
|
||||||
|
"*.indexOf",
|
||||||
|
"*.endsWith",
|
||||||
|
"*.startsWith",
|
||||||
|
"require"
|
||||||
|
],
|
||||||
|
// Following settings require typed linting https://typescript-eslint.io/getting-started/typed-linting/
|
||||||
|
"useTsTypes": true,
|
||||||
|
"ignoreMethodsOnTypes": [
|
||||||
|
// Ignore specified methods on Map and Set types
|
||||||
|
"Map.get",
|
||||||
|
"Map.has",
|
||||||
|
"Set.has"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lingui/t-call-in-function": 2,
|
"lingui/t-call-in-function": 2,
|
||||||
|
|||||||
@ -35,10 +35,13 @@
|
|||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<link rel="stylesheet" href="/src/styles/main.css" />
|
<link rel="stylesheet" href="/src/styles/main.css" />
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-background text-foreground text-sm antialiased print:bg-white print:m-0">
|
<body class="bg-background text-sm text-foreground antialiased print:m-0 print:bg-white">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
|
||||||
|
<!-- Phosphor Icons -->
|
||||||
|
<script src="https://unpkg.com/@phosphor-icons/web"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
const { join } = require("path");
|
const path = require("node:path");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: {
|
plugins: {
|
||||||
"postcss-import": {},
|
"postcss-import": {},
|
||||||
"tailwindcss/nesting": {},
|
"tailwindcss/nesting": {},
|
||||||
tailwindcss: { config: join(__dirname, "tailwind.config.js") },
|
tailwindcss: { config: path.join(__dirname, "tailwind.config.js") },
|
||||||
autoprefixer: {},
|
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 |
@ -9,7 +9,7 @@
|
|||||||
} else {
|
} else {
|
||||||
document.documentElement.classList.remove("dark");
|
document.documentElement.classList.remove("dark");
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
155
apps/client/public/styles/prism-dark.css
Normal file
155
apps/client/public/styles/prism-dark.css
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: #f8f8f2;
|
||||||
|
background: none;
|
||||||
|
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
||||||
|
text-align: left;
|
||||||
|
white-space: pre;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-break: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
-moz-tab-size: 4;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
tab-size: 4;
|
||||||
|
|
||||||
|
-webkit-hyphens: none;
|
||||||
|
-moz-hyphens: none;
|
||||||
|
-ms-hyphens: none;
|
||||||
|
hyphens: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code blocks */
|
||||||
|
pre[class*="language-"] {
|
||||||
|
padding: 1em;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
overflow: auto;
|
||||||
|
border-radius: 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
background: #2b2b2b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code */
|
||||||
|
:not(pre) > code[class*="language-"] {
|
||||||
|
padding: 0.1em;
|
||||||
|
border-radius: 0.3em;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.comment,
|
||||||
|
.token.prolog,
|
||||||
|
.token.doctype,
|
||||||
|
.token.cdata {
|
||||||
|
color: #d4d0ab;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.punctuation {
|
||||||
|
color: #fefefe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.property,
|
||||||
|
.token.tag,
|
||||||
|
.token.constant,
|
||||||
|
.token.symbol,
|
||||||
|
.token.deleted {
|
||||||
|
color: #ffa07a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.boolean,
|
||||||
|
.token.number {
|
||||||
|
color: #00e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.selector,
|
||||||
|
.token.attr-name,
|
||||||
|
.token.string,
|
||||||
|
.token.char,
|
||||||
|
.token.builtin,
|
||||||
|
.token.inserted {
|
||||||
|
color: #abe338;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.operator,
|
||||||
|
.token.entity,
|
||||||
|
.token.url,
|
||||||
|
.language-css .token.string,
|
||||||
|
.style .token.string,
|
||||||
|
.token.variable {
|
||||||
|
color: #00e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.attr-value,
|
||||||
|
.token.function {
|
||||||
|
color: #ffd700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.keyword {
|
||||||
|
color: #00e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.regex,
|
||||||
|
.token.important {
|
||||||
|
color: #ffd700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important,
|
||||||
|
.token.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.entity {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (forced-colors: active) {
|
||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: windowText;
|
||||||
|
background: window;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
background: window;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important {
|
||||||
|
background: highlight;
|
||||||
|
color: window;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.attr-value,
|
||||||
|
.token.function,
|
||||||
|
.token.keyword,
|
||||||
|
.token.operator,
|
||||||
|
.token.selector {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.attr-value,
|
||||||
|
.token.comment,
|
||||||
|
.token.doctype,
|
||||||
|
.token.function,
|
||||||
|
.token.keyword,
|
||||||
|
.token.operator,
|
||||||
|
.token.property,
|
||||||
|
.token.string {
|
||||||
|
color: highlight;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.attr-value,
|
||||||
|
.token.url {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
167
apps/client/public/styles/prism-light.css
Normal file
167
apps/client/public/styles/prism-light.css
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: #393a34;
|
||||||
|
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
||||||
|
direction: ltr;
|
||||||
|
text-align: left;
|
||||||
|
white-space: pre;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-break: normal;
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 1.2em;
|
||||||
|
|
||||||
|
-moz-tab-size: 4;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
tab-size: 4;
|
||||||
|
|
||||||
|
-webkit-hyphens: none;
|
||||||
|
-moz-hyphens: none;
|
||||||
|
-ms-hyphens: none;
|
||||||
|
hyphens: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre > code[class*="language-"] {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre[class*="language-"]::-moz-selection,
|
||||||
|
pre[class*="language-"] ::-moz-selection,
|
||||||
|
code[class*="language-"]::-moz-selection,
|
||||||
|
code[class*="language-"] ::-moz-selection {
|
||||||
|
background: #c1def1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre[class*="language-"]::selection,
|
||||||
|
pre[class*="language-"] ::selection,
|
||||||
|
code[class*="language-"]::selection,
|
||||||
|
code[class*="language-"] ::selection {
|
||||||
|
background: #c1def1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code blocks */
|
||||||
|
pre[class*="language-"] {
|
||||||
|
padding: 1em;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code */
|
||||||
|
:not(pre) > code[class*="language-"] {
|
||||||
|
padding: 0.2em;
|
||||||
|
padding-top: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.comment,
|
||||||
|
.token.prolog,
|
||||||
|
.token.doctype,
|
||||||
|
.token.cdata {
|
||||||
|
color: #008000;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.namespace {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.string {
|
||||||
|
color: #a31515;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.punctuation,
|
||||||
|
.token.operator {
|
||||||
|
color: #393a34; /* no highlight */
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.url,
|
||||||
|
.token.symbol,
|
||||||
|
.token.number,
|
||||||
|
.token.boolean,
|
||||||
|
.token.variable,
|
||||||
|
.token.constant,
|
||||||
|
.token.inserted {
|
||||||
|
color: #36acaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.keyword,
|
||||||
|
.token.attr-value,
|
||||||
|
.language-autohotkey .token.selector,
|
||||||
|
.language-json .token.boolean,
|
||||||
|
.language-json .token.number,
|
||||||
|
code[class*="language-css"] {
|
||||||
|
color: #0000ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.function {
|
||||||
|
color: #393a34;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.deleted,
|
||||||
|
.language-autohotkey .token.tag {
|
||||||
|
color: #9a050f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.selector,
|
||||||
|
.language-autohotkey .token.keyword {
|
||||||
|
color: #00009f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important {
|
||||||
|
color: #e90;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important,
|
||||||
|
.token.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.class-name,
|
||||||
|
.language-json .token.property {
|
||||||
|
color: #2b91af;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.tag,
|
||||||
|
.token.selector {
|
||||||
|
color: #800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.attr-name,
|
||||||
|
.token.property,
|
||||||
|
.token.regex,
|
||||||
|
.token.entity {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.directive.tag .tag {
|
||||||
|
background: #ffff00;
|
||||||
|
color: #393a34;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* overrides color-values for the Line Numbers plugin
|
||||||
|
* http://prismjs.com/plugins/line-numbers/
|
||||||
|
*/
|
||||||
|
.line-numbers.line-numbers .line-numbers-rows {
|
||||||
|
border-right-color: #a5a5a5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-numbers .line-numbers-rows > span:before {
|
||||||
|
color: #2b91af;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* overrides color-values for the Line Highlight plugin
|
||||||
|
* http://prismjs.com/plugins/line-highlight/
|
||||||
|
*/
|
||||||
|
.line-highlight.line-highlight {
|
||||||
|
background: rgba(193, 222, 241, 0.2);
|
||||||
|
background: -webkit-linear-gradient(left, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0));
|
||||||
|
background: linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0));
|
||||||
|
}
|
||||||
8
apps/client/public/support-logos/linkedin.svg
Normal file
8
apps/client/public/support-logos/linkedin.svg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<!-- Original Author: (Simple Icons)[https://github.com/simple-icons/simple-icons] -->
|
||||||
|
|
||||||
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<title>LinkedIn</title>
|
||||||
|
<path
|
||||||
|
fill="#0a66c2"
|
||||||
|
d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 730 B |
@ -289,7 +289,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -314,7 +314,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -314,7 +314,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -315,7 +315,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -289,7 +289,7 @@
|
|||||||
[[], []]
|
[[], []]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -288,7 +288,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -287,7 +287,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -289,7 +289,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -306,7 +306,7 @@
|
|||||||
[["projects", "certifications", "skills", "languages", "references"], []]
|
[["projects", "certifications", "skills", "languages", "references"], []]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -287,7 +287,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -315,7 +315,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -288,7 +288,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"css": {
|
"css": {
|
||||||
"value": ".section {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
"value": "* {\n\toutline: 1px solid #000;\n\toutline-offset: 4px;\n}",
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export const AiActions = ({ value, onChange, className }: Props) => {
|
|||||||
toast({
|
toast({
|
||||||
variant: "error",
|
variant: "error",
|
||||||
title: t`Oops, the server returned an error.`,
|
title: t`Oops, the server returned an error.`,
|
||||||
description: (error as Error)?.message,
|
description: (error as Error).message,
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
19
apps/client/src/components/brand-icon.tsx
Normal file
19
apps/client/src/components/brand-icon.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { cn } from "@reactive-resume/utils";
|
||||||
|
|
||||||
|
type BrandIconProps = {
|
||||||
|
slug: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BrandIcon = ({ slug }: BrandIconProps) => {
|
||||||
|
if (slug === "linkedin") {
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
alt="LinkedIn"
|
||||||
|
className="size-5"
|
||||||
|
src={`${window.location.origin}/support-logos/linkedin.svg`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <i className={cn("si si--color text-[1.25rem]", `si-${slug}`)} />;
|
||||||
|
};
|
||||||
@ -27,10 +27,7 @@ export const Copyright = ({ className }: Props) => (
|
|||||||
<span>{t`By the community, for the community.`}</span>
|
<span>{t`By the community, for the community.`}</span>
|
||||||
<span>
|
<span>
|
||||||
<Trans>
|
<Trans>
|
||||||
A passion project by{" "}
|
A passion project by <a href="https://www.amruthpillai.com/">Amruth Pillai</a>
|
||||||
<a target="_blank" rel="noopener noreferrer nofollow" href="https://www.amruthpillai.com/">
|
|
||||||
Amruth Pillai
|
|
||||||
</a>
|
|
||||||
</Trans>
|
</Trans>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|||||||
@ -12,12 +12,14 @@ export const Icon = ({ size = 32, className }: Props) => {
|
|||||||
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
||||||
|
|
||||||
switch (isDarkMode) {
|
switch (isDarkMode) {
|
||||||
case false:
|
case false: {
|
||||||
src = "/icon/dark.svg";
|
src = "/icon/dark.svg";
|
||||||
break;
|
break;
|
||||||
case true:
|
}
|
||||||
|
case true: {
|
||||||
src = "/icon/light.svg";
|
src = "/icon/light.svg";
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
CommandGroup,
|
CommandGroup,
|
||||||
CommandInput,
|
CommandInput,
|
||||||
CommandItem,
|
CommandItem,
|
||||||
|
CommandList,
|
||||||
Popover,
|
Popover,
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
@ -37,39 +38,43 @@ export const LocaleCombobox = ({ value, onValueChange }: Props) => {
|
|||||||
<Command shouldFilter={false}>
|
<Command shouldFilter={false}>
|
||||||
<CommandInput
|
<CommandInput
|
||||||
value={search}
|
value={search}
|
||||||
onValueChange={setSearch}
|
|
||||||
placeholder={t`Search for a language`}
|
placeholder={t`Search for a language`}
|
||||||
|
onValueChange={setSearch}
|
||||||
/>
|
/>
|
||||||
<CommandEmpty>{t`No results found`}</CommandEmpty>
|
<CommandList>
|
||||||
<CommandGroup>
|
<CommandEmpty>{t`No results found`}</CommandEmpty>
|
||||||
<ScrollArea orientation="vertical">
|
<CommandGroup>
|
||||||
<div className="max-h-60">
|
<ScrollArea orientation="vertical">
|
||||||
{options.map(({ original }) => (
|
<div className="max-h-60">
|
||||||
<CommandItem
|
{options.map(({ original }) => (
|
||||||
key={original.locale}
|
<CommandItem
|
||||||
value={original.locale.trim().toLowerCase()}
|
key={original.locale}
|
||||||
onSelect={async (selectedValue) => {
|
disabled={false}
|
||||||
const result = options.find(
|
value={original.locale.trim()}
|
||||||
({ original }) => original.locale.trim().toLowerCase() === selectedValue,
|
onSelect={(selectedValue) => {
|
||||||
);
|
const result = options.find(
|
||||||
|
({ original }) => original.locale.trim() === selectedValue,
|
||||||
|
);
|
||||||
|
|
||||||
if (!result) return null;
|
if (!result) return null;
|
||||||
|
|
||||||
onValueChange(result.original.locale);
|
onValueChange(result.original.locale);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Check
|
<Check
|
||||||
className={cn(
|
className={cn(
|
||||||
"mr-2 size-4 opacity-0",
|
"mr-2 size-4 opacity-0",
|
||||||
value === original.locale && "opacity-100",
|
value === original.locale && "opacity-100",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{original.name} <span className="ml-1 text-xs opacity-50">({original.locale})</span>
|
{original.name}{" "}
|
||||||
</CommandItem>
|
<span className="ml-1 text-xs opacity-50">({original.locale})</span>
|
||||||
))}
|
</CommandItem>
|
||||||
</div>
|
))}
|
||||||
</ScrollArea>
|
</div>
|
||||||
</CommandGroup>
|
</ScrollArea>
|
||||||
|
</CommandGroup>
|
||||||
|
</CommandList>
|
||||||
</Command>
|
</Command>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,12 +12,14 @@ export const Logo = ({ size = 32, className }: Props) => {
|
|||||||
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
let src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
||||||
|
|
||||||
switch (isDarkMode) {
|
switch (isDarkMode) {
|
||||||
case false:
|
case false: {
|
||||||
src = "/logo/light.svg";
|
src = "/logo/light.svg";
|
||||||
break;
|
break;
|
||||||
case true:
|
}
|
||||||
|
case true: {
|
||||||
src = "/logo/dark.svg";
|
src = "/logo/dark.svg";
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -12,9 +12,18 @@ export const UserAvatar = ({ size = 36, className }: Props) => {
|
|||||||
|
|
||||||
if (!user) return null;
|
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);
|
const initials = getInitials(user.name);
|
||||||
|
|
||||||
picture = (
|
picture = (
|
||||||
@ -25,15 +34,6 @@ export const UserAvatar = ({ size = 36, className }: Props) => {
|
|||||||
{initials}
|
{initials}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
picture = (
|
|
||||||
<img
|
|
||||||
alt={user.name}
|
|
||||||
src={user.picture}
|
|
||||||
className="rounded-full"
|
|
||||||
style={{ width: size, height: size }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className={className}>{picture}</div>;
|
return <div className={className}>{picture}</div>;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
KeyboardShortcut,
|
KeyboardShortcut,
|
||||||
} from "@reactive-resume/ui";
|
} from "@reactive-resume/ui";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router";
|
||||||
|
|
||||||
import { useLogout } from "../services/auth";
|
import { useLogout } from "../services/auth";
|
||||||
|
|
||||||
@ -24,7 +24,11 @@ export const UserOptions = ({ children }: Props) => {
|
|||||||
<DropdownMenuTrigger asChild>{children}</DropdownMenuTrigger>
|
<DropdownMenuTrigger asChild>{children}</DropdownMenuTrigger>
|
||||||
|
|
||||||
<DropdownMenuContent side="top" align="start" className="w-48">
|
<DropdownMenuContent side="top" align="start" className="w-48">
|
||||||
<DropdownMenuItem onClick={() => navigate("/dashboard/settings")}>
|
<DropdownMenuItem
|
||||||
|
onClick={() => {
|
||||||
|
void navigate("/dashboard/settings");
|
||||||
|
}}
|
||||||
|
>
|
||||||
{t`Settings`}
|
{t`Settings`}
|
||||||
{/* eslint-disable-next-line lingui/no-unlocalized-strings */}
|
{/* eslint-disable-next-line lingui/no-unlocalized-strings */}
|
||||||
<KeyboardShortcut>⇧S</KeyboardShortcut>
|
<KeyboardShortcut>⇧S</KeyboardShortcut>
|
||||||
|
|||||||
2
apps/client/src/constants/llm.ts
Normal file
2
apps/client/src/constants/llm.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export const DEFAULT_MODEL = "gpt-3.5-turbo";
|
||||||
|
export const DEFAULT_MAX_TOKENS = 1024;
|
||||||
@ -13,7 +13,7 @@ type ToasterToast = ToastProps & {
|
|||||||
action?: ToastActionElement;
|
action?: ToastActionElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionTypes = {
|
export const actionTypes = {
|
||||||
ADD_TOAST: "ADD_TOAST",
|
ADD_TOAST: "ADD_TOAST",
|
||||||
UPDATE_TOAST: "UPDATE_TOAST",
|
UPDATE_TOAST: "UPDATE_TOAST",
|
||||||
DISMISS_TOAST: "DISMISS_TOAST",
|
DISMISS_TOAST: "DISMISS_TOAST",
|
||||||
@ -40,9 +40,9 @@ type Action =
|
|||||||
toastId?: ToasterToast["id"];
|
toastId?: ToasterToast["id"];
|
||||||
};
|
};
|
||||||
|
|
||||||
interface State {
|
type State = {
|
||||||
toasts: ToasterToast[];
|
toasts: ToasterToast[];
|
||||||
}
|
};
|
||||||
|
|
||||||
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
||||||
|
|
||||||
@ -64,17 +64,19 @@ const addToRemoveQueue = (toastId: string) => {
|
|||||||
|
|
||||||
export const reducer = (state: State, action: Action): State => {
|
export const reducer = (state: State, action: Action): State => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case "ADD_TOAST":
|
case "ADD_TOAST": {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case "UPDATE_TOAST":
|
case "UPDATE_TOAST": {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
|
toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case "DISMISS_TOAST": {
|
case "DISMISS_TOAST": {
|
||||||
const { toastId } = action;
|
const { toastId } = action;
|
||||||
@ -82,9 +84,9 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
if (toastId) {
|
if (toastId) {
|
||||||
addToRemoveQueue(toastId);
|
addToRemoveQueue(toastId);
|
||||||
} else {
|
} else {
|
||||||
state.toasts.forEach((toast) => {
|
for (const toast of state.toasts) {
|
||||||
addToRemoveQueue(toast.id);
|
addToRemoveQueue(toast.id);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -99,7 +101,7 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case "REMOVE_TOAST":
|
case "REMOVE_TOAST": {
|
||||||
if (action.toastId === undefined) {
|
if (action.toastId === undefined) {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@ -110,18 +112,19 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
...state,
|
...state,
|
||||||
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const listeners: Array<(state: State) => void> = [];
|
const listeners: ((state: State) => void)[] = [];
|
||||||
|
|
||||||
let memoryState: State = { toasts: [] };
|
let memoryState: State = { toasts: [] };
|
||||||
|
|
||||||
function dispatch(action: Action) {
|
function dispatch(action: Action) {
|
||||||
memoryState = reducer(memoryState, action);
|
memoryState = reducer(memoryState, action);
|
||||||
listeners.forEach((listener) => {
|
for (const listener of listeners) {
|
||||||
listener(memoryState);
|
listener(memoryState);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Toast = Omit<ToasterToast, "id">;
|
type Toast = Omit<ToasterToast, "id">;
|
||||||
@ -129,12 +132,15 @@ type Toast = Omit<ToasterToast, "id">;
|
|||||||
function toast({ ...props }: Toast) {
|
function toast({ ...props }: Toast) {
|
||||||
const id = createId();
|
const id = createId();
|
||||||
|
|
||||||
const update = (props: ToasterToast) =>
|
const update = (props: ToasterToast) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "UPDATE_TOAST",
|
type: "UPDATE_TOAST",
|
||||||
toast: { ...props, id },
|
toast: { ...props, id },
|
||||||
});
|
});
|
||||||
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
};
|
||||||
|
const dismiss = () => {
|
||||||
|
dispatch({ type: "DISMISS_TOAST", toastId: id });
|
||||||
|
};
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "ADD_TOAST",
|
type: "ADD_TOAST",
|
||||||
@ -170,7 +176,9 @@ function useToast() {
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
toast,
|
toast,
|
||||||
dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
dismiss: (toastId?: string) => {
|
||||||
|
dispatch({ type: "DISMISS_TOAST", toastId });
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,20 +2,15 @@ import { t } from "@lingui/macro";
|
|||||||
import { deepSearchAndParseDates, ErrorMessage } from "@reactive-resume/utils";
|
import { deepSearchAndParseDates, ErrorMessage } from "@reactive-resume/utils";
|
||||||
import _axios from "axios";
|
import _axios from "axios";
|
||||||
import createAuthRefreshInterceptor from "axios-auth-refresh";
|
import createAuthRefreshInterceptor from "axios-auth-refresh";
|
||||||
import { redirect } from "react-router-dom";
|
import { redirect } from "react-router";
|
||||||
|
|
||||||
|
import { refreshToken } from "@/client/services/auth";
|
||||||
|
|
||||||
import { USER_KEY } from "../constants/query-keys";
|
import { USER_KEY } from "../constants/query-keys";
|
||||||
import { toast } from "../hooks/use-toast";
|
import { toast } from "../hooks/use-toast";
|
||||||
import { refresh } from "../services/auth/refresh";
|
|
||||||
import { translateError } from "../services/errors/translate-error";
|
import { translateError } from "../services/errors/translate-error";
|
||||||
import { queryClient } from "./query-client";
|
import { queryClient } from "./query-client";
|
||||||
|
|
||||||
export type ServerError = {
|
|
||||||
statusCode: number;
|
|
||||||
message: string;
|
|
||||||
error: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const axios = _axios.create({ baseURL: "/api", withCredentials: true });
|
export const axios = _axios.create({ baseURL: "/api", withCredentials: true });
|
||||||
|
|
||||||
// Intercept responses to transform ISO dates to JS date objects
|
// 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 });
|
const axiosForRefresh = _axios.create({ baseURL: "/api", withCredentials: true });
|
||||||
|
|
||||||
// Interceptor to handle expired access token errors
|
// Interceptor to handle expired access token errors
|
||||||
const handleAuthError = async () => {
|
const handleAuthError = () => refreshToken(axiosForRefresh);
|
||||||
try {
|
|
||||||
await refresh(axiosForRefresh);
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
} catch (error) {
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Interceptor to handle expired refresh token errors
|
// Interceptor to handle expired refresh token errors
|
||||||
const handleRefreshError = async () => {
|
const handleRefreshError = async () => {
|
||||||
try {
|
await queryClient.invalidateQueries({ queryKey: USER_KEY });
|
||||||
queryClient.invalidateQueries({ queryKey: USER_KEY });
|
redirect("/auth/login");
|
||||||
redirect("/auth/login");
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
} catch (error) {
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Intercept responses to check for 401 and 403 errors, refresh token and retry the request
|
// Intercept responses to check for 401 and 403 errors, refresh token and retry the request
|
||||||
|
|||||||
@ -13,10 +13,12 @@ export async function dynamicActivate(locale: string) {
|
|||||||
i18n.loadAndActivate({ locale, messages });
|
i18n.loadAndActivate({ locale, messages });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
if (dayjsLocales[locale]) {
|
if (dayjsLocales[locale]) {
|
||||||
dayjs.locale(await dayjsLocales[locale]());
|
dayjs.locale(await dayjsLocales[locale]());
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
console.error(error);
|
// eslint-disable-next-line lingui/no-unlocalized-strings
|
||||||
|
throw new Error(`Failed to load messages for locale: ${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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user