Skip to content

Commit

Permalink
fix: use correct height for badge
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Feb 7, 2023
1 parent b79254c commit 1ffdcae
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/components/addManga/steps/reviewStep.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ActionIcon,
Badge,
Box,
createStyles,
Divider,
Grid,
Expand Down Expand Up @@ -188,7 +189,7 @@ export function ReviewStep({ form }: { form: UseFormReturnType<FormType> }) {
<Tooltip label={genre} key={genre}>
<div style={{ maxWidth: 100 }}>
<Badge color="indigo" variant="light" size="xs" fullWidth>
{genre}
<Box className="h-3">{genre}</Box>
</Badge>
</div>
</Tooltip>
Expand All @@ -204,7 +205,7 @@ export function ReviewStep({ form }: { form: UseFormReturnType<FormType> }) {
<Tooltip label={tag} key={tag}>
<div style={{ maxWidth: 100 }}>
<Badge color="violet" variant="light" size="xs" fullWidth>
{tag}
<Box className="h-3">{tag}</Box>
</Badge>
</div>
</Tooltip>
Expand Down
4 changes: 2 additions & 2 deletions src/components/mangaCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionIcon, Badge, createStyles, Paper, Skeleton, Title, Tooltip } from '@mantine/core';
import { ActionIcon, Badge, Box, createStyles, Paper, Skeleton, Title, Tooltip } from '@mantine/core';
import { Prisma } from '@prisma/client';
import { IconEdit, IconExclamationMark, IconRefresh, IconX } from '@tabler/icons-react';
import { contrastColor } from 'contrast-color';
Expand Down Expand Up @@ -214,7 +214,7 @@ export function MangaCard({ manga, onRemove, onUpdate, onRefresh, onClick }: Man
className={classes.badge}
size="xs"
>
{manga.source}
<Box className="h-3">{manga.source}</Box>
</Badge>
<Title order={5} className={classes.title}>
{manga.title}
Expand Down
12 changes: 6 additions & 6 deletions src/components/mangaDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Badge, createStyles, Divider, Grid, Group, Image, Spoiler, Text, Title } from '@mantine/core';
import { Badge, Box, createStyles, Divider, Grid, Group, Image, Spoiler, Text, Title } from '@mantine/core';
import { NextLink } from '@mantine/next';
import { Prisma } from '@prisma/client';
import { IconExternalLink } from '@tabler/icons-react';
Expand Down Expand Up @@ -97,7 +97,7 @@ export function MangaDetail({ manga }: { manga: MangaWithMetadataAndChapters })
<Group spacing={0}>
{manga.metadata.synonyms.map((synonym) => (
<Badge key={synonym} color="gray" variant="filled" size="xs" m={2}>
{synonym}
<Box className="h-3">{synonym}</Box>
</Badge>
))}
</Group>
Expand All @@ -110,7 +110,7 @@ export function MangaDetail({ manga }: { manga: MangaWithMetadataAndChapters })
>
Checking{' '}
<Badge component="span" color="blue" variant="filled" size="xs">
{getCronLabel(manga.interval)}
<Box className="h-3">{getCronLabel(manga.interval)}</Box>
</Badge>{' '}
from{' '}
<Badge
Expand All @@ -120,7 +120,7 @@ export function MangaDetail({ manga }: { manga: MangaWithMetadataAndChapters })
size="xs"
sx={{ backgroundColor: stc(manga.source), color: contrastColor({ bgColor: stc(manga.source) }) }}
>
{manga.source}
<Box className="h-3">{manga.source}</Box>
</Badge>
</Group>
<Divider sx={{ fontWeight: 'bolder' }} variant="dashed" my="xs" label="Status" />
Expand All @@ -134,15 +134,15 @@ export function MangaDetail({ manga }: { manga: MangaWithMetadataAndChapters })
<Group spacing={0}>
{manga.metadata.genres.map((genre) => (
<Badge key={genre} color="indigo" variant="light" size="xs" m={2}>
{genre}
<Box className="h-3">{genre}</Box>
</Badge>
))}
</Group>
<Divider sx={{ fontWeight: 'bolder' }} variant="dashed" my="xs" label="Tags" />
<Group spacing={0}>
{manga.metadata.tags.map((tag) => (
<Badge key={tag} color="violet" variant="light" size="xs" m={2}>
{tag}
<Box className="h-3">{tag}</Box>
</Badge>
))}
</Group>
Expand Down
18 changes: 14 additions & 4 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,22 @@ function HistoryItem({ chapter }: { chapter: HistoryItemType }) {
</Text>
<SimpleGrid cols={2} mt={4}>
<Tooltip label={time}>
<Badge variant="light" size="xs" color="cyan" leftSection={<IconClock size={12} />}>
{time}
<Badge
variant="light"
size="xs"
color="cyan"
leftSection={<IconClock className="flex justify-center align-middle" size={12} />}
>
<Box className="h-3">{time}</Box>
</Badge>
</Tooltip>
<Badge variant="light" size="xs" color="violet" leftSection={<IconFileReport size={12} />}>
{prettyBytes(chapter.size)}
<Badge
variant="light"
size="xs"
color="violet"
leftSection={<IconFileReport className="flex justify-center align-middle" size={12} />}
>
<Box className="h-3">{prettyBytes(chapter.size)}</Box>
</Badge>
</SimpleGrid>
</>
Expand Down
5 changes: 3 additions & 2 deletions src/components/updateManga.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ActionIcon,
Badge,
Box,
Button,
Code,
createStyles,
Expand Down Expand Up @@ -290,7 +291,7 @@ function UpdateModalContent({
<Tooltip label={genre} key={genre}>
<div style={{ maxWidth: 100 }}>
<Badge color="indigo" variant="light" size="xs" fullWidth>
{genre}
<Box className="h-3">{genre}</Box>
</Badge>
</div>
</Tooltip>
Expand All @@ -306,7 +307,7 @@ function UpdateModalContent({
<Tooltip label={tag} key={tag}>
<div style={{ maxWidth: 100 }}>
<Badge color="violet" variant="light" size="xs" fullWidth>
{tag}
<Box className="h-3">{tag}</Box>
</Badge>
</div>
</Tooltip>
Expand Down

0 comments on commit 1ffdcae

Please sign in to comment.