Changeset 41825d5


Ignore:
Timestamp:
03/01/26 22:55:00 (4 months ago)
Author:
Mihail <mihail2.naumov@…>
Branches:
main
Children:
ff3a614
Parents:
1d7e8fe
Message:

Fixed auth issues

Location:
components
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • components/BuildDetailsDialog.tsx

    r1d7e8fe r41825d5  
    244244                                            </Box>
    245245
    246                                             <Box sx={{display: 'flex', flexDirection: 'column', gap: 1}}>
    247                                                 {isDashboardView && isOwner ? (
     246                                            {currentUser && (
     247                                                <Box sx={{display: 'flex', flexDirection: 'column', gap: 1}}>
     248                                                    {isDashboardView && isOwner ? (
     249                                                        <Button
     250                                                            variant="contained"
     251                                                            color="primary"
     252                                                            size="large"
     253                                                            startIcon={<AutoFixHighIcon/>}
     254                                                            onClick={() => {
     255                                                                window.location.href = `/forge?buildId=${details.id}`;
     256                                                                onClose();
     257                                                            }}
     258                                                        >
     259                                                            Edit Build
     260                                                        </Button>
     261                                                    ) : (
     262                                                        <Button
     263                                                            variant="contained"
     264                                                            color="primary"
     265                                                            size="large"
     266                                                            startIcon={<AutoFixHighIcon/>}
     267                                                            onClick={() => {
     268                                                                setCloningBuildId(details.id);
     269                                                                setCloneDialogOpen(true);
     270                                                            }}
     271                                                        >
     272                                                            Clone & Edit
     273                                                        </Button>
     274                                                    )}
    248275                                                    <Button
    249                                                         variant="contained"
    250                                                         color="primary"
    251                                                         size="large"
    252                                                         startIcon={<AutoFixHighIcon/>}
    253                                                         onClick={() => {
    254                                                             window.location.href = `/forge?buildId=${details.id}`;
    255                                                             onClose();
    256                                                         }}
     276                                                        variant={details.isFavorite ? "contained" : "outlined"}
     277                                                        color={details.isFavorite ? "error" : "primary"}
     278                                                        startIcon={details.isFavorite ? <FavoriteIcon/> : <FavoriteBorderIcon/>}
     279                                                        onClick={handleFavorite}
    257280                                                    >
    258                                                         Edit Build
     281                                                        {details.isFavorite ? "Favorited" : "Add to Favorites"}
    259282                                                    </Button>
    260                                                 ) : (
    261                                                     <Button
    262                                                         variant="contained"
    263                                                         color="primary"
    264                                                         size="large"
    265                                                         startIcon={<AutoFixHighIcon/>}
    266                                                         onClick={() => {
    267                                                             setCloningBuildId(details.id);
    268                                                             setCloneDialogOpen(true);
    269                                                         }}                                                    >
    270                                                         Clone & Edit
    271                                                     </Button>
    272                                                 )}
    273                                                 <Button
    274                                                     variant={details.isFavorite ? "contained" : "outlined"}
    275                                                     color={details.isFavorite ? "error" : "primary"}
    276                                                     startIcon={details.isFavorite ? <FavoriteIcon/> :
    277                                                         <FavoriteBorderIcon/>}
    278                                                     onClick={handleFavorite}
    279                                                 >
    280                                                     {details.isFavorite ? "Favorited" : "Add to Favorites"}
    281                                                 </Button>
    282                                             </Box>
     283                                                </Box>
     284                                            )}
     285
    283286                                        </Box>
    284287                                    </Box>
  • components/ComponentDialog.tsx

    r1d7e8fe r41825d5  
    249249            </Box>
    250250
    251             <Button
    252                 fullWidth
    253                 variant="contained"
    254                 startIcon={<AddCircleIcon/>}
    255                 onClick={() => setSuggestOpen(true)}
    256                 sx={{
    257                     mt: 2,
    258                     bgcolor: '#ff8201',
    259                     fontWeight: 'bold',
    260                     fontSize: '0.875rem',
    261                     '&:hover': {bgcolor: '#e67300'}
    262                 }}
    263             >
    264                 Suggest Component
    265             </Button>
     251            {userId && (
     252                <Button
     253                    fullWidth
     254                    variant="contained"
     255                    startIcon={<AddCircleIcon/>}
     256                    onClick={() => setSuggestOpen(true)}
     257                    sx={{
     258                        mt: 2,
     259                        bgcolor: '#ff8201',
     260                        fontWeight: 'bold',
     261                        fontSize: '0.875rem',
     262                        '&:hover': {bgcolor: '#e67300'}
     263                    }}
     264                >
     265                    Suggest Component
     266                </Button>
     267            )}
    266268        </Box>
    267     ), [tempSearchQuery, sortOrder, selectedBrands, availableBrands, priceRange]);
     269    ), [tempSearchQuery, sortOrder, selectedBrands, availableBrands, priceRange, userId]);
    268270
    269271    if (!open) return null;
Note: See TracChangeset for help on using the changeset viewer.