Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

Commit 2fd7cd1

Browse files
authored
Merge pull request #437 from 30-seconds/deprecate-expertise
Deprecate expertise
2 parents 161cf50 + 6e4031a commit 2fd7cd1

File tree

17 files changed

+52
-145
lines changed

17 files changed

+52
-145
lines changed

package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blocks/extractor/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ export class Extractor {
298298
title,
299299
shortTitle = title,
300300
tags: rawTags,
301-
expertise,
302301
type: rawType,
303302
excerpt,
304303
cover,
@@ -426,7 +425,6 @@ export class Extractor {
426425
title,
427426
shortTitle,
428427
tags,
429-
expertise,
430428
firstSeen,
431429
lastUpdated,
432430
listed: unlisted === true ? false : true,

src/blocks/models/snippet.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ export const snippet = {
2222
uniqueValues: true,
2323
},
2424
},
25-
{
26-
name: 'expertise',
27-
type: 'enum',
28-
values: ['beginner', 'intermediate', 'advanced'],
29-
},
3025
{ name: 'shortTitle', type: 'string' },
3126
{ name: 'firstSeen', type: 'dateRequired' },
3227
{ name: 'lastUpdated', type: 'dateRequired' },

src/blocks/serializers/listingPreviewSerializer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const listingPreviewSerializer = {
1111
searchResultTag: (listing, { withSearch } = {}) =>
1212
withSearch ? literals.snippetCollectionShort : undefined,
1313
url: listing => `${listing.slugPrefix}/p/1`,
14+
type: () => 'collection',
1415
},
1516
attributes: [
1617
['shortName', 'title'],
@@ -20,5 +21,6 @@ export const listingPreviewSerializer = {
2021
'tags',
2122
'searchTokens',
2223
'searchResultTag',
24+
'type',
2325
],
2426
};

src/blocks/serializers/snippetContextSerializer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const snippetContextSerializer = {
4949
'url',
5050
'slug',
5151
['dateFormatted', 'date'],
52-
'expertise',
5352
'icon',
5453
['formattedTags', 'tags'],
5554
'actionType',

src/blocks/serializers/snippetPreviewSerializer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const snippetPreviewSerializer = {
1010
if (!withSearch) return undefined;
1111
return snippet.shortTitle;
1212
},
13+
type: () => 'snippet',
1314
},
1415
attributes: [
1516
'title',
@@ -20,6 +21,6 @@ export const snippetPreviewSerializer = {
2021
['formattedPreviewTags', 'tags'],
2122
'searchTokens',
2223
'searchResultTag',
23-
'expertise',
24+
'type',
2425
],
2526
};

src/components/atoms/card/index.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import { memo } from 'react';
22

33
// Icon
4-
export const CardIcon = memo(({ icon, expertise }) => (
4+
export const CardIcon = memo(({ icon, type }) => (
55
<div
66
className={`card-icon relative inline-block ${
7-
expertise ? 'br-round' : 'br-xl'
7+
type === 'snippet' ? 'br-round' : 'br-xl'
88
} icon icon-${icon} before:fs-lg mt-1`}
9-
>
10-
{Boolean(expertise) && (
11-
<span className={`expertise box-border br-round ${expertise}`} />
12-
)}
13-
</div>
9+
/>
1410
));
1511

1612
CardIcon.displayName = 'CardIcon';

0 commit comments

Comments
 (0)