Skip to content

Commit ededb4b

Browse files
authored
Merge pull request #458 from MrDoomy/feat/better-checkboxes
Using toggle switches instead of checkboxes
2 parents 63347fc + e084c9e commit ededb4b

File tree

10 files changed

+756
-294
lines changed

10 files changed

+756
-294
lines changed

src/components/__tests__/__snapshots__/addons.test.js.snap

Lines changed: 382 additions & 24 deletions
Large diffs are not rendered by default.

src/components/__tests__/__snapshots__/donate.test.js.snap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,16 @@ exports[`Donate renders correctly 1`] = `
7171
Buy me a ko-fi
7272
</a>
7373
<a
74-
className="flex items-center justify-evenly bg-blue-500 text-white py-2 px-4 my-2"
74+
className="flex items-center justify-evenly bg-white-500 text-white py-2 px-4 my-2 border border-solid"
7575
href="https://www.paypal.me/rahuldkjain/10"
7676
rel="noreferrer"
7777
target="_blank"
7878
>
7979
<img
8080
alt="Donate rahuldkjain via paypal"
81-
className="w-6 h-6 mr-2"
82-
src="https://www.vectorlogo.zone/logos/paypal/paypal-ar21.svg"
81+
className="w-32 h-4"
82+
src="https://cdn.worldvectorlogo.com/logos/paypal-2.svg"
8383
/>
84-
Paypal
8584
</a>
8685
<a
8786
className="flex items-center justify-evenly bg-orange-500 text-white py-2 px-4 my-2"

src/components/__tests__/__snapshots__/footer.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ exports[`Footer component renders correctly 1`] = `
157157
</strong>
158158
</div>
159159
<div
160-
class="ml-2 sm:ml-0"
160+
className="ml-2 sm:ml-0"
161161
>
162162
<a
163163
aria-label="Discord of the community"

src/components/__tests__/__snapshots__/markdown.test.js.snap

Lines changed: 230 additions & 210 deletions
Large diffs are not rendered by default.

src/components/__tests__/__snapshots__/markdownPreview.test.js.snap

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`DisplayWork Preview renders correctly 1`] = `
2020
<div
2121
className="my-2"
2222
>
23-
[object Object]
23+
[object Object]
2424
<a
2525
className="no-underline text-blue-700"
2626
href="https://dummy.com"
@@ -35,7 +35,7 @@ exports[`DisplayWork Preview renders correctly with no link 1`] = `
3535
<div
3636
className="my-2"
3737
>
38-
[object Object]
38+
[object Object]
3939
<b>
4040
readme-generator
4141
</b>
@@ -52,7 +52,7 @@ exports[`DisplayWork Preview renders correctly with no project 1`] = `
5252
<div
5353
className="my-2"
5454
>
55-
[object Object]
55+
[object Object]
5656
<a
5757
className="no-underline text-blue-700"
5858
href="https://dummy.com"
@@ -86,7 +86,7 @@ exports[`GithubProfileTrophy Preview renders correctly with show true 1`] = `
8686
<div
8787
className="text-left my-2"
8888
>
89-
89+
9090
<a
9191
href="https://github.com/ryo-ma/github-profile-trophy"
9292
>
@@ -95,7 +95,7 @@ exports[`GithubProfileTrophy Preview renders correctly with show true 1`] = `
9595
src="https://github-profile-trophy.vercel.app/?username="
9696
/>
9797
</a>
98-
98+
9999
</div>
100100
`;
101101

