Ignore:
Timestamp:
02/19/26 20:33:50 (5 months ago)
Author:
Tome <gjorgievtome@…>
Branches:
main
Children:
2c7b9c8
Parents:
c586cbd (diff), 546a194 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/main'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/BuildDetailsDialog.tsx

    rc586cbd r92fafb3  
    11import React, {useEffect, useState} from 'react';
    22import {
    3     Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid, Box, Typography,
     3    Dialog, DialogTitle, DialogContent, DialogActions, Button, Box, Typography,
    44    IconButton, Tab, Tabs, Table, TableBody, TableCell, TableRow, Rating, TextField, Avatar, Chip, Alert
    55} from '@mui/material';
     
    3434    const [ratingVal, setRatingVal] = useState(5);
    3535
    36     // Main details fetch
    3736    useEffect(() => {
    38         if (open && buildId !== null && typeof buildId === 'number') {
     37        if (open && buildId !== null) {
    3938            setLoading(true);
    4039            setReviewText("");
     
    5251
    5352    useEffect(() => {
    54         if (open && buildId !== null && typeof buildId === 'number') {
     53        if (open && buildId !== null) {
    5554            onGetBuildState({buildId})
    5655                .then(state => {
     
    6362    }, [open, buildId]);
    6463
     64    useEffect(() => {
     65        if (open) {
     66            setTabIndex(0);
     67        }
     68    }, [open, buildId]);
     69
     70
    6571    const handleFavorite = async () => {
    6672        if (!currentUser || buildId === null) return alert("Please login to favorite builds.");
     
    103109    return (
    104110        <>
    105             <Dialog open={open} onClose={onClose} maxWidth="md" fullWidth scroll="paper">
     111            <Dialog open={open} onClose={onClose} maxWidth="md" fullWidth scroll="body">
    106112                {loading || !details ? (
    107113                    <Box sx={{p: 5, textAlign: 'center'}}>Loading Forge Schematics...</Box>
     
    146152                            <Box sx={{p: 3}}>
    147153                                {tabIndex === 0 && (
    148                                     <Grid container spacing={2}>
    149                                         <Grid item xs={12} md={8}>
     154                                    <Box
     155                                        sx={{
     156                                            display: 'grid',
     157                                            gridTemplateColumns: {
     158                                                xs: '1fr',
     159                                                md: '2fr 1fr'
     160                                            },
     161                                            gap: 2,
     162                                            width: '100%'
     163                                        }}
     164                                    >
     165                                        <Box>
    150166                                            <Table size="small">
    151167                                                <TableBody>
     
    193209                                                </TableBody>
    194210                                            </Table>
    195                                         </Grid>
    196 
    197                                         <Grid item xs={12} md={4}>
     211                                        </Box>
     212
     213                                        <Box>
    198214                                            <Box sx={{bgcolor: '#424343', p: 2, borderRadius: 2, mb: 2}}>
    199                                                 <Typography color="primary.main" gutterBottom fontWeight="bold">Builder's
    200                                                     Notes</Typography>
     215                                                <Typography color="primary.main" gutterBottom fontWeight="bold">
     216                                                    Builder's Notes
     217                                                </Typography>
    201218                                                <Typography color="primary.main" variant="body2"
    202219                                                            sx={{fontStyle: 'italic'}}>
     
    243260                                                </Button>
    244261                                            </Box>
    245                                         </Grid>
    246                                     </Grid>
     262                                        </Box>
     263                                    </Box>
    247264                                )}
    248265
     
    313330                                            ))}
    314331                                            {details.reviews.length === 0 && (
    315                                                 <Typography color="text.secondary" align="center">No reviews yet. Be the
    316                                                     first!</Typography>
     332                                                <Typography color="text.secondary" align="center">
     333                                                    No reviews yet. Be the first!
     334                                                </Typography>
    317335                                            )}
    318336                                        </Box>
Note: See TracChangeset for help on using the changeset viewer.