Skip to content

Commit

Permalink
moved theme to FrameworkCard instead of passing as props
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Oct 30, 2024
1 parent 7d06c78 commit 7570db1
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions site/docs/components/InstallationOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
import { Link } from 'react-router-dom'
import { Link } from 'react-router-dom';
import { useTheme } from '../contexts/Theme.tsx';
import { Icon } from './Icon.tsx';

export default function InstallationOptions() {
const { theme } = useTheme();
return (
<div className="grid grid-cols-2 gap-4">
<FrameworkCard
name="Vite"
href="/installation/vite"
theme={theme}
/>
<FrameworkCard
name="Remix"
href="/installation/remix"
theme={theme}
/>
<FrameworkCard
name="Astro"
href="/installation/astro"
theme={theme}
/>
<FrameworkCard name="Vite" href="/installation/vite" />
<FrameworkCard name="Remix" href="/installation/remix" />
<FrameworkCard name="Astro" href="/installation/astro" />
</div>
);
}

type FrameworkProps = {
name: string;
href: string;
theme: string;
};

function FrameworkCard({ name, href, theme }: FrameworkProps) {
function FrameworkCard({ name, href }: FrameworkProps) {
const { theme } = useTheme();
return (
<Link
to={href}
Expand Down

0 comments on commit 7570db1

Please sign in to comment.