Skip to content

Commit a20d9c3

Browse files
committed
Trying a different approach
Trying a different approach
1 parent 2848687 commit a20d9c3

File tree

2 files changed

+63
-74
lines changed

2 files changed

+63
-74
lines changed

components/Information.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

components/StyledMarkdown.tsx

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -316,48 +316,87 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
316316
)
317317
}
318318
},
319-
Infobox: {
319+
Warning: {
320320
component: ({ children, label }) => {
321321
return (
322-
323-
<Information label={label} iconSrc='/icons/info-blue.svg' bgColor='blue' textColor='black'>
324-
{children}
325-
</Information>
326-
322+
<BlockContext.Provider value={BlockContextValue.Information}>
323+
<div className='my-2'>
324+
{label && (
325+
<div className='bg-orange-100 inline-block text-sm rounded-t-lg px-6 py-1 text-orange-600'>
326+
{label}
327+
</div>
328+
)}
329+
<div className='flex flex-row items-center mb-6 bg-orange-50 px-6 py-4 border border-orange-100 rounded text-slate-600 leading-7'>
330+
<img src='/icons/warning.svg' className='h-7 w-7 mr-3' alt="" />
331+
<div className='font'>
332+
{children}
333+
</div>
334+
</div>
335+
</div>
336+
</BlockContext.Provider>
327337
)
328338
}
329339
},
330-
331-
Tip: {
340+
Infobox: {
332341
component: ({ children, label }) => {
333342
return (
334-
335-
<Information label={label} iconSrc='/icons/bulb.svg' bgColor='green' textColor='black'>
336-
{children}
337-
</Information>
338-
343+
<BlockContext.Provider value={BlockContextValue.Information}>
344+
<div className='my-2'>
345+
{label && (
346+
<div className='bg-blue-100 inline-block text-sm rounded-t-lg px-6 py-1 text-blue-600'>
347+
{label}
348+
</div>
349+
)}
350+
<div className='flex flex-row items-center mb-6 bg-blue-50 px-6 py-4 border border-blue-100 rounded text-slate-600 leading-7'>
351+
<img src='/icons/info-blue.svg' className='h-7 w-7 mr-3' alt="" />
352+
<div className='font'>
353+
{children}
354+
</div>
355+
</div>
356+
</div>
357+
</BlockContext.Provider>
339358
)
340359
}
341360
},
342-
Warning: {
361+
Tip: {
343362
component: ({ children, label }) => {
344363
return (
345-
346-
<Information label={label} iconSrc='/icons/info-yellow.svg' bgColor='amber' textColor='black'>
347-
{children}
348-
</Information>
349-
364+
<BlockContext.Provider value={BlockContextValue.Information}>
365+
<div className='my-2'>
366+
{label && (
367+
<div className='bg-green-100 inline-block text-sm rounded-t-lg px-6 py-1 text-green-600'>
368+
{label}
369+
</div>
370+
)}
371+
<div className='flex flex-row items-center mb-6 bg-green-50 px-6 py-4 border border-green-100 rounded text-slate-600 leading-7'>
372+
<img src='/icons/bulb.svg' className='h-7 w-7 mr-3' alt="" />
373+
<div className='font'>
374+
{children}
375+
</div>
376+
</div>
377+
</div>
378+
</BlockContext.Provider>
350379
)
351380
}
352381
},
353382
Danger: {
354383
component: ({ children, label }) => {
355384
return (
356-
357-
<Information label={label} iconSrc='/icons/warning.svg' bgColor='red' textColor='black' >
358-
{children}
359-
</Information>
360-
385+
<BlockContext.Provider value={BlockContextValue.Information}>
386+
<div className='my-2'>
387+
{label && (
388+
<div className='bg-red-100 inline-block text-sm rounded-t-lg px-6 py-1 text-red-600'>
389+
{label}
390+
</div>
391+
)}
392+
<div className='flex flex-row items-center mb-6 bg-red-50 px-6 py-4 border border-red-100 rounded text-slate-600 leading-7'>
393+
<img src='/icons/info-yellow.svg' className='h-7 w-7 mr-3' alt="" />
394+
<div className='font'>
395+
{children}
396+
</div>
397+
</div>
398+
</div>
399+
</BlockContext.Provider>
361400
)
362401
}
363402
},

0 commit comments

Comments
 (0)