diff --git a/app/frontend/package.json b/app/frontend/package.json index 044bd90..3b55a81 100644 --- a/app/frontend/package.json +++ b/app/frontend/package.json @@ -22,6 +22,9 @@ "vite": "8.3.0" }, "dependencies": { - "@project-graphite/ui": "https://github.com/project-graphite/graphite-ui/releases/download/v0.3.0/project-graphite-ui-0.3.0.tgz" + "@emotion/react": "11.14.0", + "@emotion/styled": "11.14.1", + "@mui/material": "9.5.0", + "@project-graphite/ui": "https://github.com/project-graphite/graphite-ui/releases/download/v1.0.0/project-graphite-ui-1.0.0.tgz" } } diff --git a/app/frontend/src/components/Attribution.tsx b/app/frontend/src/components/Attribution.tsx index fbe9d09..d803e79 100644 --- a/app/frontend/src/components/Attribution.tsx +++ b/app/frontend/src/components/Attribution.tsx @@ -1,3 +1,4 @@ +import MuiLink from '@mui/material/Link'; import type { Attribution as SourceAttribution } from '../catalog'; export function Attribution({ source }: { source: SourceAttribution }) { @@ -5,9 +6,9 @@ export function Attribution({ source }: { source: SourceAttribution }) { Data:{' '} {source.attributionUrl ? ( - + {source.attribution} - + ) : ( source.attribution )} diff --git a/app/frontend/src/components/CatalogCard.tsx b/app/frontend/src/components/CatalogCard.tsx index ae21d29..65c27ee 100644 --- a/app/frontend/src/components/CatalogCard.tsx +++ b/app/frontend/src/components/CatalogCard.tsx @@ -1,6 +1,17 @@ +import Alert from '@mui/material/Alert'; import { useState, type FormEvent } from 'react'; import { Link, useNavigate } from 'react-router'; -import { actionSkeletonClass, Dialog, errorMessage, Skeleton, useSnackbar } from '@project-graphite/ui'; +import { + actionSkeletonClass, + Button, + Checkbox, + Dialog, + errorMessage, + Select, + Skeleton, + useSnackbar, + type ButtonVariant, +} from '@project-graphite/ui'; import { useAdultBlur } from '../adultContent'; import { useAuth } from '../auth'; import { catalogRef, titleHref, type CatalogCandidate } from '../catalog'; @@ -57,35 +68,25 @@ function AddToListDialog({ return (
void add(event)}> - - - {error &&

{error}

} + { - const text = event.target.value.trim().replace(',', '.'); - const problem = text === '' ? '' : progressProblem(text, label, max, decimals); - setError(problem); - if (problem) return; - const next = text === '' ? null : Number(text); - if (next !== value) onCommit({ [name]: next }); - }} - onInput={() => setError('')} - onKeyDown={(event) => { - if (event.key === 'Enter') event.currentTarget.blur(); - }} - /> - {error && ( - - {error} - - )} - + { + const text = event.target.value.trim().replace(',', '.'); + const problem = text === '' ? '' : progressProblem(text, label, max, decimals); + setError(problem); + if (problem) return; + const next = text === '' ? null : Number(text); + if (next !== value) onCommit({ [name]: next }); + }} + onInput={() => setError('')} + onKeyDown={(event) => { + if (event.key === 'Enter') event.currentTarget.blur(); + }} + /> ); } @@ -105,24 +98,22 @@ function ProgressFields({ )} {units.includes('hours') && (
- Platforms you play on + Platforms you play on
{platforms.map((platform) => ( - + + onUpdate({ + platforms: event.target.checked + ? [...entry.progress.platforms, platform] + : entry.progress.platforms.filter((item) => item !== platform), + }) + } + /> ))} {platforms.length === 0 && ( No platform data available. @@ -202,36 +193,28 @@ export function LibraryEntryEditor({ return (
- + update({ preferredSource: event.target.value || null })} - value={entry.preferredSource ?? ''} - > - - {entry.item.sources.map((source) => ( - - ))} - - + update({ isPrivate: event.target.checked })} - type="checkbox" - /> - Hide from my profile - + update({ isPrivate: event.target.checked })} + />
{(entry.item.releasing || entry.notificationsEnabled) && (
- + update({ notificationsEnabled: event.target.checked })} + /> {!entry.item.releasing ? (

This title has finished coming out, so there is nothing new to announce. @@ -283,38 +260,39 @@ export function LibraryEntryEditor({ {entry.notificationsEnabled && emailsOff && (

Emails for {categoryLabels[entry.item.category].toLowerCase()} are off in{' '} - notification settings. + notification settings.

)}
)} {entry.importedSources.length > 0 && (
-

Imported sources

+ Imported sources
    {entry.importedSources.map((source) => (
  • {source.name} · not supported, never checked - +
  • ))}
)} - {error &&

{error}

} + {error && {error}}
- +
{removing && ( void }) {

Notifications

{inbox.unread > 0 && ( - + )}
-
+
{(error || inbox.checkFailed) && ( -

+ {error || 'Could not check for new notifications. Trying again in a minute.'} -

+ )} {recent.error ? ( -

{recent.error}

+ {recent.error} ) : !recent.data ? (
@@ -69,10 +71,9 @@ export function NotificationBell() { + - {inbox.unread > 0 && {inbox.unread > 9 ? '9+' : inbox.unread}} - + } triggerLabel={inbox.unread ? `Notifications, ${inbox.unread} unread` : 'Notifications'} > diff --git a/app/frontend/src/components/NotificationList.tsx b/app/frontend/src/components/NotificationList.tsx index 5d79a47..d3d7fa3 100644 --- a/app/frontend/src/components/NotificationList.tsx +++ b/app/frontend/src/components/NotificationList.tsx @@ -1,3 +1,6 @@ +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; import { Link } from 'react-router'; import { timeAgo, useSnackbar } from '@project-graphite/ui'; import { useAdultBlur } from '../adultContent'; @@ -33,8 +36,9 @@ function NotificationRow({ ); return href ? ( - { onOpen?.(); void inbox @@ -44,9 +48,9 @@ function NotificationRow({ to={href} > {content} - + ) : ( -
{content}
+
{content}
); } @@ -58,12 +62,12 @@ export function NotificationList({ onOpen?: () => void; }) { return ( -
    + {notifications.map((notification) => ( -
  • + -
  • + ))} -
+ ); } diff --git a/app/frontend/src/components/PasswordDialog.tsx b/app/frontend/src/components/PasswordDialog.tsx index a18c5f1..a2246fa 100644 --- a/app/frontend/src/components/PasswordDialog.tsx +++ b/app/frontend/src/components/PasswordDialog.tsx @@ -1,5 +1,6 @@ +import Alert from '@mui/material/Alert'; import { useState, type FormEvent, type ReactNode } from 'react'; -import { Dialog, errorMessage, TextField } from '@project-graphite/ui'; +import { Button, Dialog, errorMessage, TextField } from '@project-graphite/ui'; export function PasswordDialog({ children, @@ -51,14 +52,14 @@ export function PasswordDialog({ onInput={() => setMissing(false)} type="password" /> - {error &&

{error}

} + {error && {error}}
- - + +
diff --git a/app/frontend/src/components/ResendVerification.tsx b/app/frontend/src/components/ResendVerification.tsx index 36a341b..25d006a 100644 --- a/app/frontend/src/components/ResendVerification.tsx +++ b/app/frontend/src/components/ResendVerification.tsx @@ -1,5 +1,6 @@ +import Alert from '@mui/material/Alert'; import { useState } from 'react'; -import { errorMessage } from '@project-graphite/ui'; +import { Button, errorMessage } from '@project-graphite/ui'; import { apiRequest } from '../api'; export function ResendVerification({ email }: { email: string }) { @@ -28,17 +29,17 @@ export function ResendVerification({ email }: { email: string }) { ) : (

Nothing arrived?{' '} - +

)} - {error &&

{error}

} + {error && {error}} ); } diff --git a/app/frontend/src/components/ReviewCard.tsx b/app/frontend/src/components/ReviewCard.tsx index cf8c724..ba98d6e 100644 --- a/app/frontend/src/components/ReviewCard.tsx +++ b/app/frontend/src/components/ReviewCard.tsx @@ -1,6 +1,9 @@ +import Alert from '@mui/material/Alert'; +import FormLabel from '@mui/material/FormLabel'; +import MuiLink from '@mui/material/Link'; import { useState, type FormEvent } from 'react'; import { Link } from 'react-router'; -import { Dialog, errorMessage } from '@project-graphite/ui'; +import { Button, Dialog, errorMessage, Radio } from '@project-graphite/ui'; import { useAuth } from '../auth'; import { itemHref, reportReasons, type ItemSummary, type PublicReview } from '../reviews'; @@ -33,34 +36,32 @@ function ReportDialog({ onClose, review }: { onClose: () => void; review: Public {sent ? (

Thanks. A moderator will look at this review.

- +
) : (
void report(event)}>
- What is wrong with it? + What is wrong with it? {Object.entries(reportReasons).map(([value, label]) => ( - + setReason(value as keyof typeof reportReasons)} + /> ))}
- {error &&

{error}

} + {error && {error}}
- - + +
)} @@ -80,9 +81,9 @@ export function ReviewCard({ item, review }: { item?: ItemSummary; review: Publi

- + {review.author.displayName} - {' '} + {' '} {[ review.rating !== null && `${review.rating}/10`, @@ -94,14 +95,14 @@ export function ReviewCard({ item, review }: { item?: ItemSummary; review: Publi

{reportable && ( - + )}
{item && (

- on {href ? {item.title} : item.title} + on {href ? {item.title} : item.title}

)} {revealed ? ( @@ -112,16 +113,17 @@ export function ReviewCard({ item, review }: { item?: ItemSummary; review: Publi )} ) : ( -
- This review contains spoilers. - -
+ setRevealed(true)} size="small"> + Show review + + } + className="mt-3" + severity="info" + > + This review contains spoilers. + )} {reporting && setReporting(false)} review={review} />}
diff --git a/app/frontend/src/components/ReviewEditor.tsx b/app/frontend/src/components/ReviewEditor.tsx index b4adbb6..2ef1ca4 100644 --- a/app/frontend/src/components/ReviewEditor.tsx +++ b/app/frontend/src/components/ReviewEditor.tsx @@ -1,5 +1,9 @@ +import Alert from '@mui/material/Alert'; +import FormLabel from '@mui/material/FormLabel'; +import ToggleButton from '@mui/material/ToggleButton'; +import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; import { useState, type FormEvent } from 'react'; -import { ConfirmDialog, errorMessage, Toggle } from '@project-graphite/ui'; +import { Button, Checkbox, ConfirmDialog, errorMessage, TextAreaField, TextField, Toggle } from '@project-graphite/ui'; import { useAuth } from '../auth'; import { reviewBodyLimit, type OwnReview } from '../reviews'; import { ReviewCard } from './ReviewCard'; @@ -54,61 +58,48 @@ export function ReviewEditor({ return (
- Rating + Rating
- {Array.from({ length: 10 }, (_, index) => index + 1).map((value) => ( - - ))} + + ))} + {rating !== null && ( - + )}
- -