@@ -254,6 +254,7 @@ exports[`Markdown Preview renders correctly 1`] = `
254254
<SkillsPreview
255255
skills={Object {}}
256256
/>
257+
<SupportPreview />
257258
<div
258259
className="block sm:flex sm:justify-center sm:items-start"
259260
>
@@ -287,6 +288,9 @@ exports[`Markdown Preview renders correctly 1`] = `
287288
}
288289
show={false}
289290
/>
291+
<StreakStatsPreview
292+
github=""
293+
/>
290294
</div>
291295
</div>
292296
`;
@@ -313,13 +317,13 @@ exports[`Skills Preview renders correctly 1`] = `
313317
/>
314318
<a
315319
href="https://unity.com/"
320+
key="unity"
316321
rel="noreferrer"
317322
target="_blank"
318323
>
319324
<img
320325
alt="unity"
321326
className="mb-4 mr-4 h-6 w-6 sm:h-10 sm:w-10"
322-
key="unity"
323327
src="https://www.vectorlogo.zone/logos/unity3d/unity3d-icon.svg"
324328
/>
325329
</a>
@@ -338,112 +342,112 @@ exports[`Social Preview renders correctly 1`] = `
338342
/>
339343
<DisplaySocial
340344
base="https://codepen.io"
341-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/codepen.svg"
345+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/codepen.svg"
342346
username="dummy"
343347
/>
344348
<DisplaySocial
345349
base="https://dev.to"
346-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/dev-dot-to.svg"
350+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/devto.svg"
347351
username=""
348352
/>
349353
<DisplaySocial
350354
base="https://twitter.com"
351-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/twitter.svg"
355+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg"
352356
username=""
353357
/>
354358
<DisplaySocial
355359
base="https://linkedin.com/in"
356-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/linkedin.svg"
360+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/linked-in-alt.svg"
357361
username=""
358362
/>
359363
<DisplaySocial
360364
base="https://stackoverflow.com/users"
361-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/stackoverflow.svg"
365+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/stack-overflow.svg"
362366
username=""
363367
/>
364368
<DisplaySocial
365369
base="https://codesandbox.com"
366-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/codesandbox.svg"
370+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/codesandbox.svg"
367371
username=""
368372
/>
369373
<DisplaySocial
370374
base="https://kaggle.com"
371-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/kaggle.svg"
375+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/kaggle.svg"
372376
username=""
373377
/>
374378
<DisplaySocial
375379
base="https://fb.com"
376-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/facebook.svg"
380+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/facebook.svg"
377381
username=""
378382
/>
379383
<DisplaySocial
380384
base="https://instagram.com"
381-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/instagram.svg"
385+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg"
382386
username=""
383387
/>
384388
<DisplaySocial
385389
base="https://dribbble.com"
386-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/dribbble.svg"
390+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/dribbble.svg"
387391
username=""
388392
/>
389393
<DisplaySocial
390394
base="https://www.behance.net"
391-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/behance.svg"
395+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/behance.svg"
392396
username=""
393397
/>
394398
<DisplaySocial
395399
base="https://medium.com"
396-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/medium.svg"
400+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/medium.svg"
397401
username=""
398402
/>
399403
<DisplaySocial
400404
base="https://www.youtube.com/c"
401-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/youtube.svg"
405+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/youtube.svg"
402406
username=""
403407
/>
404408
<DisplaySocial
405409
base="https://www.codechef.com/users"
406-
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codechef.svg"
410+
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.1.0/icons/codechef.svg"
407411
username=""
408412
/>
409413
<DisplaySocial
410-
base="https://codeforces.com/profile"
411-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/codeforces.svg"
414+
base="https://www.hackerrank.com"
415+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/hackerrank.svg"
412416
username=""
413417
/>
414418
<DisplaySocial
415-
base="https://www.hackerrank.com"
416-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/hackerrank.svg"
419+
base="https://codeforces.com/profile"
420+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/codeforces.svg"
417421
username=""
418422
/>
419423
<DisplaySocial
420-
base="https://auth.geeksforgeeks.org/user"
421-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/geeksforgeeks.svg"
424+
base="https://www.leetcode.com"
425+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/leet-code.svg"
422426
username=""
423427
/>
424428
<DisplaySocial
425429
base="https://www.hackerearth.com"
426-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/hackerearth.svg"
430+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/hackerearth.svg"
427431
username=""
428432
/>
429433
<DisplaySocial
430-
base="https://www.topcoder.com/members"
431-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/topcoder.svg"
434+
base="https://auth.geeksforgeeks.org/user"
435+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/geeks-for-geeks.svg"
432436
username=""
433437
/>
434438
<DisplaySocial
435-
base="https://www.leetcode.com"
436-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/leetcode.svg"
439+
base="https://www.topcoder.com/members"
440+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/topcoder.svg"
437441
username=""
438442
/>
439443
<DisplaySocial
440444
base="https://discord.gg"
441-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/discord.svg"
445+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/discord.svg"
442446
username=""
443447
/>
444448
<DisplaySocial
445449
base=""
446-
icon="https://cdn.jsdelivr.net/npm/[email protected]/icons/rss.svg"
450+
icon="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/rss.svg"
447451
username=""
448452
/>
449453
</div>
@@ -498,7 +502,7 @@ exports[`TwitterBadgePreview Preview renders correctly with show true 1`] = `
498502
<div
499503
className="text-left my-2"
500504
>
501-
505+
502506
<a
503507
href="https://twitter.com/\${props.twitter}"
504508
target="blank"
@@ -509,7 +513,7 @@ exports[`TwitterBadgePreview Preview renders correctly with show true 1`] = `
509513
src="https://img.shields.io/twitter/follow/?logo=twitter&style=for-the-badge"
510514
/>
511515
</a>
512-
516+
513517
</div>
514518
`;
515519

