Skip to content

Commit

Permalink
Use LinkAsButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke committed May 3, 2024
1 parent bf75392 commit 6abcf19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
17 changes: 6 additions & 11 deletions src/components/details.page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Attachement } from '@/api/settings';
import { LatLngTuple } from 'leaflet';
import { useTranslations } from 'next-intl';

import { convertAttachementsToImages } from '@/lib/utils';

import ButtonCenterView from './button-center-view';
import ButtonClose from './button-close';
import Carousel from './carousel';
import { MetadataList } from './metadata-list';
import LinkAsButton from './ui/link-as-button';

type Props = {
content: {
Expand All @@ -32,6 +34,7 @@ type Props = {
};

export default function DetailsPageUI({ content }: Props) {
const t = useTranslations('details');
return (
<article>
{content?.attachments?.length > 0 && (
Expand Down Expand Up @@ -68,17 +71,9 @@ export default function DetailsPageUI({ content }: Props) {

<div dangerouslySetInnerHTML={{ __html: content.description }} />
{content?.url && (
<div
className="w-full"
>
<a
href={content.url}
target="_blank"
className="w-fit block gap-4 py-2 px-2 my-4 mx-auto border rounded-md font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 bg-primary hover:bg-primary/80 border-transparent text-primary-foreground"
>
Voir le site associé
</a>
</div>
<LinkAsButton className="mx-auto mt-4 block w-fit" href={content?.url}>
{t('link')}
</LinkAsButton>
)}
</article>
);
Expand Down
3 changes: 2 additions & 1 deletion translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"m": "m",
"meters": "mètres",
"observationTypes": "Types d'observations",
"observations": "Observations"
"observations": "Observations",
"link": "Voir le site associé"
},
"home": {
"title": "Sentinelle des rivières : j'observe, je protège",
Expand Down

0 comments on commit 6abcf19

Please sign in to comment.