Skip to content

Commit

Permalink
Fixed UI for Proposal List Display and Ui for links in full proposal …
Browse files Browse the repository at this point in the history
…display
  • Loading branch information
ashutoshpw committed Jun 14, 2024
1 parent 03c203b commit b15f860
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
13 changes: 10 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ a {
z-index: 1000000;
}

[data-rsbs-overlay], [data-rsbs-root]:after {
[data-rsbs-overlay],
[data-rsbs-root]:after {
background: #1C1F23;
z-index: 1000001;
max-height: 90vh;
Expand All @@ -24,7 +25,7 @@ a {

/* Hide scrollbar for IE, Edge and Firefox */
* {
scrollbar-width: none;
scrollbar-width: none;
}

/* width */
Expand All @@ -47,4 +48,10 @@ a {
/* Handle on hover */
/* ::-webkit-scrollbar-thumb:hover {
background: #4a5055;
} */
} */
.proposal-details a {
color: #80bcf4;
}
.proposal-details a:hover {
border-bottom: 1px solid #80bcf4;
}
3 changes: 2 additions & 1 deletion src/modules/explorer/components/ProposalsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export const ProposalsList: React.FC<Props> = ({
}) => {
const [currentPage, setCurrentPage] = useState(0)
const [offset, setOffset] = useState(0)
const [open, setopen] = useState(true)
const [filteredProposals, setFilteredProposals] = useState<ProposalObj[]>([])
// TODO: next two lines can be safely removed
const [filter, setFilter] = useState<number>(0)
const [filterOnchain, setFilterOnchain] = useState<string>()
const [isLoading, setIsLoading] = useState(false)
Expand Down Expand Up @@ -133,6 +133,7 @@ export const ProposalsList: React.FC<Props> = ({
[]
)

// TODO: this can be probably removed as not in use
const orderedList = (state: Order) => {
if (state === "recent") {
return listOfProposals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const ProposalDetailCard: React.FC<{ poll: Poll | undefined; daoId: strin
</Grid>

<Grid container>
<Typography variant="body2" color="textPrimary">
<Typography variant="body2" color="textPrimary" className="proposal-details">
{ReactHtmlParser(poll?.description ? poll?.description : "")}
</Typography>
</Grid>
Expand Down
15 changes: 12 additions & 3 deletions src/modules/lite/explorer/components/ProposalTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ const DescriptionText = styled(Typography)(({ theme }) => ({
}
}))

const stripHtmlTags = (input: string) => {
const div = document.createElement("div")
div.innerHTML = input
return div.textContent || div.innerText || ""
}

export const ProposalTableRow: React.FC<{ poll: Poll | any; daoId?: string }> = ({ poll, daoId }) => {
const navigate = useHistory()
const theme = useTheme()
const isMobile = useMediaQuery(theme.breakpoints.down("xs"))
const isMobileSmall = useMediaQuery(theme.breakpoints.down("sm"))

return (
<RowContainer
style={{ background: "#2F3438", borderRadius: 8 }}
Expand All @@ -55,11 +60,15 @@ export const ProposalTableRow: React.FC<{ poll: Poll | any; daoId?: string }> =
>
<Grid container item style={{ gap: 16 }} xs={12} md={12} justifyContent={isMobile ? "center" : "flex-start"}>
<Title color="textPrimary" align={isMobile ? "center" : "left"}>
{poll.name}
{poll.name.length > 100 ? poll.name.slice(0, 100) + "..." : poll.name}
</Title>

<Grid container direction="row">
<DescriptionText>{ReactHtmlParser(poll.description)}</DescriptionText>
<DescriptionText>
{poll.description.length > 200
? stripHtmlTags(poll.description).slice(0, 200) + "..."
: ReactHtmlParser(poll.description)}
</DescriptionText>
</Grid>

<Grid
Expand Down

0 comments on commit b15f860

Please sign in to comment.