@@ -519,13 +523,13 @@ exports[`VisitorsBadge Preview renders correctly with show true 1`] = `
519523
<div
520524
className="text-left my-2"
521525
>
522-
526+
523527
<img
524528
alt=""
525529
className="h-4 sm:h-6"
526530
src="https://komarev.com/ghpvc/?username=&label=Profile%20views&color=0e75b6&style=flat"
527531
/>
528-
532+
529533
</div>
530534
`;
531535

src/components/__tests__/__snapshots__/skills.test.js.snap

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,19 @@ exports[`Skills renders correctly 1`] = `
5050
key="javascript"
5151
>
5252
<label
53-
className="skillCheckboxLabel cursor-pointer flex items-center justify-start"
53+
className="checkbox-label flex items-center justify-start"
5454
htmlFor="javascript"
5555
>
5656
<input
5757
checked={true}
58+
className="checkbox-label__input"
5859
id="javascript"
5960
onChange={[Function]}
6061
type="checkbox"
6162
/>
63+
<span
64+
class="checkbox-label__control"
65+
/>
6266
<img
6367
alt="javascript"
6468
className="ml-4 w-8 h-8 sm:w-10 sm:h-10"
@@ -90,14 +94,18 @@ exports[`Skills renders correctly 1`] = `
9094
key="react"
9195
>
9296
<label
93-
className="skillCheckboxLabel cursor-pointer flex items-center justify-start"
97+
className="checkbox-label flex items-center justify-start"
9498
htmlFor="react"
9599
>
96100
<input
101+
className="checkbox-label__input"
97102
id="react"
98103
onChange={[Function]}
99104
type="checkbox"
100105
/>
106+
<span
107+
class="checkbox-label__control"
108+
/>
101109
<img
102110
alt="react"
103111
className="ml-4 w-8 h-8 sm:w-10 sm:h-10"
@@ -115,14 +123,18 @@ exports[`Skills renders correctly 1`] = `
115123
key="svelte"
116124
>
117125
<label
118-
className="skillCheckboxLabel cursor-pointer flex items-center justify-start"
126+
className="checkbox-label flex items-center justify-start"
119127
htmlFor="svelte"
120128
>
121129
<input
130+
className="checkbox-label__input"
122131
id="svelte"
123132
onChange={[Function]}
124133
type="checkbox"
125134
/>
135+
<span
136+
class="checkbox-label__control"
137+
/>
126138
<img
127139
alt="svelte"
128140
className="ml-4 w-8 h-8 sm:w-10 sm:h-10"

src/components/addons.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ const AddonsItem = ({ inputId, inputChecked, onInputChange, Options, onIconClick
1212
return (
1313
<>
1414
<div className="py-2 flex justify-start items-center text-sm sm:text-lg">
15-
<label htmlFor={inputId} className="cursor-pointer flex items-center">
15+
<label htmlFor={inputId} className="checkbox-label flex items-center">
1616
<input
17-
type="checkbox"
1817
id={inputId}
18+
type="checkbox"
19+
className="checkbox-label__input"
1920
checked={inputChecked}
2021
onChange={onInputChange}
2122
/>
23+
<span class="checkbox-label__control" />
2224
<span className="pl-4">{props.children}</span>
2325
</label>
2426
{Options && (
@@ -155,13 +157,15 @@ const CustomizeGithubStatsBase = ({ prefix, options, onUpdate }) =>
155157
onChange={(e) => onUpdate('bgColor', e.target.value.replace('#', ''))}
156158
/>
157159
</label>
158-
<label htmlFor={`${prefix}-hide-border`}>Hide border:&nbsp;
160+
<label htmlFor={`${prefix}-hide-border`} className="checkbox-label">Hide border:&nbsp;
159161
<input
160162
id={`${prefix}-hide-border`}
161163
type="checkbox"
164+
className="checkbox-label__input"
162165
checked={options.hideBorder}
163166
onChange={(e) => onUpdate('hideBorder', e.target.checked)}
164167
/>
168+
<span class="checkbox-label__control" />
165169
</label>
166170
<label htmlFor={`${prefix}-cache-seconds`}>Cache Seconds:&nbsp;
167171
<input

0 commit comments

Comments
 (0)