fix major markdown bug

This commit is contained in:
Hristo Nedelkov 2024-01-25 19:56:08 +02:00
parent 845c6bae58
commit 29049e951f
4 changed files with 40 additions and 14 deletions

View File

@ -1,13 +1,20 @@
import ReactMarkdown from 'react-markdown' import ReactMarkdown from 'react-markdown'
import styles from './../../../pages/ValidatorOnboarding/ValidatorSetup/ValidatorInstalling/InstallLayout.module.css'
import MarkdownLink from './MarkdownLink' import MarkdownLink from './MarkdownLink'
type MarkdownProps = { type MarkdownProps = {
children: string children: string
} }
const Markdown = ({ children }: MarkdownProps) => { const Markdown = ({ children }: MarkdownProps) => {
return <ReactMarkdown children={children} components={{ a: MarkdownLink }} /> return (
<ReactMarkdown
children={children}
components={{ a: MarkdownLink }}
className={styles['markdown-text']}
/>
)
} }
export default Markdown export default Markdown

View File

@ -1,4 +1,4 @@
.osCardsContainer { .os-cards-container {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
display: grid; display: grid;
@ -7,36 +7,54 @@
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
} }
.osCard { .os-card {
border: 1px solid rgba(0, 0, 0, 0.15); border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 16px; border-radius: 16px;
padding: 12px 16px; padding: 12px 16px;
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
} }
.markdown-text {
overflow-x: auto;
.osCardSelected { width: 90%;
}
.os-card-selected {
background-color: #2a4af50d; background-color: #2a4af50d;
border: 1px solid #2a4af566; border: 1px solid #2a4af566;
border-radius: 16px;
padding: 12px 16px;
cursor: pointer;
box-sizing: border-box;
} }
@media (max-width: 1000px) { @media (max-width: 1000px) {
.osCardsContainer { .os-cards-container {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
.osCard:nth-child(3) { .os-card:nth-child(3) {
width: 205%; width: 205%;
} }
} }
@media (max-width: 750px) { @media (max-width: 850px) {
.osCardsContainer { .os-cards-container {
grid-template-columns: repeat(1, 1fr); grid-template-columns: repeat(1, 1fr);
} }
.osCard { .os-card {
width: 100%; width: 100%;
} }
.osCard:nth-child(3) { .os-card:nth-child(3) {
width: 100%; width: 100%;
} }
} }
@media (max-width: 750px) {
.os-cards-container {
grid-template-columns: repeat(1, 0.9fr);
}
}
@media (max-width: 650px) {
.os-cards-container {
grid-template-columns: repeat(1, 0.7fr);
}
}

View File

@ -14,11 +14,11 @@ type OSCardsProps = {
} }
const OSCards = ({ selectedOS, handleOSCardClick }: OSCardsProps) => { const OSCards = ({ selectedOS, handleOSCardClick }: OSCardsProps) => {
return ( return (
<div className={styles.osCardsContainer}> <div className={styles['os-cards-container']}>
{cards.map(card => ( {cards.map(card => (
<div <div
key={card.name} key={card.name}
className={`${styles.osCard} ${selectedOS === card.name ? styles.osCardSelected : ''}`} className={selectedOS === card.name ? styles['os-card-selected'] : styles['os-card']}
onClick={() => handleOSCardClick(card.name)} onClick={() => handleOSCardClick(card.name)}
> >
<OSCard key={card.name} icon={card.icon} name={card.name} /> <OSCard key={card.name} icon={card.icon} name={card.name} />

View File

@ -38,6 +38,7 @@ const ValidatorSetupInstall = () => {
<Stack> <Stack>
<Markdown children={DOCUMENTATIONS[selectedClient].general} /> <Markdown children={DOCUMENTATIONS[selectedClient].general} />
<OSCards selectedOS={selectedOS} handleOSCardClick={handleOSCardClick} /> <OSCards selectedOS={selectedOS} handleOSCardClick={handleOSCardClick} />
<Markdown children={DOCUMENTATIONS[selectedClient].documentation[selectedOS]} /> <Markdown children={DOCUMENTATIONS[selectedClient].documentation[selectedOS]} />
</Stack> </Stack>
</YStack> </YStack>