Skip to content

Commit

Permalink
markdown render fixes (solana-labs#1454)
Browse files Browse the repository at this point in the history
* markdown render fix

* links in my proposal page

* fix
  • Loading branch information
abrzezinski94 authored Mar 8, 2023
1 parent 70c9af7 commit 329b0c9
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pages/dao/[symbol]/proposal/components/MyProposalsBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
SequenceType,
txBatchesToInstructionSetWithSigners,
} from '@utils/sendTransactions'
import useQueryContext from '@hooks/useQueryContext'

const MyProposalsBn = () => {
const [modalIsOpen, setModalIsOpen] = useState(false)
Expand Down Expand Up @@ -483,6 +484,8 @@ const ProposalList = ({
proposals: ProgramAccount<Proposal>[]
isLoading: boolean
}) => {
const { fmtUrlWithCluster } = useQueryContext()
const { symbol } = useRealm()
return (
<>
{' '}
Expand Down Expand Up @@ -516,7 +519,16 @@ const ProposalList = ({
className="text-xs border-fgd-4 border px-3 py-2 mb-3 rounded-lg"
key={x.pubkey.toBase58()}
>
{x.account.name}
<a
className="underline cursor-pointer"
href={fmtUrlWithCluster(
`/dao/${symbol}/proposal/${x.pubkey.toBase58()}`
)}
target="_blank"
rel="noreferrer"
>
{x.account.name}
</a>
</div>
))}
</div>
Expand Down
82 changes: 82 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,88 @@ tbody {
@apply block mb-2 text-sm;
}

.markdown table {
margin: 10px 0;
border: 1px solid #ccc;
@apply border-bkg-4;
border-collapse: collapse;
padding: 0;
width: 100%;
table-layout: fixed;
}

table caption {
font-size: 1.5em;
margin: 0.5em 0 0.75em;
}

table tr {
border: 1px solid #ddd;
@apply border-bkg-4;
padding: 0.35em;
}

table th,
table td {
padding: 0.625em;
text-align: center;
}

table th {
font-size: 0.85em;
letter-spacing: 0.1em;
text-transform: uppercase;
}

@media screen and (max-width: 600px) {
table {
border: 0;
}

table caption {
font-size: 1.3em;
}

table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}

table tr {
border-bottom: 3px solid #ddd;
display: block;
margin-bottom: 0.625em;
}

table td {
border-bottom: 1px solid #ddd;
display: block;
font-size: 0.8em;
text-align: right;
}

table td::before {
/*
* aria-label has no advantage, it won't be read inside a table
content: attr(aria-label);
*/
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}

table td:last-child {
border-bottom: 0;
}
}

:placeholder-shown {
@apply font-body;
}
Expand Down

0 comments on commit 329b0c9

Please sign in to comment.