Skip to content

Commit

Permalink
feat: rss feed links on the site
Browse files Browse the repository at this point in the history
design is my passion vai miten se meni
  • Loading branch information
ahnl committed Nov 6, 2024
1 parent a0d7196 commit 333ed98
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
13 changes: 12 additions & 1 deletion app/syslog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ import { Footer } from '@/components/Footer/Footer';
import { PostsGrid } from '@/components/PostsGrid/PostsGrid';
import { H2 } from '@/components/Title/Title';
import { CapsuleButton } from '@/components/Button/CapsuleButton';
import { FaRss } from "react-icons/fa";
import MorePosts from './MorePosts';
import posts from '@/utils/posts';
import Separator from '@/components/Separator/Separator';
import { Metadata } from 'next';
import { NavigateLink } from '@/components/NavigateLink/NavigateLink';

const perPage = 10;

export const metadata: Metadata = {
title: "Syslog",
description: "Testausserverin jäsenten kirjoittamia artikkeleja teknologiasta"
}

function RssIcon() {
return (
<FaRss size={16}/>
)
}
export default async function Page() {
const list = await posts.list(0, perPage - 1);
const { posts: basePosts } = list;
Expand All @@ -40,7 +48,10 @@ export default async function Page() {
<H2>Testausauton uusimmat</H2>
<PostsGrid posts={testausautoRecentPosts}/>
</Content>

<Content>
<NavigateLink href="https://testausserveri.fi/syslog/rss.xml"><RssIcon /> Syslogin RSS-syöte</NavigateLink>
<NavigateLink href="https://testausauto.fi/rss"><RssIcon /> Testausauton RSS-syöte</NavigateLink>
</Content>
<Footer />
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions components/NavigateLink/NavigateLink.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
margin-bottom: 1em;
}

.navigatelink svg {
.navigatelink svg:nth-last-child(1) {
vertical-align: middle;
font-size: 1.4em;
margin-left: 0.4em;
transform: translateY(-1.5px);
transition: margin-left 0.2s ease-out;
}

.navigatelink:hover svg {
.navigatelink:hover svg:nth-last-child(1) {
margin-left: 0.8em !important;
color: white;
}
9 changes: 5 additions & 4 deletions components/NavigateLink/NavigateLink.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import Link from 'next/link';
import styles from './NavigateLink.module.css'
import { HiOutlineArrowNarrowRight } from "react-icons/hi";
import { PropsWithChildren } from 'react';
import { FC, PropsWithChildren } from 'react';

type NavigateLinkProps = PropsWithChildren<{
href: string
href: string,
CustomIcon?: FC
}>

export function NavigateLink({ href, children }: NavigateLinkProps) {
export function NavigateLink({ href, CustomIcon, children }: NavigateLinkProps) {
return <Link href={href} className={styles.navigatelink}>
{children}
<HiOutlineArrowNarrowRight />
{CustomIcon ? <CustomIcon /> : <HiOutlineArrowNarrowRight />}
</Link>;
}

0 comments on commit 333ed98

Please sign in to comment.