Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Dec 13, 2024
1 parent 02d42d2 commit ffddc21
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 49 deletions.
10 changes: 5 additions & 5 deletions components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ const SubMenu = () => {
href: '/news-media',
umami: 'navigation-news-media',
},
// {
// label: <FormattedMessage id="Navbar.HumanRights" />,
// href: '/human-rights',
// umami: 'navigation-human-rights',
// },
{
label: <FormattedMessage id="Navbar.Circumvention" />,
href: '/circumvention',
umami: 'navigation-circumvention',
},
// {
// label: <FormattedMessage id="Navbar.HumanRights" />,
// href: '/human-rights',
// umami: 'navigation-human-rights',
// },
{
label: <FormattedMessage id="Navbar.Domains" />,
href: '/domains',
Expand Down
79 changes: 35 additions & 44 deletions pages/human-rights.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import ChartWrapper from 'components/ChartWrapper'
import Form from 'components/domain/Form'
import FindingsSection from 'components/FindingsSection'
import ReportsSection from 'components/ReportsSection'
import {
StickySubMenuUpdated,
StyledStickySubMenu,
} from 'components/SharedStyledComponents'
import { getCountries, getReports } from 'lib/api'
import { useRouter } from 'next/router'
import { useIntl } from 'react-intl'

import ThematicPage from 'components/ThematicPage'
import { getCountries, getReports } from 'lib/api'

export const getServerSideProps = async () => {
try {
const reports = await getReports('theme-human_rights')
Expand Down Expand Up @@ -39,7 +33,7 @@ const HUMAN_RIGHTS_DOMAINS = [
'www.fidh.org',
]

const HumanRights = ({ countries, reports }) => {
const HumanRights = (props) => {
const intl = useIntl()
const router = useRouter()
const { query } = router
Expand All @@ -66,41 +60,38 @@ const HumanRights = ({ countries, reports }) => {
}
}

const domains = HUMAN_RIGHTS_DOMAINS.sort((a, b) => {
return a.replace('www.', '').localeCompare(b.replace('www.', ''))
})

return (
<div className="container">
<StickySubMenuUpdated
topClass="top-[116px]"
title={intl.formatMessage({ id: 'Navbar.HumanRights' })}
menu={
<>
<a href="#findings">Findings</a>
<a href="#reports">Reports</a>
<a href="#websites">Websites</a>
</>
}
/>
<FindingsSection
title="Findings on blocking Human Rights websites"
theme="human_rights"
/>
<ReportsSection
title="Reports on blocking Human Rights websites"
reports={reports}
/>
<StyledStickySubMenu topClass="top-[193px]">
<div className="pb-4 pt-2">
<Form
onSubmit={onSubmit}
availableCountries={countries.map((c) => c.alpha_2)}
/>
</div>
</StyledStickySubMenu>
{HUMAN_RIGHTS_DOMAINS.map((domain) => (
<div key={domain} className="my-6">
<ChartWrapper domain={domain} testName="web_connectivity" />
</div>
))}
</div>
<ThematicPage
domains={domains}
{...props}
theme="human_rights"
title={intl.formatMessage({ id: 'Navbar.HumanRights' })}
findingsTitle="Findings on blocking Human Rights Websites"
reportsTitle="Reports on blocking Human Rights Websites"
menu={
<>
<a href="#findings">Findings</a>
<a href="#reports">Reports</a>
<a href="#websites">Websites</a>
</>
}
text={
<>
{/* <FormattedMarkdown id="ReachabilityDash.CircumventionTools.Description" /> */}
<ul className="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4">
{domains.map((d) => (
<li key={d}>
<a href={`#${d}`}>{d}</a>
</li>
))}
</ul>
</>
}
/>
)
}

Expand Down

0 comments on commit ffddc21

Please sign in to comment.