Skip to content

Commit 49ffb64

Browse files
Merge pull request #142 from kamranahmedse/develop
Create a new pull request by comparing changes across two branches
2 parents 9c668b9 + a14d8b5 commit 49ffb64

File tree

198 files changed

+392
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+392
-51
lines changed

public/pdfs/roadmaps/ios.pdf

421 KB
Binary file not shown.

public/roadmaps/ios.png

672 KB

readme.md

Lines changed: 2 additions & 0 deletions

src/components/EditorRoadmap/EditorRoadmapRenderer.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { useToast } from '../../hooks/use-toast';
1212
import type { Edge, Node } from 'reactflow';
1313
import { Renderer } from '../../../editor/renderer';
1414
import { slugify } from '../../lib/slugger';
15+
import { isLoggedIn } from '../../lib/jwt';
16+
import { showLoginPopup } from '../../lib/popup';
1517

1618
export type RoadmapRendererProps = {
1719
resourceId: string;
@@ -104,13 +106,23 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
104106

105107
if (e.shiftKey) {
106108
e.preventDefault();
109+
if (!isLoggedIn()) {
110+
showLoginPopup();
111+
return;
112+
}
113+
107114
updateTopicStatus(
108115
nodeId,
109116
isCurrentStatusLearning ? 'pending' : 'learning',
110117
);
111118
return;
112119
} else if (e.altKey) {
113120
e.preventDefault();
121+
if (!isLoggedIn()) {
122+
showLoginPopup();
123+
return;
124+
}
125+
114126
updateTopicStatus(nodeId, isCurrentStatusSkipped ? 'pending' : 'skipped');
115127
return;
116128
}
@@ -143,6 +155,10 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
143155
return;
144156
}
145157

158+
if (!isLoggedIn()) {
159+
showLoginPopup();
160+
return;
161+
}
146162
const isCurrentStatusDone = targetGroup?.classList.contains('done');
147163
updateTopicStatus(nodeId, isCurrentStatusDone ? 'pending' : 'done');
148164
}, []);

src/components/GenerateRoadmap/GenerateRoadmap.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,14 @@ import { Ban, Cog, Download, PenSquare, Save, Wand } from 'lucide-react';
2525
import { ShareRoadmapButton } from '../ShareRoadmapButton.tsx';
2626
import { httpGet, httpPost } from '../../lib/http.ts';
2727
import { pageProgressMessage } from '../../stores/page.ts';
28-
import {
29-
deleteUrlParam,
30-
getUrlParams,
31-
setUrlParams,
32-
} from '../../lib/browser.ts';
28+
import { deleteUrlParam, getUrlParams } from '../../lib/browser.ts';
3329
import { downloadGeneratedRoadmapImage } from '../../helper/download-image.ts';
3430
import { showLoginPopup } from '../../lib/popup.ts';
3531
import { cn } from '../../lib/classname.ts';
3632
import { RoadmapTopicDetail } from './RoadmapTopicDetail.tsx';
3733
import { AIRoadmapAlert } from './AIRoadmapAlert.tsx';
38-
import { OpenAISettings } from './OpenAISettings.tsx';
3934
import { IS_KEY_ONLY_ROADMAP_GENERATION } from '../../lib/ai.ts';
4035
import { AITermSuggestionInput } from './AITermSuggestionInput.tsx';
41-
import { useParams } from '../../hooks/use-params.ts';
4236
import { IncreaseRoadmapLimit } from './IncreaseRoadmapLimit.tsx';
4337
import { AuthenticationForm } from '../AuthenticationFlow/AuthenticationForm.tsx';
4438

src/components/GenerateRoadmap/RoadmapSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
4242
setIsAuthenticatedUser(isLoggedIn());
4343
}, []);
4444

45-
const randomTerms = ['OAuth', 'APIs', 'UX Design', 'gRPC'];
45+
const randomTerms = ['OAuth', 'UI / UX', 'SRE', 'DevRel'];
4646

