Skip to content

Commit

Permalink
feat: Update & test theme card
Browse files Browse the repository at this point in the history
  • Loading branch information
steezplusplus committed Sep 18, 2023
1 parent af49220 commit 47057aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/_components/cards/theme-card/theme-card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import { ThemeCard } from './theme-card';

const props = {
label: 'label',
icon: <div>icon</div>,
};

describe('<ThemeCard />', () => {
it('Should render expected elements', () => {
render(<ThemeCard {...props} />);
const h2 = screen.getByRole('heading', { level: 2 });
const icon = screen.getByText('icon');
expect(h2).toHaveTextContent(props.label);
expect(icon).toBeInTheDocument();
});
});
6 changes: 4 additions & 2 deletions app/_components/cards/theme-card/theme-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { ThemeSelect } from './theme-select/theme-select';

type ThemeCardProps = {
label: string;
icon: JSX.Element;
};

export function ThemeCard(props: ThemeCardProps) {
const { label } = props;
const { label, icon } = props;
return (
<div
className="
Expand All @@ -14,8 +15,9 @@ export function ThemeCard(props: ThemeCardProps) {
p-4 dark:bg-indigo-100/5
"
>
<h2 className="mb-1 text-lg">{label}</h2>
<h2 className="mb-1 self-end text-lg">{label}</h2>
<ThemeSelect />
<div className="self-start text-sm italic">{icon}</div>
</div>
);
}
4 changes: 2 additions & 2 deletions app/_schema/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { GithubIcon, Twitter, Linkedin, Mail, Music, Coffee } from 'lucide-react';
import Image from 'next/image';
import { GithubIcon, Twitter, Linkedin, Mail, Music, Coffee, SunMoon } from 'lucide-react';

export const githubSchema = {
href: 'https://github.com/steezplusplus',
Expand Down Expand Up @@ -31,6 +30,7 @@ export const contactSchema = {

export const themeSchema = {
label: 'Theme',
icon: <SunMoon />,
};

export const musicSchema = {
Expand Down

0 comments on commit 47057aa

Please sign in to comment.