Skip to content

Commit

Permalink
fix: icon names and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Aug 29, 2024
1 parent 828e8bd commit 282789c
Show file tree
Hide file tree
Showing 46 changed files with 128 additions and 208 deletions.
3 changes: 1 addition & 2 deletions src/app/[locale]/(default)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { unstable_setRequestLocale } from 'next-intl/server';

import { Footer } from '@/components/layout/Footer';
import { Header } from '@/components/layout/Header';
import { Main } from '@/components/layout/Main';
import { unstable_setRequestLocale } from 'next-intl/server';

type DefaultLayoutProps = {
children: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/(default)/news/(header)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SquarePen } from 'lucide-react';
import { SquarePenIcon } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { unstable_setRequestLocale } from 'next-intl/server';

Expand All @@ -23,7 +23,7 @@ export default function NewsHeaderLayout({
<h1 className='my-4'>{t('title')}</h1>
<Button asChild size='sm'>
<Link href='/news/new'>
<SquarePen className='mr-2 h-4 w-4' />
<SquarePenIcon className='mr-2 h-4 w-4' />
{t('newArticle')}
</Link>
</Button>
Expand Down
8 changes: 3 additions & 5 deletions src/app/[locale]/(default)/storage/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { useTranslations } from 'next-intl';

import { Button } from '@/components/ui/Button';

import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/Tooltip';
import { ShoppingCart } from 'lucide-react';
import { ShoppingCartIcon } from 'lucide-react';
import { useTranslations } from 'next-intl';

export default function StorageLayout({
children,
Expand All @@ -25,7 +23,7 @@ export default function StorageLayout({
<Tooltip>
<TooltipTrigger asChild>
<Button className='absolute right-0 bottom-0 md:right-5'>
<ShoppingCart />
<ShoppingCartIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
Expand Down
12 changes: 5 additions & 7 deletions src/app/[locale]/(default)/storage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { items } from '@/mock-data/items';
import { useTranslations } from 'next-intl';
import { getTranslations, unstable_setRequestLocale } from 'next-intl/server';
import Image from 'next/image';
import { createSearchParamsCache, parseAsInteger } from 'nuqs/parsers';

import { PaginationCarousel } from '@/components/layout/PaginationCarousel';
import { Button } from '@/components/ui/Button';
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
Expand All @@ -23,6 +16,11 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/Select';
import { items } from '@/mock-data/items';
import { useTranslations } from 'next-intl';
import { getTranslations, unstable_setRequestLocale } from 'next-intl/server';
import Image from 'next/image';
import { createSearchParamsCache, parseAsInteger } from 'nuqs/parsers';

export async function generateMetadata({
params: { locale },
Expand Down
8 changes: 3 additions & 5 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { getTranslations, unstable_setRequestLocale } from 'next-intl/server';
import { Inter, Montserrat } from 'next/font/google';

import { RootProviders } from '@/components/providers/RootProviders';
import { routing } from '@/lib/locale';
import { cx } from '@/lib/utils';

import { RootProviders } from '@/components/providers/RootProviders';
import { getTranslations, unstable_setRequestLocale } from 'next-intl/server';
import { Inter, Montserrat } from 'next/font/google';

type LocaleLayoutProps = {
children: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Facebook({ className, ...rest }: { className?: string }) {
function FacebookIcon({ className, ...rest }: { className?: string }) {
return (
<svg
className={className}
Expand All @@ -19,4 +19,4 @@ function Facebook({ className, ...rest }: { className?: string }) {
);
}

export { Facebook };
export { FacebookIcon };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Github({ className, ...rest }: { className?: string }) {
function GitHubIcon({ className, ...rest }: { className?: string }) {
return (
<svg
className={className}
Expand All @@ -20,4 +20,4 @@ function Github({ className, ...rest }: { className?: string }) {
);
}

export { Github };
export { GitHubIcon };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Instagram({ className, ...rest }: { className?: string }) {
function InstagramIcon({ className, ...rest }: { className?: string }) {
return (
<svg
className={className}
Expand All @@ -21,4 +21,4 @@ function Instagram({ className, ...rest }: { className?: string }) {
);
}

export { Instagram };
export { InstagramIcon };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Slack({ className, ...rest }: { className?: string }) {
function SlackIcon({ className, ...rest }: { className?: string }) {
return (
<svg
className={className}
Expand Down Expand Up @@ -26,4 +26,4 @@ function Slack({ className, ...rest }: { className?: string }) {
);
}

export { Slack };
export { SlackIcon };
4 changes: 4 additions & 0 deletions src/components/assets/icons/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './FacebookIcon';
export * from './GitHubIcon';
export * from './InstagramIcon';
export * from './SlackIcon';
2 changes: 2 additions & 0 deletions src/components/assets/sponsors/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './IDILogo';
export * from './NexusLogo';
37 changes: 18 additions & 19 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { Bug, Mail } from 'lucide-react';
import { useTranslations } from 'next-intl';
import ExternalLink from 'next/link';

import { Link } from '@/lib/locale/navigation';

import { Facebook } from '@/components/assets/icons/Facebook';
import { Github } from '@/components/assets/icons/Github';
import { Instagram } from '@/components/assets/icons/Instagram';
import { Slack } from '@/components/assets/icons/Slack';
import { IDILogo } from '@/components/assets/sponsors/IDILogo';
import { NexusLogo } from '@/components/assets/sponsors/NexusLogo';
import {
FacebookIcon,
GitHubIcon,
InstagramIcon,
SlackIcon,
} from '@/components/assets/icons';
import { IDILogo, NexusLogo } from '@/components/assets/sponsors';
import { LogoLink } from '@/components/layout/LogoLink';
import { Nav } from '@/components/layout/Nav';
import { Button } from '@/components/ui/Button';
import { Link } from '@/lib/locale/navigation';
import { BugIcon, MailIcon } from 'lucide-react';
import { useTranslations } from 'next-intl';
import ExternalLink from 'next/link';

function Footer() {
const t = useTranslations('layout');
Expand Down Expand Up @@ -54,7 +53,7 @@ function Footer() {
href='mailto:[email protected]'
aria-label={t('sendAnEmail')}
>
<Mail className='h-4 w-4' />
<MailIcon className='h-4 w-4' />
</ExternalLink>
</Button>
</li>
Expand All @@ -67,7 +66,7 @@ function Footer() {
target='_blank'
rel='noopener noreferrer'
>
<Slack className='h-4 w-4' />
<SlackIcon className='h-4 w-4' />
</ExternalLink>
</Button>
</li>
Expand All @@ -80,7 +79,7 @@ function Footer() {
target='_blank'
rel='noopener noreferrer'
>
<Facebook className='h-4 w-4' />
<FacebookIcon className='h-4 w-4' />
</ExternalLink>
</Button>
</li>
Expand All @@ -93,7 +92,7 @@ function Footer() {
target='_blank'
rel='noopener noreferrer'
>
<Github className='h-4 w-4' />
<GitHubIcon className='h-4 w-4' />
</ExternalLink>
</Button>
</li>
Expand All @@ -106,7 +105,7 @@ function Footer() {
target='_blank'
rel='noopener noreferrer'
>
<Instagram className='h-4 w-4' />
<InstagramIcon className='h-4 w-4' />
</ExternalLink>
</Button>
</li>
Expand All @@ -130,7 +129,7 @@ function Footer() {
<Link href='/'>{t('signIn')}</Link>
</Button>
<br />
{t('haveYouFoundA')} <Bug className='inline h-4 w-4' />?
{t('haveYouFoundA')} <BugIcon className='inline h-4 w-4' />?
<br />
{t.rich('utilitiesDescription', {
code: (children) => (
Expand All @@ -142,7 +141,7 @@ function Footer() {
href='mailto:[email protected]'
aria-label={t('sendAnEmail')}
>
<Mail className='inline h-4 w-4' />
<MailIcon className='inline h-4 w-4' />
</ExternalLink>
</Button>
),
Expand Down
3 changes: 1 addition & 2 deletions src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useTranslations } from 'next-intl';

import { LogoLink } from '@/components/layout/LogoLink';
import { MobileSheet } from '@/components/layout/MobileSheet';
import { Nav } from '@/components/layout/Nav';
import { DarkModeMenu } from '@/components/settings/DarkModeMenu';
import { LocaleMenu } from '@/components/settings/LocaleMenu';
import { ProfileMenu } from '@/components/settings/ProfileMenu';
import { useTranslations } from 'next-intl';

function Header() {
const t = useTranslations('layout');
Expand Down
8 changes: 3 additions & 5 deletions src/components/layout/LogoLink.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useTranslations } from 'next-intl';

import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';

import { Logo } from '@/components/assets/Logo';
import { Button } from '@/components/ui/Button';
import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';
import { useTranslations } from 'next-intl';

function LogoLink({
className,
Expand Down
7 changes: 3 additions & 4 deletions src/components/layout/MobileSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use client';

import { Menu } from 'lucide-react';
import * as React from 'react';

import { LogoLink } from '@/components/layout/LogoLink';
import { Nav } from '@/components/layout/Nav';
import { Button } from '@/components/ui/Button';
Expand All @@ -13,6 +10,8 @@ import {
SheetTitle,
SheetTrigger,
} from '@/components/ui/Sheet';
import { MenuIcon } from 'lucide-react';
import * as React from 'react';

type MobileSheetProps = {
className?: string;
Expand All @@ -36,7 +35,7 @@ function MobileSheet({ className, t }: MobileSheetProps) {
size='icon'
aria-label={t.navigationMenu}
>
<Menu className='h-5 w-5' />
<MenuIcon className='h-5 w-5' />
</Button>
</SheetTrigger>
<SheetContent side='left' close={t.close}>
Expand Down
3 changes: 1 addition & 2 deletions src/components/layout/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Link } from '@/lib/locale/navigation';

import { Button } from '@/components/ui/Button';
import { Link } from '@/lib/locale/navigation';

type NavProps = {
className?: string;
Expand Down
7 changes: 2 additions & 5 deletions src/components/layout/PaginationCarousel.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
'use client';

import { parseAsInteger, useQueryState } from 'nuqs';

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

import {
Pagination,
PaginationContent,
Expand All @@ -13,7 +9,8 @@ import {
PaginationNext,
PaginationPrevious,
} from '@/components/ui/Pagination';

import { cx } from '@/lib/utils';
import { parseAsInteger, useQueryState } from 'nuqs';
type PaginationCarouselProps = {
className?: string;
totalPages: number;
Expand Down
4 changes: 1 addition & 3 deletions src/components/layout/PaginationCarouselSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useTranslations } from 'next-intl';

import {
Pagination,
PaginationContent,
Expand All @@ -8,7 +6,7 @@ import {
PaginationNext,
PaginationPrevious,
} from '@/components/ui/Pagination';

import { useTranslations } from 'next-intl';
type PaginationCarouselSkeletonProps = {
className?: string;
};
Expand Down
9 changes: 3 additions & 6 deletions src/components/news/ArticleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import Image from 'next/image';

import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';

import { InternalBadge } from '@/components/news/InternalBadge';
import { Button } from '@/components/ui/Button';
import {
Expand All @@ -11,7 +6,9 @@ import {
CardHeader,
CardTitle,
} from '@/components/ui/Card';

import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';
import Image from 'next/image';
type ArticleCardProps = {
className?: string;
id: number;
Expand Down
8 changes: 3 additions & 5 deletions src/components/news/ArticleItem.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Image from 'next/image';

import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';

import { InternalBadge } from '@/components/news/InternalBadge';
import { Button } from '@/components/ui/Button';
import { Link } from '@/lib/locale/navigation';
import { cx } from '@/lib/utils';
import Image from 'next/image';

type ArticleItemProps = {
className?: string;
Expand Down
4 changes: 1 addition & 3 deletions src/components/news/CardGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { cx } from '@/lib/utils';

import { ArticleCard } from '@/components/news/ArticleCard';

import { cx } from '@/lib/utils';
type CardGridProps = {
topArticles: {
id: number;
Expand Down
6 changes: 2 additions & 4 deletions src/components/news/CardGridSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from 'react';

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

import { Skeleton } from '@/components/ui/Skeleton';
import { cx } from '@/lib/utils';
import * as React from 'react';

function CardGridSkeleton() {
return (
Expand Down
Loading

0 comments on commit 282789c

Please sign in to comment.