Skip to content

Commit

Permalink
Use Markdown compy (typehero#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacksore authored Aug 31, 2023
1 parent c2853a6 commit 9ec2e9c
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 103 deletions.
2 changes: 1 addition & 1 deletion apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
transpilePackages: ['@repo/db', '@repo/auth', '@repo/monaco'],
transpilePackages: ['@repo/db', '@repo/ui', '@repo/auth', '@repo/monaco'],
images: {
remotePatterns: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
Markdown,
} from '@repo/ui';
import { Comments } from '~/app/challenge/_components/comments';
import { Markdown } from '~/components/ui/markdown';
import type { ChallengeSolution } from '~/app/challenge/[id]/solutions/[solutionId]/page';
import { ReportDialog } from '~/components/ReportDialog';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { useQuery } from '@tanstack/react-query';
import { Copy, X } from '@repo/ui/icons';
import Link from 'next/link';
import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toast } from '@repo/ui';
import { Markdown } from '~/components/ui/markdown';
import {
Markdown,
Button,
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
toast,
} from '@repo/ui';
import { getBaseUrl } from '~/utils/getBaseUrl';
import { getRelativeTime } from '~/utils/relativeTime';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Loader2 } from '@repo/ui/icons';
import { useSession } from '@repo/auth/react';
import { useEffect, useRef, useState, type RefObject } from 'react';
import { Button, Textarea, ToastAction, useToast } from '@repo/ui';
import { Markdown } from '~/components/ui/markdown';
import { Button, Textarea, Markdown, ToastAction, useToast } from '@repo/ui';

interface Props {
mode: 'create' | 'edit' | 'reply';
Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/app/challenge/_components/comments/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import { useSession } from '@repo/auth/react';
import { type CommentRoot } from '@repo/db/types';
import { Tooltip, TooltipContent, TooltipTrigger, UserBadge, toast } from '@repo/ui';
import { Tooltip, TooltipContent, Markdown, TooltipTrigger, UserBadge, toast } from '@repo/ui';
import { ChevronDown, ChevronUp, Pencil, Reply, Share, Trash2 } from '@repo/ui/icons';
import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query';
import clsx from 'clsx';
import Link from 'next/link';
import { useEffect, useRef, useState } from 'react';
import { z } from 'zod';
import { ReportDialog } from '~/components/ReportDialog';
import { Markdown } from '~/components/ui/markdown';
import { getRelativeTime } from '~/utils/relativeTime';
import { Vote } from '../vote';
import { CommentInput } from './comment-input';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
TooltipTrigger,
TypographyLarge,
TypographyP,
Markdown,
toast,
} from '@repo/ui';
import { useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
import { Markdown } from '~/components/ui/markdown';
import { getRelativeTime } from '~/utils/relativeTime';
import { deleteComment } from '../comment.action';
import { type PaginatedComments } from '../getCommentRouteData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
TooltipTrigger,
TypographyH3,
UserBadge,
Markdown,
} from '@repo/ui';
import { Bookmark as BookmarkIcon, Flag, Share } from '@repo/ui/icons';
import { clsx } from 'clsx';
Expand All @@ -22,7 +23,6 @@ import Link from 'next/link';
import { useRef, useState } from 'react';
import { type ChallengeRouteData } from '~/app/challenge/[id]/getChallengeRouteData';
import { ReportDialog } from '~/components/ReportDialog';
import { Markdown } from '~/components/ui/markdown';
import { getRelativeTime } from '~/utils/relativeTime';
import { addOrRemoveBookmark } from '../bookmark.action';
import { ShareForm } from '../share-form';
Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/components/landing/feature-card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import type { Challenge, Difficulty } from '@repo/db/types';
import { Button } from '@repo/ui';
import { Button, Markdown } from '@repo/ui';
import clsx from 'clsx';
import {
motion,
Expand All @@ -18,7 +18,6 @@ import { useInView } from 'react-intersection-observer';
import { z } from 'zod';
import { TrackChallenge } from '~/app/tracks/_components/track-challenge-card';
import { useIsMobile } from '~/utils/useIsMobile';
import { Markdown } from '../ui/markdown';
import { Steps } from '../wizard/Steps';

type WrapperStyle = MotionStyle & {
Expand Down
89 changes: 0 additions & 89 deletions apps/web/src/components/ui/markdown.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions apps/web/src/components/wizard/DescriptionEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client';

import { useWatch } from 'react-hook-form';
import { FormField, FormItem, FormMessage, TypographyH3 } from '@repo/ui';
import { Markdown } from '../ui/markdown';
import { Markdown, FormField, FormItem, FormMessage, TypographyH3 } from '@repo/ui';
import { RichMarkdownEditor } from '../ui/rich-markdown-editor';
import { type WizardForm } from '.';

Expand Down

0 comments on commit 9ec2e9c

Please sign in to comment.