Skip to content

Commit 80aa29a

Browse files
committed
feat: change title
1 parent 2650483 commit 80aa29a

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

all-meetups.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,6 @@
7171
"meetupId": 18,
7272
"meetupTitle": "Vue / Tailwind / OpenData"
7373
},
74-
{
75-
"meetupDate": "2016-07-30",
76-
"sessionDetails": [],
77-
"sponsorsDetails": [
78-
{
79-
"logo": "https://directus.frontend.mu/assets/a72a156c-05ba-41ff-8cde-f9c5c99cb98b.png",
80-
"name": "Extension Interactive",
81-
"darkbg": false,
82-
"venue": "Extension Interactive"
83-
}
84-
],
85-
"meetupId": 19,
86-
"meetupTitle": "#1 Front-End Mauritius Meetup July 2016"
87-
},
8874
{
8975
"meetupDate": "2016-07-30",
9076
"sessionDetails": [

src/Root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import './style.css';
44
import allMeetups from '../all-meetups.json';
55

66

7-
// a function that only allows a-z, A-Z, 0-9, CJK, but no spaces
7+
// a function that only allows a-z, A-Z, 0-9, CJK, but replace spaces with - and remove multiple -
88
function removeSpecialChars(str: string) {
9-
return str.replace(/[^a-zA-Z0-9\u4E00-\u9FFF]/g, '');
9+
return str.replace(/[^a-zA-Z0-9\u4E00-\u9FFF]/g, '-').replace(/-+/g, '-');
1010
}
1111

1212
export const RemotionRoot: React.FC = () => {
@@ -15,7 +15,7 @@ export const RemotionRoot: React.FC = () => {
1515
{allMeetups.map((meetup) => (
1616
<Composition
1717
key={meetup.meetupId}
18-
id={removeSpecialChars(meetup.meetupTitle)}
18+
id={removeSpecialChars(meetup.meetupDate + '-' + meetup.meetupTitle)}
1919
component={MeetupVideo}
2020
defaultProps={
2121
{

0 commit comments

Comments
 (0)