Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions src/components/SkillCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,27 @@ export default function SkillCard({ skill, variant = 'grid', className = '' }: P
const focus = skill.roleRelevance?.join(' ');

const cardBody = (
<>
{/* Row 1: icon + name left, years right */}
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2 min-w-0">
<SkillIcon name={iconName} className="text-text-muted shrink-0" />
{variant === 'grid'
? <h3 className="text-base font-semibold text-text-primary truncate">{skill.name}</h3>
: <span className="font-medium text-text-primary truncate">{skill.name}</span>
}
</div>
{skill.yearsOfExperience && (
<span className="text-xs text-text-muted shrink-0">
<div className="flex items-stretch gap-2">
{/* Left: icon + name, vertically centered across full card height */}
<div className="flex items-center gap-2 flex-1 min-w-0">
<SkillIcon name={iconName} className="text-text-muted shrink-0" />
{variant === 'grid'
? <h3 className="text-base font-semibold text-text-primary break-words [overflow-wrap:anywhere]">{skill.name}</h3>
: <span className="font-medium text-text-primary break-words [overflow-wrap:anywhere]">{skill.name}</span>
}
</div>
{/* Right: years on top, level badge below */}
<div className="flex flex-col items-end shrink-0 justify-between gap-1">
{skill.yearsOfExperience ? (
<span className="text-xs text-text-muted whitespace-nowrap">
{skill.yearsOfExperience}yr{skill.yearsOfExperience !== 1 ? 's' : ''}
</span>
)}
</div>
{/* Row 2: level badge below name */}
<div className="mt-1.5 pl-7">
<span className={`text-xs px-2 py-0.5 rounded font-medium ${levelClasses}`}>
) : null}
<span className={`text-xs px-2 py-0.5 rounded font-medium whitespace-nowrap ${levelClasses}`}>
{skill.level}
</span>
</div>
</>
</div>
);

if (variant === 'list') {
Expand Down
51 changes: 1 addition & 50 deletions src/components/admin/forms/SkillsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ export default function SkillsForm({
const [error, setError] = useState("");
const [tags, setTags] = useState<string[]>(initialData?.tags || []);
const [newTag, setNewTag] = useState("");
const [keywords, setKeywords] = useState<string[]>(
const [keywords] = useState<string[]>(
initialData?.keywords || [],
);
const [newKeyword, setNewKeyword] = useState("");
const [roleRelevance, setRoleRelevance] = useState<string[]>(
initialData?.roleRelevance || [],
);
Expand Down Expand Up @@ -88,17 +87,6 @@ export default function SkillsForm({
setTags(tags.filter((_, i) => i !== index));
};

const addKeyword = () => {
if (newKeyword.trim() && !keywords.includes(newKeyword.trim())) {
setKeywords([...keywords, newKeyword.trim()]);
setNewKeyword("");
}
};

const removeKeyword = (index: number) => {
setKeywords(keywords.filter((_, i) => i !== index));
};

const toggleRole = (roleValue: string) => {
console.log("=== toggleRole called ===");
console.log("roleValue:", roleValue);
Expand Down Expand Up @@ -262,43 +250,6 @@ export default function SkillsForm({
)}
</Card>

{/* Keywords Section */}
<Card>
<CardHeader
title="Keywords"
description="Add keywords for search and filtering"
/>

<div className="flex gap-2 mb-4">
<input
type="text"
value={newKeyword}
onChange={(e) => setNewKeyword(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
addKeyword();
}
}}
placeholder="Add a keyword..."
className="flex-1 px-4 py-2 bg-dark-layer border border-dark-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-blue"
/>
<Button type="button" variant="secondary" onClick={addKeyword}>
Add
</Button>
</div>

{keywords.length > 0 && (
<div className="flex flex-wrap gap-2">
{keywords.map((keyword, index) => (
<Tag key={index} onRemove={() => removeKeyword(index)}>
{keyword}
</Tag>
))}
</div>
)}
</Card>

{/* Form Actions */}
<div className="flex justify-end gap-4 pt-4 border-t border-dark-border">
<Button type="button" variant="secondary" onClick={onCancel}>
Expand Down
12 changes: 12 additions & 0 deletions src/components/icons/customIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,16 @@ export const customIcons: Record<string, { svg: string; viewBox?: string }> = {
svg: `<path d="M64.004 25.602c-17.067 0-27.73 8.53-32 25.597 6.398-8.531 13.867-11.73 22.398-9.597 4.871 1.214 8.352 4.746 12.207 8.66C72.883 56.629 80.145 64 96.004 64c17.066 0 27.73-8.531 32-25.602-6.399 8.536-13.867 11.735-22.399 9.602-4.87-1.215-8.347-4.746-12.207-8.66-6.27-6.367-13.53-13.738-29.394-13.738zM32.004 64c-17.066 0-27.73 8.531-32 25.602C6.402 81.066 13.87 77.867 22.402 80c4.871 1.215 8.352 4.746 12.207 8.66 6.274 6.367 13.536 13.738 29.395 13.738 17.066 0 27.73-8.53 32-25.597-6.399 8.531-13.867 11.73-22.399 9.597-4.87-1.214-8.347-4.746-12.207-8.66C55.128 71.371 47.868 64 32.004 64zm0 0" fill="#38bdf8"></path>`,
viewBox: "0 0 128 128",
},
Markdown: {
svg: `<path d="M11.95 24.348c-5.836 0-10.618 4.867-10.618 10.681v57.942c0 5.814 4.782 10.681 10.617 10.681h104.102c5.835 0 10.617-4.867 10.617-10.681V35.03c0-5.814-4.783-10.681-10.617-10.681H14.898l-.002-.002H11.95zm-.007 9.543h104.108c.625 0 1.076.423 1.076 1.14v57.94c0 .717-.453 1.14-1.076 1.14H11.949c-.623 0-1.076-.423-1.076-1.14V35.029c0-.715.451-1.135 1.07-1.138z"/><path d="M20.721 84.1V43.9H32.42l11.697 14.78L55.81 43.9h11.696v40.2H55.81V61.044l-11.694 14.78-11.698-14.78V84.1H20.722zm73.104 0L76.28 64.591h11.697V43.9h11.698v20.69h11.698zm0 0"/>`,
viewBox: "0 0 128 128",
},
MDX: {
svg: `<path d="M11.95 24.348c-5.836 0-10.618 4.867-10.618 10.681v57.942c0 5.814 4.782 10.681 10.617 10.681h104.102c5.835 0 10.617-4.867 10.617-10.681V35.03c0-5.814-4.783-10.681-10.617-10.681H14.898l-.002-.002H11.95zm-.007 9.543h104.108c.625 0 1.076.423 1.076 1.14v57.94c0 .717-.453 1.14-1.076 1.14H11.949c-.623 0-1.076-.423-1.076-1.14V35.029c0-.715.451-1.135 1.07-1.138z" fill="#f6a623"/><text x="64" y="78" text-anchor="middle" font-size="42" font-weight="bold" font-family="monospace" fill="#f6a623">MDX</text>`,
viewBox: "0 0 128 128",
},
Astro: {
svg: `<linearGradient id="astro-grad-a" x1="882.997" x2="638.955" y1="27.113" y2="866.902" gradientTransform="scale(.1)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#000014"/><stop offset="1" stop-color="#150426"/></linearGradient><linearGradient id="astro-grad-b" x1="1001.68" x2="790.326" y1="652.45" y2="1094.91" gradientTransform="scale(.1)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ff1639"/><stop offset="1" stop-color="#ff1639" stop-opacity="0"/></linearGradient><path fill="url(#astro-grad-a)" d="M81.504 9.465c.973 1.207 1.469 2.836 2.457 6.09l21.656 71.136a90.079 90.079 0 00-25.89-8.765L65.629 30.28a1.833 1.833 0 00-3.52.004L48.18 77.902a90.104 90.104 0 00-26.003 8.778l21.758-71.14c.996-3.25 1.492-4.876 2.464-6.083a8.023 8.023 0 013.243-2.398c1.433-.575 3.136-.575 6.535-.575H71.72c3.402 0 5.105 0 6.543.579a7.988 7.988 0 013.242 2.402z"/><path fill="#ff5d01" d="M84.094 90.074c-3.57 3.055-10.696 5.137-18.903 5.137-10.07 0-18.515-3.137-20.754-7.356-.8 2.418-.98 5.184-.98 6.954 0 0-.527 8.675 5.508 14.71a5.671 5.671 0 015.672-5.671c5.37 0 5.367 4.683 5.363 8.488v.336c0 5.773 3.527 10.719 8.543 12.805a11.62 11.62 0 01-1.172-5.098c0-5.508 3.23-7.555 6.988-9.938 2.989-1.894 6.309-4 8.594-8.222a15.513 15.513 0 001.875-7.41 15.55 15.55 0 00-.734-4.735z"/><path fill="url(#astro-grad-b)" d="M84.094 90.074c-3.57 3.055-10.696 5.137-18.903 5.137-10.07 0-18.515-3.137-20.754-7.356-.8 2.418-.98 5.184-.98 6.954 0 0-.527 8.675 5.508 14.71a5.671 5.671 0 015.672-5.671c5.37 0 5.367 4.683 5.363 8.488v.336c0 5.773 3.527 10.719 8.543 12.805a11.62 11.62 0 01-1.172-5.098c0-5.508 3.23-7.555 6.988-9.938 2.989-1.894 6.309-4 8.594-8.222a15.513 15.513 0 001.875-7.41 15.55 15.55 0 00-.734-4.735z"/>`,
viewBox: "0 0 128 128",
},
};