Skip to content

Commit

Permalink
Merge pull request #170 from Vizzuality/feature/objectives-to-projects
Browse files Browse the repository at this point in the history
links test
  • Loading branch information
mluena authored Oct 30, 2024
2 parents 3c4c7ff + 2e8ff0f commit b145a06
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
71 changes: 37 additions & 34 deletions client/src/containers/countries/countries-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,42 +104,45 @@ const CountriesTable = () => {
<td key={v.iso3} className="space-x-1 space-y-1.5 p-3">
{v.isResource ? (
v.resources?.length ? (
v.resources?.map((r) => (
<Popover key={r.link_title}>
<PopoverTrigger className="whitespace-nowrap rounded border border-brand1/20 bg-brand1/10 px-2.5 py-[3px] text-xs leading-none text-brand1 data-[state='open']:bg-brand1 data-[state='open']:text-white">
{r.link_title}
</PopoverTrigger>
<PopoverPortal>
<PopoverContent
id={`popover-${t.name}`}
className="w-fit min-w-[240px] max-w-[500px] space-y-3 border-none bg-gray-700 text-white"
>
<PopoverArrow className="fill-gray-700" />
v.resources?.map((r) => {
console.info(r, r.link_url, r.link_title);
return (
<Popover key={r.link_title}>
<PopoverTrigger className="whitespace-nowrap rounded border border-brand1/20 bg-brand1/10 px-2.5 py-[3px] text-xs leading-none text-brand1 data-[state='open']:bg-brand1 data-[state='open']:text-white">
{r.link_title}
</PopoverTrigger>
<PopoverPortal>
<PopoverContent
id={`popover-${t.name}`}
className="w-fit min-w-[240px] max-w-[500px] space-y-3 border-none bg-gray-700 text-white"
>
<PopoverArrow className="fill-gray-700" />

<div className="flex items-center justify-between font-open-sans">
<p className="text-xxs font-semibold uppercase leading-none text-gray-400">
{t.name}
<div className="flex items-center justify-between font-open-sans">
<p className="text-xxs font-semibold uppercase leading-none text-gray-400">
{t.name}
</p>
<PopoverClose>
<LuX className="h-6 w-6 text-white" />
</PopoverClose>
</div>
<p className="border-b border-white/20 pb-3 text-xl">
{r.link_title}
</p>
<PopoverClose>
<LuX className="h-6 w-6 text-white" />
</PopoverClose>
</div>
<p className="border-b border-white/20 pb-3 text-xl">
{r.link_title}
</p>
<p className="text-xs">{r.description}</p>
<a
href={r.link_url}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 py-1.5 text-xs text-brand2"
>
Learn more <LuExternalLink className="h-5 w-5" />
</a>
</PopoverContent>
</PopoverPortal>
</Popover>
))
<p className="text-xs">{r.description}</p>
<a
href={r.link_url}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 py-1.5 text-xs text-brand2"
>
Learn more <LuExternalLink className="h-5 w-5" />
</a>
</PopoverContent>
</PopoverPortal>
</Popover>
);
})
) : (
"-"
)
Expand Down
1 change: 1 addition & 0 deletions client/src/containers/countries/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const useTableData = () => {
isDatasetValueProperty(value_type) &&
datasetValue?.attributes?.[value_type];
const country = countriesData?.data?.find((c1) => c1.attributes?.iso3 === c);

return {
iso3: c,
countryLink: country?.attributes?.link,
Expand Down

0 comments on commit b145a06

Please sign in to comment.