Skip to content

Commit

Permalink
Use named exports for cards
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Sep 30, 2024
1 parent 5d2db23 commit f80b83a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
4 changes: 1 addition & 3 deletions app/(pages)/(home)/cards/github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { get } from '@vercel/edge-config';
import type { ReactElement } from 'react';
import ActivityCalendar from 'rsc-activity-calendar';

const GitHubCard = async (): Promise<ReactElement> => {
export const GitHubCard = async (): Promise<ReactElement> => {
const github = await get<GitHubProperties>('github');

if (!github) {
Expand Down Expand Up @@ -46,5 +46,3 @@ const GitHubCard = async (): Promise<ReactElement> => {
</Card>
);
};

export default GitHubCard;
5 changes: 1 addition & 4 deletions app/(pages)/(home)/cards/spotify/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Link } from '@/components/link';
import { get } from '@vercel/edge-config';
import Image from 'next/image';
import type { ReactElement } from 'react';

import Vinyl from './vinyl.png';

const SpotifyCard = async (): Promise<ReactElement> => {
export const SpotifyCard = async (): Promise<ReactElement> => {
const song = await get<SpotifyProperties>('spotify');

if (!song) {
Expand Down Expand Up @@ -46,5 +45,3 @@ const SpotifyCard = async (): Promise<ReactElement> => {
</Card>
);
};

export default SpotifyCard;
4 changes: 1 addition & 3 deletions app/(pages)/(home)/cards/steam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { get } from '@vercel/edge-config';
import Image from 'next/image';
import type { ReactElement } from 'react';

const SteamCard = async (): Promise<ReactElement> => {
export const SteamCard = async (): Promise<ReactElement> => {
const game = await get<GameProperties>('steam');

if (!game) {
Expand Down Expand Up @@ -43,5 +43,3 @@ const SteamCard = async (): Promise<ReactElement> => {
</Card>
);
};

export default SteamCard;
5 changes: 2 additions & 3 deletions app/(pages)/(home)/cards/typefully.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Card } from '@/components/card';
import { get } from '@vercel/edge-config';
import type { ReactElement } from 'react';

const TypefullyCard = async (): Promise<ReactElement> => {
export const TypefullyCard = async (): Promise<ReactElement> => {
const tweets = await get<TypefullyProperties[]>('typefully');

if (!tweets) {
Expand All @@ -19,6 +19,7 @@ const TypefullyCard = async (): Promise<ReactElement> => {
<div key={tweet.id} className="flex items-center gap-2 text-sm">
<div
className="truncate"
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
dangerouslySetInnerHTML={{
__html: tweet.html.replace(/<br\s*\/?>/g, ' '),
}}
Expand All @@ -34,5 +35,3 @@ const TypefullyCard = async (): Promise<ReactElement> => {
</Card>
);
};

export default TypefullyCard;
4 changes: 1 addition & 3 deletions app/(pages)/(home)/cards/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { Card } from '@/components/card';
import { Video } from '@/components/video';
import type { ReactElement } from 'react';

const VideoCard = async (): Promise<ReactElement> => (
export const VideoCard = async (): Promise<ReactElement> => (
<Card title="Latest Drone Video">
<Video url="https://youtu.be/5NOgrMM72k8" controls />
</Card>
);

export default VideoCard;
10 changes: 5 additions & 5 deletions app/(pages)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import Image from 'next/image';
import { type FC, Suspense } from 'react';
import Avatar from './avatar.jpg';
import { AnnouncementCard } from './cards/announcement';
import GitHubCard from './cards/github';
import SpotifyCard from './cards/spotify';
import SteamCard from './cards/steam';
import TypefullyCard from './cards/typefully';
import VideoCard from './cards/video';
import { GitHubCard } from './cards/github';
import { SpotifyCard } from './cards/spotify';
import { SteamCard } from './cards/steam';
import { TypefullyCard } from './cards/typefully';
import { VideoCard } from './cards/video';
import { Location } from './components/location';
import { Newsletter } from './components/newsletter';

Expand Down

0 comments on commit f80b83a

Please sign in to comment.