Changeset f727252 for components/BuildDetailsDialog.tsx
- Timestamp:
- 02/10/26 01:23:31 (5 months ago)
- Branches:
- main
- Children:
- 546a194
- Parents:
- b348db4
- File:
-
- 1 edited
-
components/BuildDetailsDialog.tsx (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
components/BuildDetailsDialog.tsx
rb348db4 rf727252 1 1 import React, {useEffect, useState} from 'react'; 2 2 import { 3 Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid,Box, Typography,3 Dialog, DialogTitle, DialogContent, DialogActions, Button, Box, Typography, 4 4 IconButton, Tab, Tabs, Table, TableBody, TableCell, TableRow, Rating, TextField, Avatar, Chip, Alert 5 5 } from '@mui/material'; … … 34 34 const [ratingVal, setRatingVal] = useState(5); 35 35 36 // Main details fetch37 36 useEffect(() => { 38 if (open && buildId !== null && typeof buildId === 'number') {37 if (open && buildId !== null) { 39 38 setLoading(true); 40 39 setReviewText(""); … … 52 51 53 52 useEffect(() => { 54 if (open && buildId !== null && typeof buildId === 'number') {53 if (open && buildId !== null) { 55 54 onGetBuildState({buildId}) 56 55 .then(state => { … … 63 62 }, [open, buildId]); 64 63 64 useEffect(() => { 65 if (open) { 66 setTabIndex(0); 67 } 68 }, [open, buildId]); 69 70 65 71 const handleFavorite = async () => { 66 72 if (!currentUser || buildId === null) return alert("Please login to favorite builds."); … … 103 109 return ( 104 110 <> 105 <Dialog open={open} onClose={onClose} maxWidth="md" fullWidth scroll=" paper">111 <Dialog open={open} onClose={onClose} maxWidth="md" fullWidth scroll="body"> 106 112 {loading || !details ? ( 107 113 <Box sx={{p: 5, textAlign: 'center'}}>Loading Forge Schematics...</Box> … … 146 152 <Box sx={{p: 3}}> 147 153 {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> 150 166 <Table size="small"> 151 167 <TableBody> … … 193 209 </TableBody> 194 210 </Table> 195 </ Grid>196 197 < Grid item xs={12} md={4}>211 </Box> 212 213 <Box> 198 214 <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> 201 218 <Typography color="primary.main" variant="body2" 202 219 sx={{fontStyle: 'italic'}}> … … 243 260 </Button> 244 261 </Box> 245 </ Grid>246 </ Grid>262 </Box> 263 </Box> 247 264 )} 248 265 … … 313 330 ))} 314 331 {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> 317 335 )} 318 336 </Box>
Note:
See TracChangeset
for help on using the changeset viewer.