4747
return (
4848
<div className="flex flex-grow flex-col items-center px-4 py-6 sm:px-6 md:my-24 lg:my-32">

src/components/Navigation/Navigation.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import { AccountDropdown } from './AccountDropdown';
1717
</a>
1818

1919
<a
20-
href='/ai'
20+
href='/teams'
2121
class='group inline sm:hidden relative !mr-2 text-blue-300 hover:text-white'
2222
>
23-
AI Roadmaps&nbsp;
23+
Teams
2424

2525
<span class='absolute -right-[11px] top-0'>
2626
<span class='relative flex h-2 w-2'>

src/components/OnboardingNudge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function OnboardingNudge(props: OnboardingNudgeProps) {
3333
return (
3434
<div
3535
className={cn(
36-
'fixed left-0 right-0 top-0 z-[91] flex w-full items-center justify-center bg-yellow-300 border-b border-b-yellow-500/30 py-1.5',
36+
'fixed left-0 right-0 top-0 z-[91] flex w-full items-center justify-center bg-yellow-300 border-b border-b-yellow-500/30 pt-1.5 pb-2',
3737
{
3838
'striped-loader': isLoading,
3939
},

src/components/Roadmaps/RoadmapsPage.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ const groups: GroupType[] = [
232232
link: '/android',
233233
type: 'role',
234234
},
235+
{
236+
title: 'iOS',
237+
link: '/ios',
238+
type: 'role',
239+
},
235240
{
236241
title: 'React Native',
237242
link: '/react-native',

src/components/TopicDetail/TopicDetail.tsx

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type {
2323
} from '../CustomRoadmap/CustomRoadmap';
2424
import { markdownToHtml, sanitizeMarkdown } from '../../lib/markdown';
2525
import { cn } from '../../lib/classname';
26-
import { Ban, FileText, X } from 'lucide-react';
26+
import { Ban, FileText, HeartHandshake, X } from 'lucide-react';
2727
import { getUrlParams } from '../../lib/browser';
2828
import { Spinner } from '../ReactIcons/Spinner';
2929
import { GitHubIcon } from '../ReactIcons/GitHubIcon.tsx';
@@ -58,6 +58,7 @@ export function TopicDetail(props: TopicDetailProps) {
5858
const [isContributing, setIsContributing] = useState(false);
5959
const [error, setError] = useState('');
6060
const [topicHtml, setTopicHtml] = useState('');
61+
const [hasContent, setHasContent] = useState(false);
6162
const [topicTitle, setTopicTitle] = useState('');
6263
const [topicHtmlTitle, setTopicHtmlTitle] = useState('');
6364
const [links, setLinks] = useState<RoadmapContentDocument['links']>([]);
@@ -177,6 +178,9 @@ export function TopicDetail(props: TopicDetailProps) {
177178

178179
const titleElem: HTMLElement = topicDom.querySelector('h1')!;
179180

181+
const otherElems = topicDom.querySelectorAll('body > *:not(h1, div)');
182+
183+
setHasContent(otherElems.length > 0);
180184
setContributionUrl(contributionUrl);
181185
setHasEnoughLinks(links.length >= 3);
182186
setTopicHtmlTitle(titleElem?.textContent || '');
@@ -187,6 +191,8 @@ export function TopicDetail(props: TopicDetailProps) {
187191
const sanitizedMarkdown = sanitizeMarkdown(
188192
(response as RoadmapContentDocument).description || '',
189193
);
194+
195+
setHasContent(sanitizedMarkdown?.length > 0);
190196
topicHtml = markdownToHtml(sanitizedMarkdown, false);
191197
}
192198

@@ -207,7 +213,6 @@ export function TopicDetail(props: TopicDetailProps) {
207213
return null;
208214
}
209215

210-
const hasContent = topicHtml?.length > 0 || links?.length > 0 || topicTitle;
211216
const resourceTitleForSearch = resourceTitle
212217
?.toLowerCase()
213218
?.replace(/\s+?roadmap/gi, '');
@@ -225,7 +230,7 @@ export function TopicDetail(props: TopicDetailProps) {
225230
className="fixed right-0 top-0 z-40 flex h-screen w-full flex-col overflow-y-auto bg-white p-4 focus:outline-0 sm:max-w-[600px] sm:p-6"
226231
>
227232
{isLoading && (
228-
<div className="flex w-full h-full items-center justify-center">
233+
<div className="flex h-full w-full items-center justify-center">
229234
<Spinner
230235
outerFill="#d1d5db"
231236
className="h-6 w-6 sm:h-8 sm:w-8"
@@ -242,7 +247,11 @@ export function TopicDetail(props: TopicDetailProps) {
242247
<div className="mb-2">
243248
{!isEmbed && (
244249
<TopicProgressButton
245-
topicId={topicId}
250+
topicId={
251+
topicId.indexOf('@') !== -1
252+
? topicId.split('@')[1]
253+
: topicId
254+
}
246255
resourceId={resourceId}
247256
resourceType={resourceType}
248257
onClose={() => {
@@ -265,20 +274,48 @@ export function TopicDetail(props: TopicDetailProps) {
265274

266275
{/* Topic Content */}
267276
{hasContent ? (
268-
<div className="prose prose-quoteless prose-h1:mb-2.5 prose-h1:mt-7 prose-h1:text-balance prose-h2:mb-3 prose-h2:mt-0 prose-h3:mb-[5px] prose-h3:mt-[10px] prose-p:mb-2 prose-p:mt-0 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-700 prose-li:m-0 prose-li:mb-0.5">
269-
{topicTitle && <h1>{topicTitle}</h1>}
270-
<div
271-
id="topic-content"
272-
dangerouslySetInnerHTML={{ __html: topicHtml }}
273-
/>
274-
</div>
277+
<>
278+
<div className="prose prose-quoteless prose-h1:mb-2.5 prose-h1:mt-7 prose-h1:text-balance prose-h2:mb-3 prose-h2:mt-0 prose-h3:mb-[5px] prose-h3:mt-[10px] prose-p:mb-2 prose-p:mt-0 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-700 prose-li:m-0 prose-li:mb-0.5">
279+
{topicTitle && <h1>{topicTitle}</h1>}
280+
<div
281+
id="topic-content"
282+
dangerouslySetInnerHTML={{ __html: topicHtml }}
283+
/>
284+
</div>
285+
</>
275286
) : (
276-
<div className="flex h-[calc(100%-38px)] flex-col items-center justify-center">
277-
<FileText className="h-16 w-16 text-gray-300" />
278-
<p className="mt-2 text-lg font-medium text-gray-500">
279-
Empty Content
280-
</p>
281-
</div>
287+
<>
288+
{!canSubmitContribution && (
289+
<div className="flex h-[calc(100%-38px)] flex-col items-center justify-center">
290+
<FileText className="h-16 w-16 text-gray-300" />
291+
<p className="mt-2 text-lg font-medium text-gray-500">
292+
Empty Content
293+
</p>
294+
</div>
295+
)}
296+
{canSubmitContribution && (
297+
<div className="mx-auto flex h-[calc(100%-38px)] max-w-[400px] flex-col items-center justify-center text-center">
298+
<HeartHandshake className="mb-2 h-16 w-16 text-gray-300" />
299+
<p className="text-lg font-semibold text-gray-900">
300+
Help us write this content
301+
</p>
302+
<p className="mb-3 mt-2 text-sm text-gray-500">
303+
Write a brief introduction to this topic and submit a
304+
link to a good article, podcast, video, or any other
305+
self-vetted resource that helped you understand this
306+
topic better.
307+
</p>
308+
<a
309+
href={contributionUrl}
310+
target={'_blank'}
311+
className="flex w-full items-center justify-center rounded-md bg-gray-800 p-2 text-sm text-white transition-colors hover:bg-black hover:text-white disabled:bg-green-200 disabled:text-black"
312+
>
313+
<GitHubIcon className="mr-2 inline-block h-4 w-4 text-white" />
314+
Edit this Content
315+
</a>
316+
</div>
317+
)}
318+
</>
282319
)}
283320

284321
{links.length > 0 && (
@@ -313,8 +350,7 @@ export function TopicDetail(props: TopicDetailProps) {
313350
<div className="mb-12 mt-3 border-t text-sm text-gray-400">
314351
<div className="mb-4 mt-3">
315352
<p className="">
316-
Can't find what you're looking for? Try these pre-filled
317-
search queries:
353+
Find more resources using these pre-filled search queries:
318354
</p>
319355
<div className="mt-3 flex gap-2 text-gray-700">
320356
<a

0 commit comments

Comments
 (0)