Ignore:
Timestamp:
12/28/25 00:07:22 (7 months ago)
Author:
Mihail <mihail2.naumov@…>
Branches:
main
Children:
9c87509
Parents:
f7c0b0d
Message:

Added frontend elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/BuildDetailsDialog.tsx

    rf7c0b0d re599341  
    22import {
    33    Dialog, DialogTitle, DialogContent, Button, Grid, Box, Typography,
    4     IconButton, Tab, Tabs, Table, TableBody, TableCell, TableRow, Rating, TextField, Avatar, Divider, Chip, CardMedia
     4    IconButton, Tab, Tabs, Table, TableBody, TableCell, TableRow, Rating, TextField, Avatar, Chip
    55} from '@mui/material';
    66import CloseIcon from '@mui/icons-material/Close';
     
    88import FavoriteIcon from '@mui/icons-material/Favorite';
    99import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
     10import PersonIcon from "@mui/icons-material/Person";
    1011import { onGetBuildDetails, onSetReview, onToggleFavorite } from '../pages/+Layout.telefunc';
    11 import PersonIcon from "@mui/icons-material/Person";
    1212
    1313const formatPrice = (price: any) => new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(Number(price) || 0);
     
    2424        if (open && buildId) {
    2525            setLoading(true);
     26            setReviewText("");
     27            setRatingVal(5);
     28
    2629            onGetBuildDetails({ buildId })
    2730                .then(data => {
     
    4346        if (!currentUser) return alert("Please login to review.");
    4447        await onSetReview({ buildId, content: reviewText });
     48
     49        setReviewText("");
    4550
    4651        const refreshed = await onGetBuildDetails({ buildId });
     
    8186                        <Box sx={{ p: 3 }}>
    8287                            {tabIndex === 0 && (
    83                                 <Grid container spacing={4}>
     88                                <Grid container spacing={2}>
    8489                                    <Grid item xs={12} md={8}>
    8590                                        <Table size="small">
     
    8893                                                    <TableRow key={comp.id}>
    8994                                                        <TableCell sx={{ width: 50 }}>
    90                                                             {/*<Avatar*/}
    91                                                             {/*    src={comp.img_url || undefined}*/}
    92                                                             {/*    variant="rounded"*/}
    93                                                             {/*    sx={{ width: 40, height: 40, bgcolor: '#ff8201' }}*/}
    94                                                             {/*>*/}
    95                                                             {/*    {comp.type?.[0]?.toUpperCase()}*/}
    96                                                             {/*</Avatar>*/}
    97                                                             {/*<PersonIcon sx={{ fontSize: 16 }} />*/}
    98                                                             <CardMedia
    99                                                                 component="img"
    100                                                                 height="50"
    101                                                                 width="50"
    102                                                                 image={"https://placehold.co/400x400?text=CPU"}
    103 
    104                                                             />
     95                                                            <Avatar
     96                                                                src={comp.img_url || undefined}
     97                                                                variant="rounded"
     98                                                                sx={{ width: 45, height: 45, bgcolor: '#ff8201'}}
     99                                                            >
     100                                                                {comp.type?.substring(0, 3)?.toUpperCase()}
     101                                                            </Avatar>
    105102                                                        </TableCell>
    106103                                                        <TableCell>
Note: See TracChangeset for help on using the changeset viewer.