diff --git a/README.md b/README.md index 759c99f..fba1756 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ Donation methods: - Github Sponsors - https://github.com/sponsors/Gaohaoyang + +- Interac e-Transfer + - gaohaoyang126@outlook.com + - Paypal - [PayPal Donation Link](https://www.paypal.com/donate/?business=NB2D3UXSQKDKU&no_recurring=0&item_name=Thanks+for+your+support%21+I+really+appreciate+it.+Have+a+great+day%21¤cy_code=CAD) @@ -58,4 +62,7 @@ Donation methods: +- Buy Me a Coffee + - https://buymeacoffee.com/gaohaoyangh + Enjoy it! :smile: diff --git a/package.json b/package.json index c7e5b96..578a1dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pte-crx", "private": true, - "version": "1.2.0", + "version": "1.2.1", "type": "module", "scripts": { "dev": "vite", @@ -13,7 +13,8 @@ "clsx": "^2.1.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-draggable": "^4.4.6" + "react-draggable": "^4.4.6", + "react-icons": "^5.3.0" }, "devDependencies": { "@crxjs/vite-plugin": "2.0.0-beta.25", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 963da9c..cba903f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: react-draggable: specifier: ^4.4.6 version: 4.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-icons: + specifier: ^5.3.0 + version: 5.3.0(react@18.3.1) devDependencies: '@crxjs/vite-plugin': specifier: 2.0.0-beta.25 @@ -1380,6 +1383,11 @@ packages: react: '>= 16.3.0' react-dom: '>= 16.3.0' + react-icons@5.3.0: + resolution: {integrity: sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==} + peerDependencies: + react: '*' + react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -2887,6 +2895,10 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + react-icons@5.3.0(react@18.3.1): + dependencies: + react: 18.3.1 + react-is@16.13.1: {} react-refresh@0.13.0: {} diff --git a/src/ContentUI/index.tsx b/src/ContentUI/index.tsx index 917acd9..ad994d9 100644 --- a/src/ContentUI/index.tsx +++ b/src/ContentUI/index.tsx @@ -4,6 +4,13 @@ import { PTEDataType } from '../type/PTEDataType' import ProgressBar from './ProgressBar' import clsx from 'clsx' import Draggable from 'react-draggable' +import { + PiBookOpenUser, + PiHeadphones, + PiPenNib, + PiChatsCircle, +} from 'react-icons/pi' +import { VscGithubInverted } from 'react-icons/vsc' const ContentUI = () => { const [scoresComparison, setScoresComparison] = useState< @@ -22,7 +29,13 @@ const ContentUI = () => { }[] >([]) const [skillsProfile, setSkillsProfile] = useState< - Array<{ key: string; name: string; score: number; skills: string[] }> + Array<{ + key: string + name: string + score: number + skills: string[] + support: Array<'Listening' | 'Reading' | 'Speaking' | 'Writing'> + }> >([]) const [minimize, setMinimize] = useState(true) const [showContent, setShowContent] = useState(false) @@ -154,11 +167,12 @@ const ContentUI = () => { name: string score: number skills: string[] + support: Array<'Listening' | 'Reading' | 'Speaking' | 'Writing'> }> = [] for (const key in pteData.skillsProfile) { if (Object.prototype.hasOwnProperty.call(pteData.skillsProfile, key)) { - // @ts-expect-error this is a number - const element: number = pteData.skillsProfile[key] + const element: number = + pteData.skillsProfile[key as keyof typeof pteData.skillsProfile] let showName = key if (key === 'openResponseSpeakingWriting') { showName = 'Open Response Speaking and Writing' @@ -182,8 +196,9 @@ const ContentUI = () => { key, name: showName, score: element, - // @ts-expect-error err - skills: skillsAnalysis[key], + skills: skillsAnalysis[key as keyof typeof skillsAnalysis].component, + support: skillsAnalysis[key as keyof typeof skillsAnalysis] + .support as Array<'Listening' | 'Reading' | 'Speaking' | 'Writing'>, }) } } @@ -216,7 +231,7 @@ const ContentUI = () => { 'relative box-border flex flex-col overflow-auto rounded-xl bg-sky-50 text-sm text-slate-900 shadow-cyan-950/55 transition-all', minimize ? 'h-6 w-6 overflow-hidden p-0' - : 'h-[576px] max-h-[71vh] w-[554px] p-4', + : 'h-[574px] max-h-[71vh] w-[564px] p-4', dragging ? 'scale-[1.02] shadow-2xl' : 'scale-100 shadow-md', )} > @@ -248,15 +263,40 @@ const ContentUI = () => { )} -
Score
+
+ Score + + + +
- - - - + + + + @@ -325,8 +365,8 @@ const ContentUI = () => { {skillsProfile.map((skill) => (
-
{skill.name}
-
+
{skill.name}
+
{skill.skills.join(', ')}
{ > {skill.score}
+
+ {skill.support.map((support) => { + switch (support) { + case 'Listening': + return + case 'Reading': + return ( + + ) + case 'Speaking': + return ( + + ) + case 'Writing': + return + } + })} +
))} -
+
- Sponsor me for a cup of coffee! + Developed by HyG. Buy me a coffee! {' '} ☕
diff --git a/src/ContentUI/scoreList.ts b/src/ContentUI/scoreList.ts index be80399..a4afcdd 100644 --- a/src/ContentUI/scoreList.ts +++ b/src/ContentUI/scoreList.ts @@ -157,12 +157,24 @@ const HIW = 'HIW' const WFD = 'WFD' export const skillsAnalysis = { - openResponseSpeakingWriting: [WE, DI, RTS], - reproducingSpokenWrittenLanguage: [WFD, RA, RS, SST], - writingExtended: [WE, SST, SWT], - writingShort: [WFD, FIBRW, FIBL], - speakingExtended: [DI, RTS], - speakingShort: [RA, RS, ASQ], - multipleSkillsComprehension: [FIBRW, SST, WFD, RA, RS, SWT, HIW], - singleSkillComprehension: [RO, FIBR, MCMRW, MCSR, MCML, MCSL, SMW], + openResponseSpeakingWriting: { + component: [WE, DI, RTS], + support: ['Speaking', 'Writing'], + }, + reproducingSpokenWrittenLanguage: { + component: [WFD, RA, RS, SST], + support: ['Speaking', 'Writing'], + }, + writingExtended: { component: [WE, SST, SWT], support: ['Writing'] }, + writingShort: { component: [WFD, FIBRW, FIBL], support: ['Writing'] }, + speakingExtended: { component: [DI, RTS], support: ['Speaking'] }, + speakingShort: { component: [RA, RS, ASQ], support: ['Speaking'] }, + multipleSkillsComprehension: { + component: [FIBRW, SST, WFD, RA, RS, SWT, HIW], + support: ['Listening', 'Reading'], + }, + singleSkillComprehension: { + component: [RO, FIBR, MCMRW, MCSR, MCML, MCSL, SMW], + support: ['Listening', 'Reading'], + }, }
ListeningReadingSpeakingWriting +
+
Listening
+ +
+
+
+
Reading
+ +
+
+
+
Speaking
+ +
+
+
+
Writing
+ +
+
Total