mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
fixed style violation
This commit is contained in:
1 parent
0dbd29472f
commit
bcd5ab66a4
1 file changed
+35
-22
@@ -43,11 +43,14 @@ const AdminFlavors: React.FC = () => {
|
|||||||
remove_id: removeFlavor.id,
|
remove_id: removeFlavor.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
notify({ message: t('admin.mergeSuccess', { defaultValue: 'Flavors merged successfully' }), severity: 'success' });
|
notify({
|
||||||
|
message: t('admin.mergeSuccess', { defaultValue: 'Flavors merged successfully' }),
|
||||||
|
severity: 'success',
|
||||||
|
});
|
||||||
|
|
||||||
// Invalidate queries
|
// Invalidate queries
|
||||||
queryClient.invalidateQueries({ queryKey: queryKeys.flavors({ scope: 'all' }) });
|
queryClient.invalidateQueries({ queryKey: queryKeys.flavors({ scope: 'all' }) });
|
||||||
|
|
||||||
// Reset selection
|
// Reset selection
|
||||||
setKeepFlavor(null);
|
setKeepFlavor(null);
|
||||||
setRemoveFlavor(null);
|
setRemoveFlavor(null);
|
||||||
@@ -74,8 +77,9 @@ const AdminFlavors: React.FC = () => {
|
|||||||
{t('admin.mergeFlavors', { defaultValue: 'Merge Flavors' })}
|
{t('admin.mergeFlavors', { defaultValue: 'Merge Flavors' })}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>
|
<Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>
|
||||||
{t('admin.mergeFlavorsDesc', {
|
{t('admin.mergeFlavorsDesc', {
|
||||||
defaultValue: 'Combine two flavors into one. Ratings from the source flavor will be moved to the target flavor. If a user rated both, the more detailed review is kept.'
|
defaultValue:
|
||||||
|
'Combine two flavors into one. Ratings from the source flavor will be moved to the target flavor. If a user rated both, the more detailed review is kept.',
|
||||||
})}
|
})}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
@@ -88,15 +92,17 @@ const AdminFlavors: React.FC = () => {
|
|||||||
onChange={(_, newValue) => setRemoveFlavor(newValue)}
|
onChange={(_, newValue) => setRemoveFlavor(newValue)}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
{...params}
|
{...params}
|
||||||
label={t('admin.flavorToRemove', { defaultValue: 'Flavor to Remove (Source)' })}
|
label={t('admin.flavorToRemove', { defaultValue: 'Flavor to Remove (Source)' })}
|
||||||
helperText={t('admin.flavorToRemoveHint', { defaultValue: 'This flavor will be DELETED' })}
|
helperText={t('admin.flavorToRemoveHint', {
|
||||||
|
defaultValue: 'This flavor will be DELETED',
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid size={{ xs: 12, md: 2 }} sx={{ textAlign: 'center' }}>
|
<Grid size={{ xs: 12, md: 2 }} sx={{ textAlign: 'center' }}>
|
||||||
<Typography variant="h4">→</Typography>
|
<Typography variant="h4">→</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -109,10 +115,12 @@ const AdminFlavors: React.FC = () => {
|
|||||||
onChange={(_, newValue) => setKeepFlavor(newValue)}
|
onChange={(_, newValue) => setKeepFlavor(newValue)}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
{...params}
|
{...params}
|
||||||
label={t('admin.flavorToKeep', { defaultValue: 'Flavor to Keep (Target)' })}
|
label={t('admin.flavorToKeep', { defaultValue: 'Flavor to Keep (Target)' })}
|
||||||
helperText={t('admin.flavorToKeepHint', { defaultValue: 'This flavor will PRESERVED' })}
|
helperText={t('admin.flavorToKeepHint', {
|
||||||
|
defaultValue: 'This flavor will PRESERVED',
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -136,13 +144,16 @@ const AdminFlavors: React.FC = () => {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Dialog open={confirmOpen} onClose={() => !isMerging && setConfirmOpen(false)}>
|
<Dialog open={confirmOpen} onClose={() => !isMerging && setConfirmOpen(false)}>
|
||||||
<DialogTitle>{t('admin.confirmMergeTitle', { defaultValue: 'Confirm Flavor Merge' })}</DialogTitle>
|
<DialogTitle>
|
||||||
|
{t('admin.confirmMergeTitle', { defaultValue: 'Confirm Flavor Merge' })}
|
||||||
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>
|
<DialogContentText>
|
||||||
{t('admin.confirmMergeText', {
|
{t('admin.confirmMergeText', {
|
||||||
defaultValue: 'Are you sure you want to merge "{{remove}}" into "{{keep}}"? This action is irreversible. "{{remove}}" will be deleted, and all its ratings will be transferred.',
|
defaultValue:
|
||||||
|
'Are you sure you want to merge "{{remove}}" into "{{keep}}"? This action is irreversible. "{{remove}}" will be deleted, and all its ratings will be transferred.',
|
||||||
remove: removeFlavor?.name,
|
remove: removeFlavor?.name,
|
||||||
keep: keepFlavor?.name
|
keep: keepFlavor?.name,
|
||||||
})}
|
})}
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
@@ -150,14 +161,16 @@ const AdminFlavors: React.FC = () => {
|
|||||||
<Button onClick={() => setConfirmOpen(false)} disabled={isMerging}>
|
<Button onClick={() => setConfirmOpen(false)} disabled={isMerging}>
|
||||||
{t('common.cancel', { defaultValue: 'Cancel' })}
|
{t('common.cancel', { defaultValue: 'Cancel' })}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={handleMerge}
|
onClick={handleMerge}
|
||||||
color="warning"
|
color="warning"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
autoFocus
|
autoFocus
|
||||||
disabled={isMerging}
|
disabled={isMerging}
|
||||||
>
|
>
|
||||||
{isMerging ? t('common.processing', { defaultValue: 'Processing...' }) : t('admin.confirmMerge', { defaultValue: 'Merge Flavors' })}
|
{isMerging
|
||||||
|
? t('common.processing', { defaultValue: 'Processing...' })
|
||||||
|
: t('admin.confirmMerge', { defaultValue: 'Merge Flavors' })}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
Reference in new issue
Block a user