Skip to content

Commit 697faa6

Browse files
committed
Revamp skill display UI and add section title
Updated SkillContainer to use level indicators and improved layout, replacing the progress bar and XP-to-next-level display. Added a section title to the Skills component for better structure and imported related CSS.
1 parent e0b8d3c commit 697faa6

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import './SkillContainer.css';
2+
import {CombatMastery, ForagingMastery, FarmingMastery, MiningMastery, FishingMastery} from '@media/Masteries';
23

34
type SkillProps = {
45
skillImg: string;
@@ -17,7 +18,6 @@ const Skills = ({
1718
levelInfo
1819
}: SkillProps) => {
1920
const currentLevel = (xp >= levelInfo.val) ? levelInfo.id : levelInfo.id - 1;
20-
const xpToNextLevel = (xp >= 15000) ? 0 : (levelInfo.val - xp);
2121

2222
const currentLevelXpRequirement = levelInfo.id > 1 ? Math.floor(levelInfo.val * 0.85) : 0;
2323
const nextLevelXpRequirement = levelInfo.val;
@@ -32,31 +32,27 @@ const Skills = ({
3232
}
3333

3434
return (
35-
<div className="skill-container">
36-
<p className="skill-container__title">
37-
{`${skillName} lvl ${currentLevel}`}
38-
</p>
39-
<div className="skill-container__stats">
40-
<div className="skill-container__stats-line">
41-
<div className="skill-container__progress-bar">
42-
<div
43-
className="skill-container__progress-fill"
44-
style={{
45-
width: `${progressPercentage}%`
46-
}}
47-
></div>
48-
</div>
49-
{xpToNextLevel > 0 ? `${xpToNextLevel}XP to next level` : "Max Level Reached"}
35+
<div className="skill-container">
36+
<div className='skill-container__item'>
37+
<span>{`${skillName}`}</span>
38+
<img
39+
src={skillImg}
40+
alt={skillName}
41+
title={`${skillName} - Level ${currentLevel}`}
42+
className='skill-container__icon'
43+
/>
44+
<div className='skill-container__level-indicators' >
45+
{Array.from({ length: 10 }).map((_, index) => (
46+
<div
47+
key={index}
48+
className={`skill-container__level-block ${index === 4 || index === 9 ? 'lg' : 'sm'} ${currentLevel > index ? 'active' : ''}`}
49+
/>
50+
))}
5051
</div>
52+
<span className='skill-container__level-no'>{`${currentLevel}`}</span>
5153
</div>
52-
<img
53-
src={skillImg}
54-
alt={skillName}
55-
className="skill-container__icon"
56-
title={`${skillName} - Level ${currentLevel}`}
57-
/>
5854
</div>
59-
);
55+
)
6056
};
6157

6258
export default Skills;

src/Components/Skills/Skills.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useState } from 'react'
22
import SkillContainer from './SkillContainer/SkillContainer'
33
import {Farming, Mining, Foraging, Fishing, Combat} from '@media/Skills'
44
import type { experienceType } from 'types/displayDataTypes'
5+
import './Skills.css'
56

67
interface SkillsProps {
78
experience: experienceType[];
@@ -12,6 +13,9 @@ const Skills = ({ experience }: SkillsProps) => {
1213
console.log("Skills data:", experience);
1314
return (
1415
<section className="stats-container">
16+
<div className="section-title">
17+
<h2>Skills</h2>
18+
</div>
1519
<div className="skill-info">
1620
{experience.map((item, i: number) => (i === 5) ? "" :
1721
<SkillContainer

0 commit comments

Comments
 (0)